Skip to content

Commit

Permalink
Only apply roles from first master node to fix regression
Browse files Browse the repository at this point in the history
  • Loading branch information
woopstar committed Mar 18, 2018
1 parent 50e5f0d commit f1d2f84
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion roles/kubernetes-apps/cluster_roles/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
src: "node-crb.yml.j2"
dest: "{{ kube_config_dir }}/node-crb.yml"
register: node_crb_manifest
when: rbac_enabled
when:
- rbac_enabled
- inventory_hostname == groups['kube-master'][0]

- name: Apply workaround to allow all nodes with cert O=system:nodes to register
kube:
Expand All @@ -28,6 +30,7 @@
when:
- rbac_enabled
- node_crb_manifest.changed
- inventory_hostname == groups['kube-master'][0]

- name: Kubernetes Apps | Add webhook ClusterRole that grants access to proxy, stats, log, spec, and metrics on a kubelet
template:
Expand All @@ -37,6 +40,7 @@
when:
- rbac_enabled
- kubelet_authorization_mode_webhook
- inventory_hostname == groups['kube-master'][0]
tags: node-webhook

- name: Apply webhook ClusterRole
Expand All @@ -50,6 +54,7 @@
- rbac_enabled
- kubelet_authorization_mode_webhook
- node_webhook_cr_manifest.changed
- inventory_hostname == groups['kube-master'][0]
tags: node-webhook

- name: Kubernetes Apps | Add ClusterRoleBinding for system:nodes to webhook ClusterRole
Expand All @@ -60,6 +65,7 @@
when:
- rbac_enabled
- kubelet_authorization_mode_webhook
- inventory_hostname == groups['kube-master'][0]
tags: node-webhook

- name: Grant system:nodes the webhook ClusterRole
Expand All @@ -73,6 +79,7 @@
- rbac_enabled
- kubelet_authorization_mode_webhook
- node_webhook_crb_manifest.changed
- inventory_hostname == groups['kube-master'][0]
tags: node-webhook

- name: Check if vsphere-cloud-provider ClusterRole exists
Expand All @@ -85,6 +92,7 @@
- cloud_provider == 'vsphere'
- kube_version | version_compare('v1.9.0', '>=')
- kube_version | version_compare('v1.9.3', '<=')
- inventory_hostname == groups['kube-master'][0]
tags: vsphere

- name: Write vsphere-cloud-provider ClusterRole manifest
Expand All @@ -99,6 +107,7 @@
- vsphere_cloud_provider.rc != 0
- kube_version | version_compare('v1.9.0', '>=')
- kube_version | version_compare('v1.9.3', '<=')
- inventory_hostname == groups['kube-master'][0]
tags: vsphere

- name: Apply vsphere-cloud-provider ClusterRole
Expand All @@ -115,6 +124,7 @@
- vsphere_cloud_provider.rc != 0
- kube_version | version_compare('v1.9.0', '>=')
- kube_version | version_compare('v1.9.3', '<=')
- inventory_hostname == groups['kube-master'][0]
tags: vsphere

# This is not a cluster role, but should be run after kubeconfig is set on master
Expand Down

0 comments on commit f1d2f84

Please sign in to comment.