1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 14:36:32 +00:00

Add ssh key and path per host

This commit is contained in:
galal-hussein
2017-12-02 19:07:47 +02:00
parent fd07818809
commit f7905e2dfd
8 changed files with 100 additions and 75 deletions

View File

@@ -42,6 +42,7 @@ const (
DefaultInfraContainerImage = "gcr.io/google_containers/pause-amd64:3.0"
DefaultAuthStrategy = "x509"
DefaultNetworkPlugin = "flannel"
DefaultClusterSSHKeyPath = "~/.ssh/id_rsa"
StateConfigMapName = "cluster-state"
UpdateStateTimeout = 30
GetStateTimeout = 30
@@ -110,6 +111,9 @@ func parseClusterFile(clusterFile string) (*Cluster, error) {
}
func (c *Cluster) setClusterDefaults() {
if len(c.SSHKeyPath) == 0 {
c.SSHKeyPath = DefaultClusterSSHKeyPath
}
for i, host := range c.Nodes {
if len(host.InternalAddress) == 0 {
c.Nodes[i].InternalAddress = c.Nodes[i].Address
@@ -118,6 +122,9 @@ func (c *Cluster) setClusterDefaults() {
// This is a temporary modification
c.Nodes[i].HostnameOverride = c.Nodes[i].Address
}
if len(host.SSHKeyPath) == 0 {
c.Nodes[i].SSHKeyPath = c.SSHKeyPath
}
}
if len(c.Services.KubeAPI.ServiceClusterIPRange) == 0 {
c.Services.KubeAPI.ServiceClusterIPRange = DefaultServiceClusterIPRange