Skip to content

Commit

Permalink
Skip kube-vip-prepare for 1.31+ k8s since CAPI won't depend on super-…
Browse files Browse the repository at this point in the history
…admin.conf

Signed-off-by: Lubron Zhan <[email protected]>
  • Loading branch information
lubronzhan committed Aug 23, 2024
1 parent 75a5e72 commit e1ef4d7
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 37 deletions.
4 changes: 2 additions & 2 deletions internal/kubevip/kube-vip-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions templates/cluster-template-ignition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1582,4 +1582,4 @@ data:
kind: ConfigMap
metadata:
name: cpi-manifests
namespace: '${NAMESPACE}'
namespace: '${NAMESPACE}'
6 changes: 3 additions & 3 deletions templates/cluster-template-node-ipam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1497,4 +1497,4 @@ data:
kind: ConfigMap
metadata:
name: cpi-manifests
namespace: '${NAMESPACE}'
namespace: '${NAMESPACE}'
6 changes: 3 additions & 3 deletions templates/cluster-template-supervisor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1447,4 +1447,4 @@ data:
kind: ConfigMap
metadata:
name: cpi-manifests
namespace: '${NAMESPACE}'
namespace: '${NAMESPACE}'
6 changes: 3 additions & 3 deletions templates/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1487,4 +1487,4 @@ data:
kind: ConfigMap
metadata:
name: cpi-manifests
namespace: '${NAMESPACE}'
namespace: '${NAMESPACE}'
6 changes: 3 additions & 3 deletions templates/clusterclass-template-supervisor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions templates/clusterclass-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +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
if [[ "$KUBEADM_MINOR" -lt "29" ]] || [[ "$KUBEADM_MINOR" -gt "30" ]]; then
exit 0
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit e1ef4d7

Please sign in to comment.