RedisLabs / redis-enterprise-k8s-docs

151 stars 89 forks source link

Unable to define securityContext for Pods created by operator #246

Open sankalp28 opened 1 year ago

sankalp28 commented 1 year ago

I want to define the following securityContext for all containers created by the redis enterprise operator:

securityContext:
  capabilities:
    drop:
    - ALL
  runAsNonRoot: true
  runAsUser: 1001
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: true
  seccompProfile:
     type: RuntimeDefault

I think I can define them in the CRD for

redisEnterpriseAdditionalPodSpecAttributes:
  ephemeralContainers:
    securityContext:
redisEnterpriseAdditionalPodSpecAttributes:
  initContainers:
    securityContext:
servicesRiggerSpec:
  ephemeralContainers:
    securityContext:
servicesRiggerSpec:
  initContainers:
    securityContext:
sideContainersSpec:
  securityContext:

But where can I define the regular containers?

Also redisEnterpriseAdditionalPodSpecAttributes.ephemeralContainers is an array, so I guess I need to specify the names of the containers too like this?

redisEnterpriseAdditionalPodSpecAttributes:
  ephemeralContainers:
    - name: some-ephemeral-container
       securityContext:

However I have no idea where to find those names. Could you please give me any advice or tell me if its even possible?

sankalp28 commented 1 year ago

any updates on this ??