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 0f275bb55..7fd3a946c 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,7 +21,6 @@ spec: k8s-app: ingress-nginx version: v{{ ingress_nginx_controller_image_tag }} spec: - serviceAccountName: ingress-nginx containers: - name: ingress-nginx-controller image: {{ ingress_nginx_controller_image_repo }}:{{ ingress_nginx_controller_image_tag }} @@ -68,3 +67,6 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 +{% if rbac_enabled %} + serviceAccountName: ingress-nginx +{% endif %} diff --git a/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ingress-nginx-ns.yml.j2 b/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ingress-nginx-ns.yml.j2 index 75958948a..1f1236619 100644 --- a/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ingress-nginx-ns.yml.j2 +++ b/roles/kubernetes-apps/ingress_controller/ingress_nginx/templates/ingress-nginx-ns.yml.j2 @@ -3,3 +3,5 @@ apiVersion: v1 kind: Namespace metadata: name: {{ ingress_nginx_namespace }} + labels: + name: {{ ingress_nginx_namespace }}