From 31e7d1e39224f5906887533b09e8b9d778a5ef0e Mon Sep 17 00:00:00 2001 From: Abhay Krishna Arunachalam Date: Fri, 26 Jan 2024 16:57:35 -0800 Subject: [PATCH] Set kubeconfig volume path for kube-vip static pod based on OS --- pkg/providers/tinkerbell/config/template-cp.yaml | 4 ++++ .../expected_results_bottlerocket_cert_bundles_config_cp.yaml | 2 +- .../expected_results_bottlerocket_kernel_config_cp.yaml | 2 +- .../testdata/expected_results_bottlerocket_ntp_config_cp.yaml | 2 +- .../expected_results_bottlerocket_settings_config_cp.yaml | 2 +- ...d_results_bottlerocket_upgrade_cert_bundles_config_cp.yaml | 2 +- ...er_tinkerbell_bottlerocket_cp_minimal_registry_mirror.yaml | 2 +- ..._tinkerbell_bottlerocket_cp_registry_mirror_with_auth.yaml | 2 +- ..._tinkerbell_bottlerocket_cp_registry_mirror_with_cert.yaml | 2 +- pkg/providers/vsphere/config/template-cp.yaml | 4 ++++ ...expected_results_bottlerocket_boot_settings_config_cp.yaml | 2 +- .../expected_results_bottlerocket_cert_bundles_config_cp.yaml | 2 +- .../expected_results_bottlerocket_external_etcd_cp.yaml | 2 +- .../expected_results_bottlerocket_kernel_config_cp.yaml | 2 +- .../expected_results_bottlerocket_mirror_config_cp.yaml | 2 +- ...ected_results_bottlerocket_mirror_config_with_auth_cp.yaml | 2 +- ...ected_results_bottlerocket_mirror_config_with_cert_cp.yaml | 2 +- .../testdata/expected_results_bottlerocket_ntp_config_cp.yaml | 2 +- .../expected_results_bottlerocket_settings_config_cp.yaml | 2 +- 19 files changed, 25 insertions(+), 17 deletions(-) diff --git a/pkg/providers/tinkerbell/config/template-cp.yaml b/pkg/providers/tinkerbell/config/template-cp.yaml index cacce41cccaa1..d1691a4faaae2 100644 --- a/pkg/providers/tinkerbell/config/template-cp.yaml +++ b/pkg/providers/tinkerbell/config/template-cp.yaml @@ -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 diff --git a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_cert_bundles_config_cp.yaml b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_cert_bundles_config_cp.yaml index 8828ab211bbda..509e69fb80824 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_cert_bundles_config_cp.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_cert_bundles_config_cp.yaml @@ -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 diff --git a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_kernel_config_cp.yaml b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_kernel_config_cp.yaml index 702115fe1eaf8..73f26dcf03971 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_kernel_config_cp.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_kernel_config_cp.yaml @@ -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 diff --git a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_ntp_config_cp.yaml b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_ntp_config_cp.yaml index 1e4b0c5bb3cff..686a543863893 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_ntp_config_cp.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_ntp_config_cp.yaml @@ -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 diff --git a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_settings_config_cp.yaml b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_settings_config_cp.yaml index 68272ac1e36c1..bd76ca91d1870 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_settings_config_cp.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_settings_config_cp.yaml @@ -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 diff --git a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_upgrade_cert_bundles_config_cp.yaml b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_upgrade_cert_bundles_config_cp.yaml index f520beb547065..3613b2f5fed2e 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_upgrade_cert_bundles_config_cp.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_bottlerocket_upgrade_cert_bundles_config_cp.yaml @@ -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 diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_minimal_registry_mirror.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_minimal_registry_mirror.yaml index 51f4d1445063e..31e9f3e1d8ec4 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_minimal_registry_mirror.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_minimal_registry_mirror.yaml @@ -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 diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_registry_mirror_with_auth.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_registry_mirror_with_auth.yaml index cfd20452e65fd..b1f8908297318 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_registry_mirror_with_auth.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_registry_mirror_with_auth.yaml @@ -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 diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_registry_mirror_with_cert.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_registry_mirror_with_cert.yaml index e08703db33b4f..2f43a51c30823 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_registry_mirror_with_cert.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_bottlerocket_cp_registry_mirror_with_cert.yaml @@ -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 diff --git a/pkg/providers/vsphere/config/template-cp.yaml b/pkg/providers/vsphere/config/template-cp.yaml index 223b906fa5135..b0df77caa0042 100644 --- a/pkg/providers/vsphere/config/template-cp.yaml +++ b/pkg/providers/vsphere/config/template-cp.yaml @@ -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 diff --git a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_boot_settings_config_cp.yaml b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_boot_settings_config_cp.yaml index d8f2e5dbb4ed1..0f953e00da4e9 100644 --- a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_boot_settings_config_cp.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_boot_settings_config_cp.yaml @@ -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 diff --git a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_cert_bundles_config_cp.yaml b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_cert_bundles_config_cp.yaml index 287bcb3718c7a..bf5d21c780839 100644 --- a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_cert_bundles_config_cp.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_cert_bundles_config_cp.yaml @@ -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 diff --git a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_external_etcd_cp.yaml b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_external_etcd_cp.yaml index b2239b54ad2e0..49cb5fb081121 100644 --- a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_external_etcd_cp.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_external_etcd_cp.yaml @@ -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 diff --git a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_kernel_config_cp.yaml b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_kernel_config_cp.yaml index a2d1cd7ad9cfa..d661923d68d9d 100644 --- a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_kernel_config_cp.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_kernel_config_cp.yaml @@ -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 diff --git a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_cp.yaml b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_cp.yaml index abf8327a42563..605e23f9a9d02 100644 --- a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_cp.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_cp.yaml @@ -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 diff --git a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_with_auth_cp.yaml b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_with_auth_cp.yaml index 56238034d0fa5..ab55a262c2a16 100644 --- a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_with_auth_cp.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_with_auth_cp.yaml @@ -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 diff --git a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_with_cert_cp.yaml b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_with_cert_cp.yaml index 183922b9de747..7e5e6bda6ec7f 100644 --- a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_with_cert_cp.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_mirror_config_with_cert_cp.yaml @@ -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 diff --git a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_ntp_config_cp.yaml b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_ntp_config_cp.yaml index 616bcbf92fa8c..9e63ac1e9bdc9 100755 --- a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_ntp_config_cp.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_ntp_config_cp.yaml @@ -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 diff --git a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_settings_config_cp.yaml b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_settings_config_cp.yaml index 7147d14586b0c..de36a85cca257 100644 --- a/pkg/providers/vsphere/testdata/expected_results_bottlerocket_settings_config_cp.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_bottlerocket_settings_config_cp.yaml @@ -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