创建一个clusterrole,并授权给所有的认证用户
template-view.json
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
{
"kind": "ClusterRole",
"apiVersion": "v1",
"metadata": {
"name": "template-view",
"creationTimestamp": null,
"annotations": {
"openshift.io/description": "A user who can view but not edit any resources within the project. They can not view secrets or membership.",
}
},
"rules": [
{
"verbs": [
"get"
],
"attributeRestrictions": null,
"apiGroups": [
""
],
"resources": [
"namespaces",
"namespaces/status"
]
},
{
"verbs": [
"get",
"list",
"watch"
],
"attributeRestrictions": null,
"apiGroups": [
"",
],
"resources": [
"templates"
]
},
{
"verbs": [
"get",
"list",
"watch"
],
"attributeRestrictions": null,
"apiGroups": [
"",
],
"resources": [
"imagestreamimages",
"imagestreams",
"imagestreamtags"
]
},
{
"verbs": [
"get"
],
"attributeRestrictions": null,
"apiGroups": [
"",
],
"resources": [
"imagestreams/layers"
]
}
]
}


oc create -f template-view.json
oc policy add-role-to-group template-view system:authenticated -n openshift