diff --git a/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-clusterrole.yml b/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-clusterrole.yml index b3324abf2..a194426c6 100644 --- a/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-clusterrole.yml +++ b/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-clusterrole.yml @@ -16,7 +16,7 @@ kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: name: cluster-proportional-autoscaler - namespace: kube-system + namespace: {{ system_namespace }} rules: - apiGroups: [""] resources: ["nodes"] diff --git a/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-clusterrolebinding.yml b/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-clusterrolebinding.yml index c4cdda9f1..1bdb2a715 100644 --- a/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-clusterrolebinding.yml +++ b/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-clusterrolebinding.yml @@ -16,11 +16,11 @@ kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: name: cluster-proportional-autoscaler - namespace: kube-system + namespace: {{ system_namespace }} subjects: - kind: ServiceAccount name: cluster-proportional-autoscaler - namespace: kube-system + namespace: {{ system_namespace }} roleRef: kind: ClusterRole name: cluster-proportional-autoscaler diff --git a/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-sa.yml b/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-sa.yml index 521f12ad9..9544a7dd9 100644 --- a/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-sa.yml +++ b/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler-sa.yml @@ -16,4 +16,4 @@ kind: ServiceAccount apiVersion: v1 metadata: name: cluster-proportional-autoscaler - namespace: kube-system + namespace: {{ system_namespace }} diff --git a/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler.yml b/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler.yml index 829df512e..28a67af4f 100644 --- a/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler.yml +++ b/roles/kubernetes-apps/ansible/templates/kubedns-autoscaler.yml @@ -16,7 +16,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: name: kubedns-autoscaler - namespace: kube-system + namespace: {{ system_namespace }} labels: k8s-app: kubedns-autoscaler kubernetes.io/cluster-service: "true" @@ -39,7 +39,7 @@ spec: memory: "10Mi" command: - /cluster-proportional-autoscaler - - --namespace=kube-system + - --namespace={{ system_namespace }} - --configmap=kubedns-autoscaler # Should keep target in sync with cluster/addons/dns/kubedns-controller.yaml.base - --target=Deployment/kubedns diff --git a/roles/kubernetes-apps/helm/tasks/main.yml b/roles/kubernetes-apps/helm/tasks/main.yml index 4443015ec..8c8123eb0 100644 --- a/roles/kubernetes-apps/helm/tasks/main.yml +++ b/roles/kubernetes-apps/helm/tasks/main.yml @@ -11,12 +11,12 @@ register: helm_container - name: Helm | Configure tiller service account for RBAC - command: kubectl create serviceaccount tiller --namespace=kube-system + command: kubectl create serviceaccount tiller --namespace={{ system_namespace }} ignore_errors: yes when: rbac_enabled - name: Helm | Configure tiller rolebindings for RBAC - command: kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount=kube-system:tiller + command: kubectl create clusterrolebinding tiller --clusterrole=cluster-admin --serviceaccount={{ system_namespace }}:tiller ignore_errors: yes when: rbac_enabled @@ -26,9 +26,9 @@ - name: Helm | Patch tiller deployment for RBAC shell: > - kubectl --namespace=kube-system get deployment tiller-deploy -o json | \ + kubectl --namespace={{ system_namespace }} get deployment tiller-deploy -o json | \ python -c 'import sys,json;a=json.load(sys.stdin);a["spec"]["template"]["spec"]["serviceAccount"]="tiller";json.dump(a,sys.stdout)' | \ - kubectl apply -f - + kubectl apply -n {{ system_namespace }} -f - when: rbac_enabled - name: Helm | Set up bash completion diff --git a/roles/kubernetes/master/templates/manifests/kube-scheduler.manifest.j2 b/roles/kubernetes/master/templates/manifests/kube-scheduler.manifest.j2 index 1508e60cf..fdc16bf7f 100644 --- a/roles/kubernetes/master/templates/manifests/kube-scheduler.manifest.j2 +++ b/roles/kubernetes/master/templates/manifests/kube-scheduler.manifest.j2 @@ -2,7 +2,7 @@ apiVersion: v1 kind: Pod metadata: name: kube-scheduler - namespace: kube-system + namespace: {{ system_namespace }} labels: k8s-app: kube-scheduler spec: