From f30c22b487159f3c522760115c2834620bb81b76 Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Fri, 23 Aug 2024 15:20:34 -0700 Subject: [PATCH 1/2] Skip kube-vip-prepare for 1.31+ k8s since CAPI won't depend on super-admin.conf Signed-off-by: Lubron Zhan --- internal/kubevip/kube-vip-prepare.sh | 4 ++-- templates/cluster-template-ignition.yaml | 6 +++--- templates/cluster-template-node-ipam.yaml | 6 +++--- templates/cluster-template-supervisor.yaml | 6 +++--- templates/cluster-template.yaml | 6 +++--- templates/clusterclass-template-supervisor.yaml | 6 +++--- templates/clusterclass-template.yaml | 6 +++--- .../v1.10/clusterclass/clusterclass-quick-start.yaml | 4 ++-- .../v1.11/clusterclass/clusterclass-quick-start.yaml | 6 +++--- .../v1.9/clusterclass/clusterclass-quick-start.yaml | 6 +++--- .../clusterclass/clusterclass-quick-start-supervisor.yaml | 6 +++--- .../clusterclass/clusterclass-quick-start-supervisor.yaml | 6 +++--- .../clusterclass/clusterclass-quick-start-supervisor.yaml | 6 +++--- 13 files changed, 37 insertions(+), 37 deletions(-) diff --git a/internal/kubevip/kube-vip-prepare.sh b/internal/kubevip/kube-vip-prepare.sh index ec03fc9853..84e7300355 100644 --- a/internal/kubevip/kube-vip-prepare.sh +++ b/internal/kubevip/kube-vip-prepare.sh @@ -19,9 +19,9 @@ set -e # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 -# Nothing to do for kubernetes < v1.29 +# Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" -if [[ "$KUBEADM_MINOR" -lt "29" ]]; then +if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi diff --git a/templates/cluster-template-ignition.yaml b/templates/cluster-template-ignition.yaml index 033ef4d6be..b4875917a2 100644 --- a/templates/cluster-template-ignition.yaml +++ b/templates/cluster-template-ignition.yaml @@ -175,9 +175,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -1582,4 +1582,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' \ No newline at end of file + namespace: '${NAMESPACE}' diff --git a/templates/cluster-template-node-ipam.yaml b/templates/cluster-template-node-ipam.yaml index 8ed65b06a5..9e2899d875 100644 --- a/templates/cluster-template-node-ipam.yaml +++ b/templates/cluster-template-node-ipam.yaml @@ -212,9 +212,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -1497,4 +1497,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' \ No newline at end of file + namespace: '${NAMESPACE}' diff --git a/templates/cluster-template-supervisor.yaml b/templates/cluster-template-supervisor.yaml index a51d2b0b76..cc1e8aa851 100644 --- a/templates/cluster-template-supervisor.yaml +++ b/templates/cluster-template-supervisor.yaml @@ -169,9 +169,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -1447,4 +1447,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' \ No newline at end of file + namespace: '${NAMESPACE}' diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index 205fd40824..4dd1af9394 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -202,9 +202,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -1487,4 +1487,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' \ No newline at end of file + namespace: '${NAMESPACE}' diff --git a/templates/clusterclass-template-supervisor.yaml b/templates/clusterclass-template-supervisor.yaml index 10561ef024..9df16b41f5 100644 --- a/templates/clusterclass-template-supervisor.yaml +++ b/templates/clusterclass-template-supervisor.yaml @@ -150,9 +150,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -321,4 +321,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/templates/clusterclass-template.yaml b/templates/clusterclass-template.yaml index dad9f0c707..dad47207ae 100644 --- a/templates/clusterclass-template.yaml +++ b/templates/clusterclass-template.yaml @@ -164,9 +164,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -379,4 +379,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass/clusterclass-quick-start.yaml index 1451376109..ea517f304b 100644 --- a/test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-vsphere-govmomi/v1.10/clusterclass/clusterclass-quick-start.yaml @@ -165,9 +165,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi diff --git a/test/e2e/data/infrastructure-vsphere-govmomi/v1.11/clusterclass/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-vsphere-govmomi/v1.11/clusterclass/clusterclass-quick-start.yaml index dad9f0c707..dad47207ae 100644 --- a/test/e2e/data/infrastructure-vsphere-govmomi/v1.11/clusterclass/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-vsphere-govmomi/v1.11/clusterclass/clusterclass-quick-start.yaml @@ -164,9 +164,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -379,4 +379,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass/clusterclass-quick-start.yaml index 125c7ed255..6368fc5043 100644 --- a/test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-vsphere-govmomi/v1.9/clusterclass/clusterclass-quick-start.yaml @@ -165,10 +165,10 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then - return + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then + exit 0 fi IS_KUBEADM_INIT="false" diff --git a/test/e2e/data/infrastructure-vsphere-supervisor/v1.10/clusterclass/clusterclass-quick-start-supervisor.yaml b/test/e2e/data/infrastructure-vsphere-supervisor/v1.10/clusterclass/clusterclass-quick-start-supervisor.yaml index 10561ef024..9df16b41f5 100644 --- a/test/e2e/data/infrastructure-vsphere-supervisor/v1.10/clusterclass/clusterclass-quick-start-supervisor.yaml +++ b/test/e2e/data/infrastructure-vsphere-supervisor/v1.10/clusterclass/clusterclass-quick-start-supervisor.yaml @@ -150,9 +150,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -321,4 +321,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/test/e2e/data/infrastructure-vsphere-supervisor/v1.11/clusterclass/clusterclass-quick-start-supervisor.yaml b/test/e2e/data/infrastructure-vsphere-supervisor/v1.11/clusterclass/clusterclass-quick-start-supervisor.yaml index 10561ef024..9df16b41f5 100644 --- a/test/e2e/data/infrastructure-vsphere-supervisor/v1.11/clusterclass/clusterclass-quick-start-supervisor.yaml +++ b/test/e2e/data/infrastructure-vsphere-supervisor/v1.11/clusterclass/clusterclass-quick-start-supervisor.yaml @@ -150,9 +150,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -321,4 +321,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done diff --git a/test/e2e/data/infrastructure-vsphere-supervisor/v1.9/clusterclass/clusterclass-quick-start-supervisor.yaml b/test/e2e/data/infrastructure-vsphere-supervisor/v1.9/clusterclass/clusterclass-quick-start-supervisor.yaml index f58e3d6dea..8b2c4a5b11 100644 --- a/test/e2e/data/infrastructure-vsphere-supervisor/v1.9/clusterclass/clusterclass-quick-start-supervisor.yaml +++ b/test/e2e/data/infrastructure-vsphere-supervisor/v1.9/clusterclass/clusterclass-quick-start-supervisor.yaml @@ -150,9 +150,9 @@ spec: # Configure the workaround required for kubeadm init with kube-vip: # xref: https://github.com/kube-vip/kube-vip/issues/684 - # Nothing to do for kubernetes < v1.29 + # Nothing to do for kubernetes < v1.29 or >= v1.31. KUBEADM_MINOR="$(kubeadm version -o short | cut -d '.' -f 2)" - if [[ "$KUBEADM_MINOR" -lt "29" ]]; then + if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then exit 0 fi @@ -321,4 +321,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done \ No newline at end of file + do echo "Running script $script"; "$script"; done From 3b77f26672d47c8134a9d65c1ee28d10b2fb6408 Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Fri, 23 Aug 2024 21:24:41 -0700 Subject: [PATCH 2/2] Generate template with go run flavorgen Signed-off-by: Lubron Zhan --- templates/cluster-template-ignition.yaml | 2 +- templates/cluster-template-node-ipam.yaml | 2 +- templates/cluster-template-supervisor.yaml | 2 +- templates/cluster-template.yaml | 2 +- templates/clusterclass-template-supervisor.yaml | 2 +- templates/clusterclass-template.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/cluster-template-ignition.yaml b/templates/cluster-template-ignition.yaml index b4875917a2..8d5447b901 100644 --- a/templates/cluster-template-ignition.yaml +++ b/templates/cluster-template-ignition.yaml @@ -1582,4 +1582,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' + namespace: '${NAMESPACE}' \ No newline at end of file diff --git a/templates/cluster-template-node-ipam.yaml b/templates/cluster-template-node-ipam.yaml index 9e2899d875..be4b5ab053 100644 --- a/templates/cluster-template-node-ipam.yaml +++ b/templates/cluster-template-node-ipam.yaml @@ -1497,4 +1497,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' + namespace: '${NAMESPACE}' \ No newline at end of file diff --git a/templates/cluster-template-supervisor.yaml b/templates/cluster-template-supervisor.yaml index cc1e8aa851..d922ec8b6b 100644 --- a/templates/cluster-template-supervisor.yaml +++ b/templates/cluster-template-supervisor.yaml @@ -1447,4 +1447,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' + namespace: '${NAMESPACE}' \ No newline at end of file diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index 4dd1af9394..4839b6267d 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -1487,4 +1487,4 @@ data: kind: ConfigMap metadata: name: cpi-manifests - namespace: '${NAMESPACE}' + namespace: '${NAMESPACE}' \ No newline at end of file diff --git a/templates/clusterclass-template-supervisor.yaml b/templates/clusterclass-template-supervisor.yaml index 9df16b41f5..6c9789d15a 100644 --- a/templates/clusterclass-template-supervisor.yaml +++ b/templates/clusterclass-template-supervisor.yaml @@ -321,4 +321,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done + do echo "Running script $script"; "$script"; done \ No newline at end of file diff --git a/templates/clusterclass-template.yaml b/templates/clusterclass-template.yaml index dad47207ae..c0685009d6 100644 --- a/templates/clusterclass-template.yaml +++ b/templates/clusterclass-template.yaml @@ -379,4 +379,4 @@ spec: localhost.localdomain localhost4 localhost4.localdomain4" >>/etc/hosts - mkdir -p /etc/pre-kubeadm-commands - for script in $(find /etc/pre-kubeadm-commands/ -name '*.sh' -type f | sort); - do echo "Running script $script"; "$script"; done + do echo "Running script $script"; "$script"; done \ No newline at end of file