Skip to content

Commit

Permalink
Update kube version, add kubevip version, handle kubevip for k8s > 1.29:
Browse files Browse the repository at this point in the history
Move the default k8s version to 1.29. Upgrade to
kubevip 0.8.0. Handle the super-admin.conf in
kubevip for k8s versions >= 1.29.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Jun 11, 2024
1 parent 91cdfed commit 777864f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 2 additions & 1 deletion capt/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ counts:
versions:
capt: 0.5.3
chart: 0.4.4
kube: v1.28.3
kube: v1.29.4
os: 20.04
kubevip: 0.8.0
os:
registry: ghcr.io/jacobweinstock/capi-images
distro: ubuntu
Expand Down
8 changes: 8 additions & 0 deletions capt/tasks/Taskfile-capi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,15 @@ tasks:
sh: yq eval '.tinkerbell.vip' {{.STATE_FILE_FQ_PATH}}
CLUSTER_NAME:
sh: yq eval '.clusterName' {{.STATE_FILE_FQ_PATH}}
KUBEVIP_VERSION:
sh: yq eval '.versions.kubevip' {{.STATE_FILE_FQ_PATH}}
CONTROL_PLANE_VIP:
sh: yq eval '.cluster.controlPlane.vip' {{.STATE_FILE_FQ_PATH}}
CONF_PATH: # https://github.com/kube-vip/kube-vip/issues/684
sh: "[[ $(echo {{.KUBE_VERSION}} | awk -F. '{print $2}') -gt 28 ]] && echo /etc/kubernetes/super-admin.conf || echo /etc/kubernetes/admin.conf"
vars:
KUBE_VERSION:
sh: yq eval '.versions.kube' {{.STATE_FILE_FQ_PATH}}
OUTPUT_DIR:
sh: yq eval '.outputDir' config.yaml
sources:
Expand Down
11 changes: 10 additions & 1 deletion capt/templates/kustomization.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,13 @@ patches:
sudo: ALL=(ALL) NOPASSWD:ALL
sshAuthorizedKeys:
- $SSH_AUTH_KEY

- target:
group: controlplane.cluster.x-k8s.io
kind: KubeadmControlPlane
name: "$CLUSTER_NAME-.*"
version: v1beta1
patch: |-
- op: add
path: /spec/kubeadmConfigSpec/preKubeadmCommands
value:
- mkdir -p /etc/kubernetes/manifests && ctr images pull ghcr.io/kube-vip/kube-vip:v$KUBEVIP_VERSION && ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:v$KUBEVIP_VERSION vip /kube-vip manifest pod --arp --interface $(ip -4 -j route list default | jq -r .[0].dev) --address $CONTROL_PLANE_VIP --controlplane --leaderElection --k8sConfigPath $CONF_PATH > /etc/kubernetes/manifests/kube-vip.yaml

0 comments on commit 777864f

Please sign in to comment.