Skip to content

Commit

Permalink
Set kubeconfig volume path for kube-vip static pod based on OS (#7396)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna authored Jan 29, 2024
1 parent 16f8645 commit 5b38312
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 18 deletions.
4 changes: 4 additions & 0 deletions pkg/providers/tinkerbell/config/template-cp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ spec:
hostNetwork: true
volumes:
- hostPath:
{{- if (eq .format "bottlerocket") }}
path: /var/lib/kubeadm/admin.conf
{{- else }}
path: /etc/kubernetes/admin.conf
{{- end }}
name: kubeconfig
status: {}
owner: root:root
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/tinkerbell/reconciler/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ func tinkerbellCP(clusterName string, opts ...cpOpt) *tinkerbell.ControlPlane {
Permissions: "",
Encoding: "",
Append: false,
Content: "apiVersion: v1\nkind: Pod\nmetadata:\n creationTimestamp: null\n name: kube-vip\n namespace: kube-system\nspec:\n containers:\n - args:\n - manager\n env:\n - name: vip_arp\n value: \"true\"\n - name: port\n value: \"6443\"\n - name: vip_cidr\n value: \"32\"\n - name: cp_enable\n value: \"true\"\n - name: cp_namespace\n value: kube-system\n - name: vip_ddns\n value: \"false\"\n - name: vip_leaderelection\n value: \"true\"\n - name: vip_leaseduration\n value: \"15\"\n - name: vip_renewdeadline\n value: \"10\"\n - name: vip_retryperiod\n value: \"2\"\n - name: address\n value: 1.1.1.1\n image: \n imagePullPolicy: IfNotPresent\n name: kube-vip\n resources: {}\n securityContext:\n capabilities:\n add:\n - NET_ADMIN\n - NET_RAW\n volumeMounts:\n - mountPath: /etc/kubernetes/admin.conf\n name: kubeconfig\n hostNetwork: true\n volumes:\n - hostPath:\n path: /etc/kubernetes/admin.conf\n name: kubeconfig\nstatus: {}\n",
Content: "apiVersion: v1\nkind: Pod\nmetadata:\n creationTimestamp: null\n name: kube-vip\n namespace: kube-system\nspec:\n containers:\n - args:\n - manager\n env:\n - name: vip_arp\n value: \"true\"\n - name: port\n value: \"6443\"\n - name: vip_cidr\n value: \"32\"\n - name: cp_enable\n value: \"true\"\n - name: cp_namespace\n value: kube-system\n - name: vip_ddns\n value: \"false\"\n - name: vip_leaderelection\n value: \"true\"\n - name: vip_leaseduration\n value: \"15\"\n - name: vip_renewdeadline\n value: \"10\"\n - name: vip_retryperiod\n value: \"2\"\n - name: address\n value: 1.1.1.1\n image: \n imagePullPolicy: IfNotPresent\n name: kube-vip\n resources: {}\n securityContext:\n capabilities:\n add:\n - NET_ADMIN\n - NET_RAW\n volumeMounts:\n - mountPath: /etc/kubernetes/admin.conf\n name: kubeconfig\n hostNetwork: true\n volumes:\n - hostPath:\n path: /var/lib/kubeadm/admin.conf\n name: kubeconfig\nstatus: {}\n",
ContentFrom: nil,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
4 changes: 4 additions & 0 deletions pkg/providers/vsphere/config/template-cp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,11 @@ spec:
hostNetwork: true
volumes:
- hostPath:
{{- if (eq .format "bottlerocket") }}
path: /var/lib/kubeadm/admin.conf
{{- else }}
path: /etc/kubernetes/admin.conf
{{- end }}
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ spec:
hostNetwork: true
volumes:
- hostPath:
path: /etc/kubernetes/admin.conf
path: /var/lib/kubeadm/admin.conf
name: kubeconfig
status: {}
owner: root:root
Expand Down

0 comments on commit 5b38312

Please sign in to comment.