Skip to content

Commit 9298547

Browse files
authored
Merge pull request kubernetes#3385 from mdavidsen/feature/kops-add-master-public-name
Add --master-public-name argument to kops create_cluster
2 parents 7066368 + 578fb58 commit 9298547

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

cmd/kops/create_cluster.go

+10
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ type CreateClusterOptions struct {
113113
// Specify API loadbalancer as public or internal
114114
APILoadBalancerType string
115115

116+
// Allow custom public master name
117+
MasterPublicName string
118+
116119
// vSphere options
117120
VSphereServer string
118121
VSphereDatacenter string
@@ -308,6 +311,9 @@ func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
308311

309312
cmd.Flags().StringVar(&options.APILoadBalancerType, "api-loadbalancer-type", options.APILoadBalancerType, "Sets the API loadbalancer type to either 'public' or 'internal'")
310313

314+
// Allow custom public master name
315+
cmd.Flags().StringVar(&options.MasterPublicName, "master-public-name", options.MasterPublicName, "Sets the public master public name")
316+
311317
// DryRun mode that will print YAML or JSON
312318
cmd.Flags().BoolVar(&options.DryRun, "dry-run", options.DryRun, "If true, only print the object that would be sent, without sending it. This flag can be used to create a cluster YAML or JSON manifest.")
313319
cmd.Flags().StringVarP(&options.Output, "output", "o", options.Output, "Ouput format. One of json|yaml. Used with the --dry-run flag.")
@@ -902,6 +908,10 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
902908
return fmt.Errorf("unknown DNSType: %q", c.DNSType)
903909
}
904910

911+
if c.MasterPublicName != "" {
912+
cluster.Spec.MasterPublicName = c.MasterPublicName
913+
}
914+
905915
// Populate the API access, so that it can be discoverable
906916
// TODO: This is the same code as in defaults - try to dedup?
907917
if cluster.Spec.API == nil {

docs/cli/kops_create_cluster.md

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ kops create cluster
8080
--image string Image to use for all instances.
8181
--kubernetes-version string Version of kubernetes to run (defaults to version in channel)
8282
--master-count int32 Set the number of masters. Defaults to one master per master-zone
83+
--master-public-name string Sets the public master public name
8384
--master-security-groups stringSlice Add precreated additional security groups to masters.
8485
--master-size string Set instance size for masters
8586
--master-tenancy string The tenancy of the master group on AWS. Can either be default or dedicated.

0 commit comments

Comments
 (0)