From 6ff845a19940e5809a519444505e2cf024e76b3e Mon Sep 17 00:00:00 2001 From: ERIK Date: Mon, 13 Feb 2023 11:25:28 +0800 Subject: [PATCH] Enable control plane load balancing for kube-vip (#9785) Signed-off-by: bo.jiang --- 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 44f96ceec..846ec099a 100644 --- a/docs/kube-vip.md +++ b/docs/kube-vip.md @@ -64,3 +64,9 @@ kube_vip_bgppeers: # kube_vip_bgp_peerpass: # kube_vip_bgp_peeras: ``` + +If using [control plane load-balancing](https://kube-vip.io/docs/about/architecture/#control-plane-load-balancing): + +```yaml +kube_vip_lb_enable: true +``` diff --git a/roles/kubernetes/node/defaults/main.yml b/roles/kubernetes/node/defaults/main.yml index bb6ac5618..a82777349 100644 --- a/roles/kubernetes/node/defaults/main.yml +++ b/roles/kubernetes/node/defaults/main.yml @@ -87,6 +87,7 @@ kube_vip_bgp_peeras: 65000 kube_vip_bgppeers: kube_vip_address: kube_vip_enableServicesElection: false +kube_vip_lb_enable: 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 1ed5f492a..b2066d970 100644 --- a/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 +++ b/roles/kubernetes/node/templates/manifests/kube-vip.manifest.j2 @@ -71,6 +71,10 @@ spec: {% if kube_vip_enableServicesElection %} - name: enableServicesElection value: "true" +{% endif %} +{% if kube_vip_lb_enable %} + - name: lb_enable + value: "true" {% endif %} image: {{ kube_vip_image_repo }}:{{ kube_vip_image_tag }} imagePullPolicy: {{ k8s_image_pull_policy }}