From 71e5a217865f2dd3ca363e5dfa336826b2256d4a Mon Sep 17 00:00:00 2001 From: justinsb Date: Sat, 18 Dec 2021 19:40:38 -0500 Subject: [PATCH] componentconfig: expose advertise-address flag for kube-apiserver This flag determines which IPs are advertised inside the cluster, in the "kubernetes" service in the "default" namespace. --- k8s/crds/kops.k8s.io_clusters.yaml | 4 ++++ pkg/apis/kops/componentconfig.go | 2 ++ pkg/apis/kops/v1alpha2/componentconfig.go | 2 ++ pkg/apis/kops/v1alpha2/zz_generated.conversion.go | 2 ++ pkg/apis/kops/v1alpha3/componentconfig.go | 2 ++ pkg/apis/kops/v1alpha3/zz_generated.conversion.go | 2 ++ 6 files changed, 14 insertions(+) diff --git a/k8s/crds/kops.k8s.io_clusters.yaml b/k8s/crds/kops.k8s.io_clusters.yaml index de9fd3a551..4ea0f983b1 100644 --- a/k8s/crds/kops.k8s.io_clusters.yaml +++ b/k8s/crds/kops.k8s.io_clusters.yaml @@ -1347,6 +1347,10 @@ spec: description: AdmissionControlConfigFile is the location of the admission-control-config-file type: string + advertiseAddress: + description: AdvertiseAddress is the IP address on which to advertise + the apiserver to members of the cluster. + type: string allowPrivileged: description: AllowPrivileged indicates if we can run privileged containers diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index 6a701541db..736d8a3445 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -290,6 +290,8 @@ type KubeAPIServerConfig struct { InsecurePort *int32 `json:"insecurePort,omitempty" flag:"insecure-port"` // Address is the binding address for the kube api: Deprecated - use insecure-bind-address and bind-address Address string `json:"address,omitempty" flag:"address"` + // AdvertiseAddress is the IP address on which to advertise the apiserver to members of the cluster. + AdvertiseAddress string `json:"advertiseAddress,omitempty" flag:"advertise-address"` // BindAddress is the binding address for the secure kubernetes API BindAddress string `json:"bindAddress,omitempty" flag:"bind-address"` // InsecureBindAddress is the binding address for the InsecurePort for the insecure kubernetes API diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index 101eb3af69..857f26080d 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -290,6 +290,8 @@ type KubeAPIServerConfig struct { InsecurePort *int32 `json:"insecurePort,omitempty" flag:"insecure-port"` // Address is the binding address for the kube api: Deprecated - use insecure-bind-address and bind-address Address string `json:"address,omitempty" flag:"address"` + // AdvertiseAddress is the IP address on which to advertise the apiserver to members of the cluster. + AdvertiseAddress string `json:"advertiseAddress,omitempty" flag:"advertise-address"` // BindAddress is the binding address for the secure kubernetes API BindAddress string `json:"bindAddress,omitempty" flag:"bind-address"` // InsecureBindAddress is the binding address for the InsecurePort for the insecure kubernetes API diff --git a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go index af971a1f6f..34c9825afb 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go @@ -4754,6 +4754,7 @@ func autoConvert_v1alpha2_KubeAPIServerConfig_To_kops_KubeAPIServerConfig(in *Ku out.SecurePort = in.SecurePort out.InsecurePort = in.InsecurePort out.Address = in.Address + out.AdvertiseAddress = in.AdvertiseAddress out.BindAddress = in.BindAddress out.InsecureBindAddress = in.InsecureBindAddress out.EnableBootstrapAuthToken = in.EnableBootstrapAuthToken @@ -4865,6 +4866,7 @@ func autoConvert_kops_KubeAPIServerConfig_To_v1alpha2_KubeAPIServerConfig(in *ko out.SecurePort = in.SecurePort out.InsecurePort = in.InsecurePort out.Address = in.Address + out.AdvertiseAddress = in.AdvertiseAddress out.BindAddress = in.BindAddress out.InsecureBindAddress = in.InsecureBindAddress out.EnableBootstrapAuthToken = in.EnableBootstrapAuthToken diff --git a/pkg/apis/kops/v1alpha3/componentconfig.go b/pkg/apis/kops/v1alpha3/componentconfig.go index 77893dadb7..dbc72716c7 100644 --- a/pkg/apis/kops/v1alpha3/componentconfig.go +++ b/pkg/apis/kops/v1alpha3/componentconfig.go @@ -288,6 +288,8 @@ type KubeAPIServerConfig struct { InsecurePort *int32 `json:"insecurePort,omitempty" flag:"insecure-port"` // Address is the binding address for the kube api: Deprecated - use insecure-bind-address and bind-address Address string `json:"address,omitempty" flag:"address"` + // AdvertiseAddress is the IP address on which to advertise the apiserver to members of the cluster. + AdvertiseAddress string `json:"advertiseAddress,omitempty" flag:"advertise-address"` // BindAddress is the binding address for the secure kubernetes API BindAddress string `json:"bindAddress,omitempty" flag:"bind-address"` // InsecureBindAddress is the binding address for the InsecurePort for the insecure kubernetes API diff --git a/pkg/apis/kops/v1alpha3/zz_generated.conversion.go b/pkg/apis/kops/v1alpha3/zz_generated.conversion.go index 46c3a52d30..8f8b85f271 100644 --- a/pkg/apis/kops/v1alpha3/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha3/zz_generated.conversion.go @@ -4644,6 +4644,7 @@ func autoConvert_v1alpha3_KubeAPIServerConfig_To_kops_KubeAPIServerConfig(in *Ku out.SecurePort = in.SecurePort out.InsecurePort = in.InsecurePort out.Address = in.Address + out.AdvertiseAddress = in.AdvertiseAddress out.BindAddress = in.BindAddress out.InsecureBindAddress = in.InsecureBindAddress out.EnableBootstrapAuthToken = in.EnableBootstrapAuthToken @@ -4755,6 +4756,7 @@ func autoConvert_kops_KubeAPIServerConfig_To_v1alpha3_KubeAPIServerConfig(in *ko out.SecurePort = in.SecurePort out.InsecurePort = in.InsecurePort out.Address = in.Address + out.AdvertiseAddress = in.AdvertiseAddress out.BindAddress = in.BindAddress out.InsecureBindAddress = in.InsecureBindAddress out.EnableBootstrapAuthToken = in.EnableBootstrapAuthToken