Skip to content

Commit

Permalink
Add additional fields in InitConfiguration and JoinConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
asifdxtreme committed Jan 11, 2022
1 parent f85ebec commit 036c65c
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 39 deletions.
52 changes: 38 additions & 14 deletions bootstrap/kubeadm/api/v1alpha4/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions bootstrap/kubeadm/api/v1beta1/kubeadm_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ type InitConfiguration struct {
// fails you may set the desired value here.
// +optional
LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"`

// Patches contains options related to applying patches to components deployed by kubeadm during
// "kubeadm init". The minimum kubernetes version needed to support Patches is v1.22
// +optional
Patches *Patches `json:"patches,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -360,6 +365,11 @@ type JoinConfiguration struct {
// If nil, no additional control plane instance will be deployed.
// +optional
ControlPlane *JoinControlPlane `json:"controlPlane,omitempty"`

// Patches contains options related to applying patches to components deployed by kubeadm during
// "kubeadm join". The minimum kubernetes version needed to support Patches is v1.22
// +optional
Patches *Patches `json:"patches,omitempty"`
}

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

return &BootstrapTokenString{ID: substrs[1], Secret: substrs[2]}, nil
}

// Patches contains options related to applying patches to components deployed by kubeadm.
type Patches struct {
// Directory is a path to a directory that contains files named "target[suffix][+patchtype].extension".
// For example, "kube-apiserver0+merge.yaml" or just "etcd.json". "target" can be one of
// "kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd". "patchtype" can be one
// of "strategic" "merge" or "json" and they match the patch formats supported by kubectl.
// The default "patchtype" is "strategic". "extension" must be either "json" or "yaml".
// "suffix" is an optional string that can be used to determine which patches are applied
// first alpha-numerically.
// +optional
Directory string `json:"directory,omitempty"`
}
12 changes: 2 additions & 10 deletions bootstrap/kubeadm/types/upstreamv1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 2 additions & 10 deletions bootstrap/kubeadm/types/upstreamv1beta2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions bootstrap/kubeadm/types/upstreamv1beta3/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func Convert_upstreamv1beta3_NodeRegistrationOptions_To_v1beta1_NodeRegistration
return autoConvert_upstreamv1beta3_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in, out, s)
}

func Convert_upstreamv1beta3_Patches_To_v1beta1_Patches(in *Patches, out *bootstrapv1.Patches, s apimachineryconversion.Scope) error{
return autoConvert_upstreamv1beta3_Patches_To_v1beta1_Patches(in, out, s)
}

func Convert_upstreamv1beta3_JoinControlPlane_To_v1beta1_JoinControlPlane(in *JoinControlPlane, out *bootstrapv1.JoinControlPlane, s apimachineryconversion.Scope) error {
// JoinControlPlane.CertificateKey exists in v1beta3 types but not in bootstrapv1.JoinControlPlane (Cluster API does not uses automatic copy certs). Ignoring when converting.
return autoConvert_upstreamv1beta3_JoinControlPlane_To_v1beta1_JoinControlPlane(in, out, s)
Expand Down
18 changes: 18 additions & 0 deletions bootstrap/kubeadm/types/upstreamv1beta3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ type InitConfiguration struct {
// The flag "--skip-phases" takes precedence over this field.
// +optional
SkipPhases []string `json:"skipPhases,omitempty"`

// Patches contains options related to applying patches to components deployed by kubeadm during
// "kubeadm init". The minimum kubernetes version needed to support Patches is v1.22
// +optional
Patches *Patches `json:"patches,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -433,3 +438,16 @@ type HostPathMount struct {
// +optional
PathType corev1.HostPathType `json:"pathType,omitempty"`
}

// Patches contains options related to applying patches to components deployed by kubeadm.
type Patches struct {
// Directory is a path to a directory that contains files named "target[suffix][+patchtype].extension".
// For example, "kube-apiserver0+merge.yaml" or just "etcd.json". "target" can be one of
// "kube-apiserver", "kube-controller-manager", "kube-scheduler", "etcd". "patchtype" can be one
// of "strategic" "merge" or "json" and they match the patch formats supported by kubectl.
// The default "patchtype" is "strategic". "extension" must be either "json" or "yaml".
// "suffix" is an optional string that can be used to determine which patches are applied
// first alpha-numerically.
// +optional
Directory string `json:"directory,omitempty"`
}
49 changes: 44 additions & 5 deletions bootstrap/kubeadm/types/upstreamv1beta3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 036c65c

Please sign in to comment.