You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: component/cluster.libsonnet
+42Lines changed: 42 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,46 @@ local cluster = function(name, options)
136
136
roleRef_: clusterRole,
137
137
};
138
138
139
+
local sccRole = if isOpenshift then
140
+
kube.Role('use-nonroot-v2') {
141
+
metadata+: {
142
+
namespace: options.namespace,
143
+
},
144
+
rules: [
145
+
{
146
+
apiGroups: [
147
+
'security.openshift.io',
148
+
],
149
+
resourceNames: [
150
+
'nonroot-v2',
151
+
],
152
+
resources: [
153
+
'securitycontextconstraints',
154
+
],
155
+
verbs: [
156
+
'use',
157
+
],
158
+
},
159
+
],
160
+
};
161
+
local sccRoleBinding = if isOpenshift then
162
+
kube.RoleBinding('default-use-nonroot-v2') {
163
+
metadata+: {
164
+
annotations+: {
165
+
'vcluster.syn.tools/description': 'Allow vcluster to sync pods with arbitrary nonroot users by allowing the default ServiceAccount to use the nonroot-v2 scc',
166
+
},
167
+
namespace: options.namespace,
168
+
},
169
+
roleRef_: sccRole,
170
+
subjects: [
171
+
{
172
+
kind:'ServiceAccount',
173
+
name:'default',
174
+
namespace: options.namespace,
175
+
},
176
+
],
177
+
};
178
+
139
179
local service = kube.Service(name) {
140
180
metadata+: {
141
181
namespace: options.namespace,
@@ -413,6 +453,8 @@ local cluster = function(name, options)
0 commit comments