Skip to content

Commit 036c65c

Browse files
committed
Add additional fields in InitConfiguration and JoinConfiguration
1 parent f85ebec commit 036c65c

File tree

7 files changed

+131
-39
lines changed

7 files changed

+131
-39
lines changed

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

+38-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/api/v1beta1/kubeadm_types.go

+23
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ type InitConfiguration struct {
5353
// fails you may set the desired value here.
5454
// +optional
5555
LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"`
56+
57+
// Patches contains options related to applying patches to components deployed by kubeadm during
58+
// "kubeadm init". The minimum kubernetes version needed to support Patches is v1.22
59+
// +optional
60+
Patches *Patches `json:"patches,omitempty"`
5661
}
5762

5863
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -360,6 +365,11 @@ type JoinConfiguration struct {
360365
// If nil, no additional control plane instance will be deployed.
361366
// +optional
362367
ControlPlane *JoinControlPlane `json:"controlPlane,omitempty"`
368+
369+
// Patches contains options related to applying patches to components deployed by kubeadm during
370+
// "kubeadm join". The minimum kubernetes version needed to support Patches is v1.22
371+
// +optional
372+
Patches *Patches `json:"patches,omitempty"`
363373
}
364374

365375
// JoinControlPlane contains elements describing an additional control plane instance to be deployed on the joining node.
@@ -500,3 +510,16 @@ func NewBootstrapTokenString(token string) (*BootstrapTokenString, error) {
500510

501511
return &BootstrapTokenString{ID: substrs[1], Secret: substrs[2]}, nil
502512
}
513+
514+
// Patches contains options related to applying patches to components deployed by kubeadm.
515+
type Patches struct {
516+
// Directory is a path to a directory that contains files named "target[suffix][+patchtype].extension".
517+
// For example, "kube-apiserver0+merge.yaml" or just "etcd.json". "target" can be one of
518+
// "kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd". "patchtype" can be one
519+
// of "strategic" "merge" or "json" and they match the patch formats supported by kubectl.
520+
// The default "patchtype" is "strategic". "extension" must be either "json" or "yaml".
521+
// "suffix" is an optional string that can be used to determine which patches are applied
522+
// first alpha-numerically.
523+
// +optional
524+
Directory string `json:"directory,omitempty"`
525+
}

bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.conversion.go

+2-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/types/upstreamv1beta2/zz_generated.conversion.go

+2-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/types/upstreamv1beta3/conversion.go

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ func Convert_upstreamv1beta3_NodeRegistrationOptions_To_v1beta1_NodeRegistration
7474
return autoConvert_upstreamv1beta3_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in, out, s)
7575
}
7676

77+
func Convert_upstreamv1beta3_Patches_To_v1beta1_Patches(in *Patches, out *bootstrapv1.Patches, s apimachineryconversion.Scope) error{
78+
return autoConvert_upstreamv1beta3_Patches_To_v1beta1_Patches(in, out, s)
79+
}
80+
7781
func Convert_upstreamv1beta3_JoinControlPlane_To_v1beta1_JoinControlPlane(in *JoinControlPlane, out *bootstrapv1.JoinControlPlane, s apimachineryconversion.Scope) error {
7882
// JoinControlPlane.CertificateKey exists in v1beta3 types but not in bootstrapv1.JoinControlPlane (Cluster API does not uses automatic copy certs). Ignoring when converting.
7983
return autoConvert_upstreamv1beta3_JoinControlPlane_To_v1beta1_JoinControlPlane(in, out, s)

bootstrap/kubeadm/types/upstreamv1beta3/types.go

+18
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ type InitConfiguration struct {
6060
// The flag "--skip-phases" takes precedence over this field.
6161
// +optional
6262
SkipPhases []string `json:"skipPhases,omitempty"`
63+
64+
// Patches contains options related to applying patches to components deployed by kubeadm during
65+
// "kubeadm init". The minimum kubernetes version needed to support Patches is v1.22
66+
// +optional
67+
Patches *Patches `json:"patches,omitempty"`
6368
}
6469

6570
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -433,3 +438,16 @@ type HostPathMount struct {
433438
// +optional
434439
PathType corev1.HostPathType `json:"pathType,omitempty"`
435440
}
441+
442+
// Patches contains options related to applying patches to components deployed by kubeadm.
443+
type Patches struct {
444+
// Directory is a path to a directory that contains files named "target[suffix][+patchtype].extension".
445+
// For example, "kube-apiserver0+merge.yaml" or just "etcd.json". "target" can be one of
446+
// "kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd". "patchtype" can be one
447+
// of "strategic" "merge" or "json" and they match the patch formats supported by kubectl.
448+
// The default "patchtype" is "strategic". "extension" must be either "json" or "yaml".
449+
// "suffix" is an optional string that can be used to determine which patches are applied
450+
// first alpha-numerically.
451+
// +optional
452+
Directory string `json:"directory,omitempty"`
453+
}

bootstrap/kubeadm/types/upstreamv1beta3/zz_generated.conversion.go

+44-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)