Skip to content

Commit 166d792

Browse files
committed
✨ Allow to disable KubeProxy and CoreDNS
See #12288
1 parent 393485e commit 166d792

26 files changed

+467
-52
lines changed

api/bootstrap/kubeadm/v1beta1/kubeadm_types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ type ClusterConfiguration struct {
159159
// +kubebuilder:validation:MinLength=1
160160
// +kubebuilder:validation:MaxLength=63
161161
ClusterName string `json:"clusterName,omitempty"`
162+
163+
// Proxy defines the options for the proxy add-on installed in the cluster.
164+
// +optional
165+
Proxy *Proxy `json:"proxy,omitempty"`
162166
}
163167

164168
// ControlPlaneComponent holds settings common to control plane component of the cluster.
@@ -201,6 +205,17 @@ type APIServer struct {
201205
type DNS struct {
202206
// ImageMeta allows to customize the image used for the DNS component
203207
ImageMeta `json:",inline"`
208+
209+
// Disabled specifies whether to disable this addon in the cluster
210+
// +optional
211+
Disabled *bool `json:"disabled,omitempty"`
212+
}
213+
214+
// Proxy defines the proxy addon that should be used in the cluster
215+
type Proxy struct {
216+
// Disabled specifies whether to disable this addon in the cluster
217+
// +optional
218+
Disabled *bool `json:"disabled,omitempty"`
204219
}
205220

206221
// ImageMeta allows to customize the image used for components that are not

api/bootstrap/kubeadm/v1beta1/zz_generated.conversion.go

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/bootstrap/kubeadm/v1beta1/zz_generated.deepcopy.go

Lines changed: 31 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/bootstrap/kubeadm/v1beta2/kubeadm_types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ type ClusterConfiguration struct {
164164
// featureGates enabled by the user.
165165
// +optional
166166
FeatureGates map[string]bool `json:"featureGates,omitempty"`
167+
168+
// Proxy defines the options for the proxy add-on installed in the cluster.
169+
// +optional
170+
Proxy *Proxy `json:"proxy,omitempty"`
167171
}
168172

169173
// ControlPlaneComponent holds settings common to control plane component of the cluster.
@@ -209,6 +213,17 @@ type APIServer struct {
209213
type DNS struct {
210214
// ImageMeta allows to customize the image used for the DNS component
211215
ImageMeta `json:",inline"`
216+
217+
// Disabled specifies whether to disable this addon in the cluster
218+
// +optional
219+
Disabled *bool `json:"disabled,omitempty"`
220+
}
221+
222+
// Proxy defines the proxy addon that should be used in the cluster
223+
type Proxy struct {
224+
// Disabled specifies whether to disable this addon in the cluster
225+
// +optional
226+
Disabled *bool `json:"disabled,omitempty"`
212227
}
213228

214229
// ImageMeta allows to customize the image used for components that are not

api/bootstrap/kubeadm/v1beta2/zz_generated.deepcopy.go

Lines changed: 31 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/types/upstreamv1beta3/conversion.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ func (dst *JoinConfiguration) ConvertFrom(srcRaw conversion.Hub) error {
5959

6060
// Custom conversion from this API, kubeadm v1beta3, to the hub version, CABPK v1beta1.
6161

62+
func Convert_v1beta2_ClusterConfiguration_To_upstreamv1beta3_ClusterConfiguration(in *bootstrapv1.ClusterConfiguration, out *ClusterConfiguration, s apimachineryconversion.Scope) error {
63+
// v1beta3 has no ClusterConfiguration.Proxy
64+
return autoConvert_v1beta2_ClusterConfiguration_To_upstreamv1beta3_ClusterConfiguration(in, out, s)
65+
}
66+
67+
func Convert_v1beta2_DNS_To_upstreamv1beta3_DNS(in *bootstrapv1.DNS, out *DNS, s apimachineryconversion.Scope) error {
68+
// v1beta3 has no ClusterConfiguration.DNS.Disabled
69+
return autoConvert_v1beta2_DNS_To_upstreamv1beta3_DNS(in, out, s)
70+
}
71+
6272
func Convert_upstreamv1beta3_ClusterConfiguration_To_v1beta2_ClusterConfiguration(in *ClusterConfiguration, out *bootstrapv1.ClusterConfiguration, s apimachineryconversion.Scope) error {
6373
return autoConvert_upstreamv1beta3_ClusterConfiguration_To_v1beta2_ClusterConfiguration(in, out, s)
6474
}

0 commit comments

Comments
 (0)