@@ -158,6 +158,11 @@ func (r *MemcachedReconciler) deploymentForMemcached(m *cachev1alpha1.Memcached)
158
158
// Ensure restrictive standard for the Pod.
159
159
// More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
160
160
SecurityContext : & corev1.PodSecurityContext {
161
+ // WARNING: Ensure that the image used defines an UserID in the Dockerfile
162
+ // otherwise the Pod will not run and will fail with "container has runAsNonRoot and image has non-numeric user"".
163
+ // If you want your workloads admitted in namespaces enforced with the restricted mode in OpenShift/OKD vendors
164
+ // then, you MUST ensure that the Dockerfile defines a User ID OR you MUST leave the "RunAsNonRoot" and
165
+ // "RunAsUser" fields empty.
161
166
RunAsNonRoot : & []bool {true }[0 ],
162
167
// Please ensure that you can use SeccompProfile and do NOT use
163
168
// this field if your project must work on old Kubernetes
@@ -173,6 +178,11 @@ func (r *MemcachedReconciler) deploymentForMemcached(m *cachev1alpha1.Memcached)
173
178
// Ensure restrictive context for the container
174
179
// More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted
175
180
SecurityContext : & corev1.SecurityContext {
181
+ // WARNING: Ensure that the image used defines an UserID in the Dockerfile
182
+ // otherwise the Pod will not run and will fail with "container has runAsNonRoot and image has non-numeric user"".
183
+ // If you want your workloads admitted in namespaces enforced with the restricted mode in OpenShift/OKD vendors
184
+ // then, you MUST ensure that the Dockerfile defines a User ID OR you MUST leave the "RunAsNonRoot" and
185
+ // "RunAsUser" fields empty.
176
186
RunAsNonRoot : & []bool {true }[0 ],
177
187
AllowPrivilegeEscalation : & []bool {false }[0 ],
178
188
Capabilities : & corev1.Capabilities {
0 commit comments