run calico-policy-controller with proper sa/role/rolebinding

This commit is contained in:
jwfang
2017-07-04 20:03:55 +08:00
parent fd01377f12
commit c9734b6d7b
5 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: calico-policy-controller
namespace: {{ system_namespace }}
rules:
- apiGroups:
- ""
- extensions
resources:
- pods
- namespaces
- networkpolicies
verbs:
- watch
- list

View File

@@ -0,0 +1,12 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: calico-policy-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: calico-policy-controller
subjects:
- kind: ServiceAccount
name: calico-policy-controller
namespace: {{ system_namespace }}

View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: calico-policy-controller
namespace: {{ system_namespace }}
labels:
kubernetes.io/cluster-service: "true"

View File

@@ -60,3 +60,6 @@ spec:
- hostPath:
path: {{ calico_cert_dir }}
name: etcd-certs
{% if rbac_enabled %}
serviceAccountName: calico-policy-controller
{% endif %}