Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
04cd9b3c
Commit
04cd9b3c
authored
Jun 05, 2015
by
CJ Cullen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sshproxy use a hostmount on master PD (don't spam sshKeys on upgrade/reboot).
Add comment describing what SSHTunnelList.Close() does. Simplify util.FileExists.
parent
cb317604
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
12 deletions
+15
-12
configure-vm.sh
cluster/gce/configure-vm.sh
+3
-0
kube-apiserver.manifest
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest
+6
-5
ssh.go
pkg/util/ssh.go
+3
-1
util.go
pkg/util/util.go
+3
-6
No files found.
cluster/gce/configure-vm.sh
View file @
04cd9b3c
...
...
@@ -220,9 +220,12 @@ mount-master-pd() {
mkdir
-p
/mnt/master-pd/srv/kubernetes
# Contains the cluster's initial config parameters and auth tokens
mkdir
-p
/mnt/master-pd/srv/salt-overlay
# Directory for kube-apiserver to store SSH key (if necessary)
mkdir
-p
/mnt/master-pd/srv/sshproxy
ln
-s
-f
/mnt/master-pd/var/etcd /var/etcd
ln
-s
-f
/mnt/master-pd/srv/kubernetes /srv/kubernetes
ln
-s
-f
/mnt/master-pd/srv/sshproxy /srv/sshproxy
ln
-s
-f
/mnt/master-pd/srv/salt-overlay /srv/salt-overlay
# This is a bit of a hack to get around the fact that salt has to run after the
...
...
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest
View file @
04cd9b3c
...
...
@@ -25,7 +25,7 @@
{% set proxy_ssh_options = "" -%}
{% if grains.proxy_ssh_user is defined -%}
{% set proxy_ssh_options = "--ssh-user=" + grains.proxy_ssh_user + " --ssh-keyfile=/sshproxy/.sshkeyfile" -%}
{% set proxy_ssh_options = "--ssh-user=" + grains.proxy_ssh_user + " --ssh-keyfile=/s
rv/s
shproxy/.sshkeyfile" -%}
{% endif -%}
{% set address = "--address=127.0.0.1" -%}
...
...
@@ -143,8 +143,8 @@
{ "name": "etcpkitls",
"mountPath": "/etc/pki/tls",
"readOnly": true},
{ "name": "sshproxy",
"mountPath": "/sshproxy",
{ "name": "s
rvs
shproxy",
"mountPath": "/s
rv/s
shproxy",
"readOnly": false}
]
}
...
...
@@ -191,8 +191,9 @@
"hostPath": {
"path": "/etc/pki/tls"}
},
{ "name": "sshproxy",
"emptyDir": {}
{ "name": "srvsshproxy",
"hostPath": {
"path": "/srv/sshproxy"}
}
]
}}
pkg/util/ssh.go
View file @
04cd9b3c
...
...
@@ -91,7 +91,6 @@ func (s *SSHTunnel) tunnel(conn net.Conn, remoteHost, remotePort string) error {
}
func
(
s
*
SSHTunnel
)
Close
()
error
{
glog
.
Infof
(
"Closing tunnel for host: %q"
,
s
.
Host
)
if
err
:=
s
.
client
.
Close
();
err
!=
nil
{
return
err
}
...
...
@@ -183,6 +182,9 @@ func (l SSHTunnelList) Open() error {
return
nil
}
// Close asynchronously closes all tunnels in the list after waiting for 1
// minute. Tunnels will still be open upon this function's return, but should
// no longer be used.
func
(
l
SSHTunnelList
)
Close
()
{
for
ix
:=
range
l
{
entry
:=
l
[
ix
]
...
...
pkg/util/util.go
View file @
04cd9b3c
...
...
@@ -515,16 +515,13 @@ func ShortenString(str string, n int) string {
}
else
{
return
str
[
:
n
]
}
}
func
FileExists
(
filename
string
)
(
bool
,
error
)
{
file
,
err
:=
os
.
Open
(
filename
)
defer
file
.
Close
()
if
err
!=
nil
{
if
os
.
IsNotExist
(
err
)
{
if
_
,
err
:=
os
.
Stat
(
filename
);
os
.
IsNotExist
(
err
)
{
return
false
,
nil
}
else
{
}
else
if
err
!=
nil
{
return
false
,
err
}
}
return
true
,
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment