ComplianceAsCode / compliance-operator

Operator providing Kubernetes cluster compliance checks
Apache License 2.0
36 stars 22 forks source link

Allow to change Security Context from values.yaml for installation via Helm Chart #507

Open SitoRBJ opened 4 months ago

SitoRBJ commented 4 months ago

Share the context

Compliance-operator installation in EKS via Helm Chart

Description of problem:

When installing the compliance-operator using the Helm Chart we have encountered the following problem:

Warning  Failed           98s (x8 over 2m57s)  kubelet            Error: container has runAsNonRoot and image will run as root (pod: "eks-openshift-compliance-pp-7f5965bd7-p244q_openshift-compliance(0153dbbc-d4a8-4ab2-8fe1-e52477baf9e1)", container: content-container)

Proposed change:

Allow to change the Security Context from values.yaml to be able to install without problem the chart. Additionally being able to add the runAsUser flag would also be interesting.

References:

  1. https://github.com/ComplianceAsCode/compliance-operator/blob/master/config/helm/templates/deployment.yaml#L29-L33
  2. https://github.com/ComplianceAsCode/compliance-operator/issues/245
  3. https://stackoverflow.com/questions/49720308/kubernetes-podsecuritypolicy-set-to-runasnonroot-container-has-runasnonroot-and