diff --git a/inventory/sample/group_vars/k8s-cluster.yml b/inventory/sample/group_vars/k8s-cluster.yml index 19ffc8cca52807e2dfc0709f252ea3cf40bae582..1038fe376181283b0536cf9321abf99800744110 100644 --- a/inventory/sample/group_vars/k8s-cluster.yml +++ b/inventory/sample/group_vars/k8s-cluster.yml @@ -189,7 +189,7 @@ cephfs_provisioner_enabled: false # Nginx ingress controller deployment ingress_nginx_enabled: false -# ingres_nginx_host_network: true +# ingress_nginx_host_network: false # ingress_nginx_namespace: "ingress-nginx" # ingress_nginx_insecure_port: 80 # ingress_nginx_secure_port: 443 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 dce234f6c8c4336fe4c7194920c6c5d0a03fba37..fc114a2ba42319a809fdf1c235c6376d9a0097fe 100644 --- a/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml +++ b/roles/kubernetes-apps/ingress_controller/ingress_nginx/defaults/main.yml @@ -6,6 +6,7 @@ ingress_nginx_controller_image_repo: quay.io/kubernetes-ingress-controller/nginx ingress_nginx_controller_image_tag: 0.11.0 ingress_nginx_namespace: "ingress-nginx" +ingress_nginx_host_network: false ingress_nginx_insecure_port: 80 ingress_nginx_secure_port: 443 ingress_nginx_configmap: {} diff --git a/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ingress-nginx-controller-ds.yml.j2 b/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ingress-nginx-controller-ds.yml.j2 index 289119a60e65621750512752e4d1b5a24109dc92..b88bb9d6fa8cf5e242ebd3b92a833d0e577451bb 100644 --- a/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ingress-nginx-controller-ds.yml.j2 +++ b/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ingress-nginx-controller-ds.yml.j2 @@ -21,10 +21,10 @@ spec: k8s-app: ingress-nginx version: v{{ ingress_nginx_controller_image_tag }} spec: -{% if ingres_nginx_host_network is defined and ingres_nginx_host_network %} +{% if ingress_nginx_host_network %} hostNetwork: true {% endif %} -{% if 'kube-ingress' in groups %} +{% if 'kube-ingress' in groups and groups['kube-ingress']|length > 0 %} nodeSelector: node-role.kubernetes.io/ingress: "true" {% endif %}