Skip to content

Commit

Permalink
add /kinder/patches as default patch directories
Browse files Browse the repository at this point in the history
  • Loading branch information
pacoxu committed Aug 3, 2021
1 parent f7d1418 commit 11626e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
9 changes: 0 additions & 9 deletions kinder/pkg/cluster/manager/actions/kubeadm-init.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ func kubeadmInit(cp1 *status.Node, copyCertsMode CopyCertsMode, patchesDir, igno
// NB. certificate key is passed via the config file)
)
}
if patchesDir != "" {
initArgs = append(initArgs, "--patches", constants.PatchesDir)
}

if err := cp1.Command(
"kubeadm", initArgs...,
Expand Down Expand Up @@ -143,9 +140,6 @@ func kubeadmInitWithPhases(cp1 *status.Node, copyCertsMode CopyCertsMode, patche
controlplaneArgs := []string{
"init", "phase", "control-plane", "all", fmt.Sprintf("--config=%s", constants.KubeadmConfigPath), fmt.Sprintf("--v=%d", vLevel),
}
if patchesDir != "" {
controlplaneArgs = append(controlplaneArgs, "--patches", constants.PatchesDir)
}
if err := cp1.Command(
"kubeadm", controlplaneArgs...,
).RunWithEcho(); err != nil {
Expand All @@ -155,9 +149,6 @@ func kubeadmInitWithPhases(cp1 *status.Node, copyCertsMode CopyCertsMode, patche
etcdArgs := []string{
"init", "phase", "etcd", "local", fmt.Sprintf("--config=%s", constants.KubeadmConfigPath), fmt.Sprintf("--v=%d", vLevel),
}
if patchesDir != "" {
etcdArgs = append(etcdArgs, "--patches", constants.PatchesDir)
}
if err := cp1.Command(
"kubeadm", etcdArgs...,
).RunWithEcho(); err != nil {
Expand Down
10 changes: 0 additions & 10 deletions kinder/pkg/cluster/manager/actions/kubeadm-join.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,6 @@ func kubeadmJoinControlPlane(cp *status.Node, patchesDir, ignorePreflightErrors
fmt.Sprintf("--ignore-preflight-errors=%s", ignorePreflightErrors),
fmt.Sprintf("--v=%d", vLevel),
}
if patchesDir != "" {
joinArgs = append(joinArgs, "--patches", constants.PatchesDir)
}

if err := cp.Command(
"kubeadm", joinArgs...,
Expand Down Expand Up @@ -140,10 +137,6 @@ func kubeadmJoinControlPlaneWithPhases(cp *status.Node, patchesDir, ignorePrefli
fmt.Sprintf("--v=%d", vLevel),
}

if patchesDir != "" {
prepareArgs = append(prepareArgs, "--patches", constants.PatchesDir)
}

if err := cp.Command(
"kubeadm", prepareArgs...,
).RunWithEcho(); err != nil {
Expand All @@ -165,9 +158,6 @@ func kubeadmJoinControlPlaneWithPhases(cp *status.Node, patchesDir, ignorePrefli
fmt.Sprintf("--config=%s", constants.KubeadmConfigPath),
fmt.Sprintf("--v=%d", vLevel),
}
if patchesDir != "" {
controlPlaneArgs = append(controlPlaneArgs, "--patches", constants.PatchesDir)
}

if err := cp.Command(
"kubeadm", controlPlaneArgs...,
Expand Down
4 changes: 4 additions & 0 deletions kinder/pkg/kubeadm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ nodeRegistration:
criSocket: "/run/containerd/containerd.sock"
kubeletExtraArgs:
node-ip: "{{ .NodeAddress }}"
patches:
directory: "/kinder/patches"
---
# no-op entry that exists solely so it can be patched
apiVersion: kubeadm.k8s.io/v1beta2
Expand All @@ -194,6 +196,8 @@ discovery:
apiServerEndpoint: "{{ .ControlPlaneEndpoint }}"
token: "{{ .Token }}"
unsafeSkipCAVerification: true
patches:
directory: "/kinder/patches"
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
Expand Down

0 comments on commit 11626e7

Please sign in to comment.