From 699568d6245b0f41b36b1ceaacc2456e69192602 Mon Sep 17 00:00:00 2001 From: paulfantom Date: Tue, 31 Oct 2023 16:18:08 +0100 Subject: [PATCH 1/2] templates: use default imagePullPolicy for kube-vip container image In case of air-gapped environments there may be a case where kube-vip images are shipped to hosts using rke2_airgap_copy_additional_tarballs and in that case imagePullPolicy set to Always will prevent successfull cluster bootstrap. --- templates/kube-vip/kube-vip.yml.j2 | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/kube-vip/kube-vip.yml.j2 b/templates/kube-vip/kube-vip.yml.j2 index 65ee225..d6b70a4 100644 --- a/templates/kube-vip/kube-vip.yml.j2 +++ b/templates/kube-vip/kube-vip.yml.j2 @@ -65,7 +65,6 @@ spec: - name: prometheus_server value: :2112 image: ghcr.io/kube-vip/kube-vip:v0.5.5 - imagePullPolicy: Always name: kube-vip resources: {} securityContext: From ac261be10095754268ffec0057d247a207531a5b Mon Sep 17 00:00:00 2001 From: paulfantom Date: Tue, 31 Oct 2023 16:21:40 +0100 Subject: [PATCH 2/2] allow specifying kube-vip image This allows to specify custom kube-vip image as well as allows for easy kube-vip upgrades --- README.md | 3 +++ defaults/main.yml | 3 +++ templates/kube-vip/kube-vip.yml.j2 | 9 +-------- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2cd6063..259b3f1 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,9 @@ rke2_kubevip_cloud_provider_enable: true # Enable kube-vip to watch Services of type LoadBalancer rke2_kubevip_svc_enable: true +# Specify which image is used for kube-vip container +rke2_kubevip_image: ghcr.io/kube-vip/kube-vip:v0.5.5 + # Add additional SANs in k8s API TLS cert rke2_additional_sans: [] diff --git a/defaults/main.yml b/defaults/main.yml index e030790..b7b5783 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -38,6 +38,9 @@ rke2_kubevip_cloud_provider_enable: true # Enable kube-vip to watch Services of type LoadBalancer rke2_kubevip_svc_enable: true +# Specify which image is used for kube-vip container +rke2_kubevip_image: ghcr.io/kube-vip/kube-vip:v0.5.5 + # Add additional SANs in k8s API TLS cert rke2_additional_sans: [] diff --git a/templates/kube-vip/kube-vip.yml.j2 b/templates/kube-vip/kube-vip.yml.j2 index d6b70a4..276feeb 100644 --- a/templates/kube-vip/kube-vip.yml.j2 +++ b/templates/kube-vip/kube-vip.yml.j2 @@ -4,7 +4,6 @@ metadata: creationTimestamp: null labels: app.kubernetes.io/name: kube-vip-ds - app.kubernetes.io/version: v0.5.5 name: kube-vip-ds namespace: kube-system spec: @@ -16,7 +15,6 @@ spec: creationTimestamp: null labels: app.kubernetes.io/name: kube-vip-ds - app.kubernetes.io/version: v0.5.5 spec: affinity: nodeAffinity: @@ -64,7 +62,7 @@ spec: value: "{{ rke2_api_ip }}" - name: prometheus_server value: :2112 - image: ghcr.io/kube-vip/kube-vip:v0.5.5 + image: "{{ rke2_kubevip_image }}" name: kube-vip resources: {} securityContext: @@ -80,8 +78,3 @@ spec: - effect: NoExecute operator: Exists updateStrategy: {} -status: - currentNumberScheduled: 0 - desiredNumberScheduled: 0 - numberMisscheduled: 0 - numberReady: 0