-
Notifications
You must be signed in to change notification settings - Fork 4
/
kauthproxy-role.yaml
64 lines (60 loc) · 1.23 KB
/
kauthproxy-role.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
# role for kauthproxy
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: kubernetes-dashboard
name: kauthproxy
rules:
- apiGroups: [""]
resources: ["services"]
resourceNames: ["kubernetes-dashboard"]
verbs: ["get"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["list"]
- apiGroups: [""]
resources: ["pods/portforward"]
verbs: ["create"]
---
# service account for end-to-end test
apiVersion: v1
kind: ServiceAccount
metadata:
name: tester
---
apiVersion: v1
kind: Secret
type: kubernetes.io/service-account-token
metadata:
name: tester-token
annotations:
kubernetes.io/service-account.name: tester
---
# allow kauthproxy access
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
namespace: kubernetes-dashboard
name: tester
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kauthproxy
subjects:
- kind: ServiceAccount
namespace: default
name: tester
---
# allow cluster read-only access
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tester
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: view
subjects:
- kind: ServiceAccount
namespace: default
name: tester