Add RBAC roles for calico

This commit is contained in:
Justin Santa Barbara 2017-04-10 16:29:58 -04:00
parent 2f5d3eb811
commit 3c9c082e6e
1 changed files with 57 additions and 0 deletions

View File

@ -72,6 +72,7 @@ spec:
role.kubernetes.io/networking: "1" role.kubernetes.io/networking: "1"
spec: spec:
hostNetwork: true hostNetwork: true
serviceAccountName: calico
tolerations: tolerations:
- key: node-role.kubernetes.io/master - key: node-role.kubernetes.io/master
effect: NoSchedule effect: NoSchedule
@ -189,6 +190,7 @@ spec:
# The policy controller must run in the host network namespace so that # The policy controller must run in the host network namespace so that
# it isn't governed by policy that would prevent it from working. # it isn't governed by policy that would prevent it from working.
hostNetwork: true hostNetwork: true
serviceAccountName: calico
tolerations: tolerations:
- key: node-role.kubernetes.io/master - key: node-role.kubernetes.io/master
effect: NoSchedule effect: NoSchedule
@ -237,6 +239,7 @@ spec:
scheduler.alpha.kubernetes.io/critical-pod: '' scheduler.alpha.kubernetes.io/critical-pod: ''
spec: spec:
hostNetwork: true hostNetwork: true
serviceAccountName: calico
tolerations: tolerations:
- key: node-role.kubernetes.io/master - key: node-role.kubernetes.io/master
effect: NoSchedule effect: NoSchedule
@ -268,3 +271,57 @@ spec:
items: items:
- key: ippool.yaml - key: ippool.yaml
path: calico/ippool.yaml path: calico/ippool.yaml
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: calico
labels:
role.kubernetes.io/networking: "1"
rules:
- apiGroups:
- ""
resources:
- pods
- namespaces
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- networkpolicies
verbs:
- get
- list
- watch
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: calico
namespace: kube-system
labels:
role.kubernetes.io/networking: "1"
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: calico
labels:
role.kubernetes.io/networking: "1"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: calico
subjects:
- kind: ServiceAccount
name: calico
namespace: kube-system