From 050fde6327f4a568ea100c170dda048a95a701d5 Mon Sep 17 00:00:00 2001 From: mKlaris <32633812+mKlaris@users.noreply.github.com> Date: Tue, 3 Jan 2023 03:35:33 +0100 Subject: [PATCH] Add enableServicesElection env variable. (#9595) --- docs/kube-vip.md | 6 ++++++ roles/kubernetes/node/defaults/main.yml | 1 + .../node/templates/manifests/kube-vip.manifest.j2 | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/docs/kube-vip.md b/docs/kube-vip.md index 9ba402d12..44f96ceec 100644 --- a/docs/kube-vip.md +++ b/docs/kube-vip.md @@ -39,6 +39,12 @@ kube_vip_services_enabled: false [additional manual steps](https://kube-vip.io/docs/usage/cloud-provider/) are needed. +If using [local traffic policy](https://kube-vip.io/docs/usage/kubernetes-services/#external-traffic-policy-kube-vip-v050): + +```yaml +kube_vip_enableServicesElection: true +``` + If using [ARP mode](https://kube-vip.io/docs/installation/static/#arp) : ```yaml diff --git a/roles/kubernetes/node/defaults/main.yml b/roles/kubernetes/node/defaults/main.yml index 0c6b57b8b..2eaf581bc 100644 --- a/roles/kubernetes/node/defaults/main.yml +++ b/roles/kubernetes/node/defaults/main.yml @@ -86,6 +86,7 @@ kube_vip_bgp_peerpass: kube_vip_bgp_peeras: 65000 kube_vip_bgppeers: kube_vip_address: +kube_vip_enableServicesElection: false # Requests for load balancer app loadbalancer_apiserver_memory_requests: 32M diff --git a/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 b/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 index 02887cfa9..a84946473 100644 --- a/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 +++ b/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 @@ -68,6 +68,10 @@ spec: {% endif %} - name: address value: {{ kube_vip_address | to_json }} +{% if kube_vip_enableServicesElection %} + - name: enableServicesElection + value: "true" +{% endif %} image: {{ kube_vip_image_repo }}:{{ kube_vip_image_tag }} imagePullPolicy: {{ k8s_image_pull_policy }} name: kube-vip