Open hchenxa opened 4 years ago
The securityContext is also missing a runAsNonRoot: true
which is a security risk
securityContext:
runAsUser: 999
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
for bootstrap, mongodb, and metrics containers
Also fixing the missed memory limits here...two were still set to 8GB but should be 5GB
create Pod icp-mongodb-0 in StatefulSet icp-mongodb failed error: pods "icp-mongodb-0" is forbidden: unable to validate against any security context constraint: [spec.initContainers[1].securityContext.securityContext.runAsUser: Invalid value: 999: must be in the ranges: [1000570000, 1000579999] spec.containers[0].securityContext.securityContext.runAsUser: Invalid value: 999: must be in the ranges: [1000570000, 1000579999] spec.containers[1].securityContext.securityContext.runAsUser: Invalid value: 999: must be in the ranges: [1000570000, 1000579999]]
ran into this issue during testing...for Openshift we'll use 1000571999
I cannot do what I used to do because I now run in openshift.io/scc: restricted
@hchenxa see my comment in #65
We found that the mongodb can not started on some of environment due to permission issue like below:
Install CS3.3 on OCP4.2
After investigated, stuck in this script
/init/on-start.sh
, hit the permission problemAfter modified statefulset
icp-mongodb
to addrunAsUser: 999
, the pod can be startup.@kgcarr I check the code and find that we comment the chown/chmod in install configmap and remove the securitycontext in statefulset compare with the helm chart we used before.