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
de9a5f43
Commit
de9a5f43
authored
May 29, 2015
by
CJ Cullen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specify sshUser, sshKeyfile in kube-apiserver manifest.
Trim space on ssh key so GCE doesn't treat it as 2 lines. A couple other minor fixes.
parent
5115fd57
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
kube-apiserver.manifest
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest
+1
-1
gce.go
pkg/cloudprovider/gce/gce.go
+2
-0
master.go
pkg/master/master.go
+5
-1
No files found.
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest
View file @
de9a5f43
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
{% endif -%}
{% endif -%}
{% set params = address + " " + etcd_servers + " " + cloud_provider + " " + cloud_config + " " + runtime_config + " " + admission_control + " " + service_cluster_ip_range + " " + client_ca_file + " " + basic_auth_file + " " + min_request_timeout -%}
{% set params = address + " " + etcd_servers + " " + cloud_provider + " " + cloud_config + " " + runtime_config + " " + admission_control + " " + service_cluster_ip_range + " " + client_ca_file + " " + basic_auth_file + " " + min_request_timeout -%}
{% set params = params + " " + cluster_name + " " + cert_file + " " + key_file + " --secure_port=" + secure_port + " " + token_auth_file + " " + bind_address + " " + pillar['log_level'] + " " + advertise_address -%}
{% set params = params + " " + cluster_name + " " + cert_file + " " + key_file + " --secure_port=" + secure_port + " " + token_auth_file + " " + bind_address + " " + pillar['log_level'] + " " + advertise_address
+ " --ssh-user=root --ssh-keyfile=/.sshkeyfile"
-%}
{
{
"apiVersion": "v1beta3",
"apiVersion": "v1beta3",
...
...
pkg/cloudprovider/gce/gce.go
View file @
de9a5f43
...
@@ -17,6 +17,7 @@ limitations under the License.
...
@@ -17,6 +17,7 @@ limitations under the License.
package
gce_cloud
package
gce_cloud
import
(
import
(
"bytes"
"fmt"
"fmt"
"io"
"io"
"io/ioutil"
"io/ioutil"
...
@@ -484,6 +485,7 @@ func (gce *GCECloud) AddSSHKeyToAllInstances(user string, keyData []byte) error
...
@@ -484,6 +485,7 @@ func (gce *GCECloud) AddSSHKeyToAllInstances(user string, keyData []byte) error
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
keyData
=
bytes
.
TrimSpace
(
keyData
)
found
:=
false
found
:=
false
for
_
,
item
:=
range
project
.
CommonInstanceMetadata
.
Items
{
for
_
,
item
:=
range
project
.
CommonInstanceMetadata
.
Items
{
if
item
.
Key
==
"sshKeys"
{
if
item
.
Key
==
"sshKeys"
{
...
...
pkg/master/master.go
View file @
de9a5f43
...
@@ -340,6 +340,8 @@ func New(c *Config) *Master {
...
@@ -340,6 +340,8 @@ func New(c *Config) *Master {
serviceReadWriteIP
:
serviceReadWriteIP
,
serviceReadWriteIP
:
serviceReadWriteIP
,
// TODO: serviceReadWritePort should be passed in as an argument, it may not always be 443
// TODO: serviceReadWritePort should be passed in as an argument, it may not always be 443
serviceReadWritePort
:
443
,
serviceReadWritePort
:
443
,
installSSHKey
:
c
.
InstallSSHKey
,
}
}
var
handlerContainer
*
restful
.
Container
var
handlerContainer
*
restful
.
Container
...
@@ -827,7 +829,9 @@ func (m *Master) generateSSHKey(user, keyfile string) error {
...
@@ -827,7 +829,9 @@ func (m *Master) generateSSHKey(user, keyfile string) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
ioutil
.
WriteFile
(
keyfile
,
util
.
EncodePrivateKey
(
private
),
0600
)
if
err
:=
ioutil
.
WriteFile
(
keyfile
,
util
.
EncodePrivateKey
(
private
),
0600
);
err
!=
nil
{
return
err
}
data
,
err
:=
util
.
EncodeSSHKey
(
public
)
data
,
err
:=
util
.
EncodeSSHKey
(
public
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
...
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