mirror of https://github.com/kubernetes/kops.git
Added the --ssh-access flag to specify the sshAccess on cluster creation from the cli
This commit is contained in:
parent
5938e4f8dd
commit
f7979692b1
|
|
@ -72,6 +72,7 @@ type CreateClusterOptions struct {
|
||||||
NetworkCIDR string
|
NetworkCIDR string
|
||||||
DNSZone string
|
DNSZone string
|
||||||
AdminAccess []string
|
AdminAccess []string
|
||||||
|
SSHAccess []string
|
||||||
Networking string
|
Networking string
|
||||||
NodeSecurityGroups []string
|
NodeSecurityGroups []string
|
||||||
MasterSecurityGroups []string
|
MasterSecurityGroups []string
|
||||||
|
|
@ -250,7 +251,8 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
|
||||||
|
|
||||||
cmd.Flags().StringVar(&options.DNSZone, "dns-zone", options.DNSZone, "DNS hosted zone to use (defaults to longest matching zone)")
|
cmd.Flags().StringVar(&options.DNSZone, "dns-zone", options.DNSZone, "DNS hosted zone to use (defaults to longest matching zone)")
|
||||||
cmd.Flags().StringVar(&options.OutDir, "out", options.OutDir, "Path to write any local output")
|
cmd.Flags().StringVar(&options.OutDir, "out", options.OutDir, "Path to write any local output")
|
||||||
cmd.Flags().StringSliceVar(&options.AdminAccess, "admin-access", options.AdminAccess, "Restrict access to admin endpoints (SSH, HTTPS) to this CIDR. If not set, access will not be restricted by IP.")
|
cmd.Flags().StringSliceVar(&options.AdminAccess, "admin-access", options.AdminAccess, "Restrict API access to this CIDR. If not set, access will not be restricted by IP.")
|
||||||
|
cmd.Flags().StringSliceVar(&options.SSHAccess, "ssh-access", options.SSHAccess, "Restrict SSH access to this CIDR. If not set, access will not be restricted by IP.")
|
||||||
|
|
||||||
// TODO: Can we deprecate this flag - it is awkward?
|
// TODO: Can we deprecate this flag - it is awkward?
|
||||||
cmd.Flags().BoolVar(&associatePublicIP, "associate-public-ip", false, "Specify --associate-public-ip=[true|false] to enable/disable association of public IP for master ASG and nodes. Default is 'true'.")
|
cmd.Flags().BoolVar(&associatePublicIP, "associate-public-ip", false, "Specify --associate-public-ip=[true|false] to enable/disable association of public IP for master ASG and nodes. Default is 'true'.")
|
||||||
|
|
@ -843,7 +845,13 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.AdminAccess) != 0 {
|
if len(c.AdminAccess) != 0 {
|
||||||
cluster.Spec.SSHAccess = c.AdminAccess
|
if len(c.SSHAccess) != 0 {
|
||||||
|
glog.Infof("SSHAccess set to: %s", c.SSHAccess)
|
||||||
|
cluster.Spec.SSHAccess = c.SSHAccess
|
||||||
|
} else {
|
||||||
|
glog.Infof("SSHAccess set to: %s", c.SSHAccess)
|
||||||
|
cluster.Spec.SSHAccess = c.AdminAccess
|
||||||
|
}
|
||||||
cluster.Spec.KubernetesAPIAccess = c.AdminAccess
|
cluster.Spec.KubernetesAPIAccess = c.AdminAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue