From b710c72f04beedf2ed23c9460e2b3f13a57ae935 Mon Sep 17 00:00:00 2001 From: Maxim Snezhkov Date: Wed, 7 Aug 2019 09:24:50 +0700 Subject: [PATCH] Add ability to setup virtual ip for ingress-controller (#5044) --- inventory/sample/group_vars/k8s-cluster/addons.yml | 1 + .../ingress_controller/ingress_nginx/defaults/main.yml | 1 + .../ingress_nginx/templates/ds-ingress-nginx-controller.yml.j2 | 3 +++ 3 files changed, 5 insertions(+) diff --git a/inventory/sample/group_vars/k8s-cluster/addons.yml b/inventory/sample/group_vars/k8s-cluster/addons.yml index 663a9dc9c..ef9eff9e7 100644 --- a/inventory/sample/group_vars/k8s-cluster/addons.yml +++ b/inventory/sample/group_vars/k8s-cluster/addons.yml @@ -80,6 +80,7 @@ rbd_provisioner_enabled: false # Nginx ingress controller deployment ingress_nginx_enabled: false # ingress_nginx_host_network: false +ingress_publish_status_address: "" # ingress_nginx_nodeselector: # beta.kubernetes.io/os: "linux" # ingress_nginx_tolerations: diff --git a/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml b/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml index 05b72ea90..57bd4830c 100644 --- a/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml +++ b/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml @@ -1,6 +1,7 @@ --- ingress_nginx_namespace: "ingress-nginx" ingress_nginx_host_network: false +ingress_publish_status_address: "" ingress_nginx_nodeselector: beta.kubernetes.io/os: "linux" ingress_nginx_tolerations: [] diff --git a/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ds-ingress-nginx-controller.yml.j2 b/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ds-ingress-nginx-controller.yml.j2 index 8c48089d5..6f94680a6 100644 --- a/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ds-ingress-nginx-controller.yml.j2 +++ b/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ds-ingress-nginx-controller.yml.j2 @@ -47,6 +47,9 @@ spec: - --annotations-prefix=nginx.ingress.kubernetes.io {% if ingress_nginx_host_network %} - --report-node-internal-ip-address +{% endif %} +{% if ingress_publish_status_address != "" %} + - --publish-status-address={{ ingress_publish_status_address }} {% endif %} securityContext: capabilities: