/
rbac-list-template.yaml
127 lines (127 loc) · 2.65 KB
/
rbac-list-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
apiVersion: rbac.authorization.k8s.io/v1
kind: ${VOYAGER_ROLE_TYPE}
metadata:
name: voyager-operator
namespace: ${VOYAGER_NAMESPACE}
labels:
app: voyager
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- "*"
- apiGroups:
- extensions
resources:
- thirdpartyresources
verbs:
- "*"
- apiGroups:
- voyager.appscode.com
resources: ["*"]
verbs: ["*"]
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups:
- apps
resources:
- deployments
verbs: ["*"]
- apiGroups:
- extensions
resources:
- deployments
- daemonsets
- ingresses
verbs: ["*"]
- apiGroups: [""]
resources:
- replicationcontrollers
- services
- endpoints
- configmaps
verbs: ["*"]
- apiGroups: [""]
resources:
- secrets
verbs: ["get", "list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources:
- namespaces
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources:
- events
verbs: ["create"]
- apiGroups: [""]
resources:
- pods
verbs: ["list", "watch", "delete", "deletecollection"]
- apiGroups: [""]
resources:
- nodes
verbs: ["list", "watch", "get"]
- apiGroups: [""]
resources:
- serviceaccounts
verbs: ["get", "create", "delete", "patch"]
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
- roles
verbs: ["get", "create", "delete", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ${VOYAGER_ROLE_TYPE}Binding
metadata:
name: voyager-operator
namespace: ${VOYAGER_NAMESPACE}
labels:
app: voyager
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ${VOYAGER_ROLE_TYPE}
name: voyager-operator
subjects:
- kind: ServiceAccount
name: ${VOYAGER_SERVICE_ACCOUNT}
namespace: ${VOYAGER_NAMESPACE}
---
# to read the config for terminating authentication
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: voyager-apiserver-extension-server-authentication-reader
namespace: kube-system
labels:
app: voyager
roleRef:
kind: Role
apiGroup: rbac.authorization.k8s.io
name: extension-apiserver-authentication-reader
subjects:
- kind: ServiceAccount
name: ${VOYAGER_SERVICE_ACCOUNT}
namespace: ${VOYAGER_NAMESPACE}
---
# to delegate authentication and authorization
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: voyager-apiserver-auth-delegator
labels:
app: voyager
roleRef:
kind: ClusterRole
apiGroup: rbac.authorization.k8s.io
name: system:auth-delegator
subjects:
- kind: ServiceAccount
name: ${VOYAGER_SERVICE_ACCOUNT}
namespace: ${VOYAGER_NAMESPACE}