dragonfly-operator icon indicating copy to clipboard operation
dragonfly-operator copied to clipboard

Set podSecurityContext for the dragonfly custom resource

Open sisrael-dn opened this issue 1 year ago • 4 comments
trafficstars

Hello,

Right now the dragonfly crd doesn't seem to support setting any podSecurityContext (correct me if I'm wrong) which will be passed for the pods running dragonfly. Would it it possible to add this please?

So We can create for example something like:

apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
  labels:
    app.kubernetes.io/name: dragonfly-sample
    app.kubernetes.io/instance: dragonfly
    app.kubernetes.io/part-of: dragonfly-operator
    app.kubernetes.io/managed-by: helm
    app.kubernetes.io/created-by: dragonfly-operator
  name: dragonfly-sample
spec:
  podSecurityContext:
    capabilities:
      add: ["IPC_LOCK"]

sisrael-dn avatar Aug 13 '24 14:08 sisrael-dn

Hey @sisrael-dn, You are right that we don't support setting podSecurityContext through Dragonfly resource for Dragonfly pods.

This isn't a high priority right now, Can you raise a PR to add this configuration into https://github.com/dragonflydb/dragonfly-operator/blob/main/api/v1alpha1/dragonfly_types.go#L28

Pothulapati avatar Aug 14 '24 07:08 Pothulapati

Hi @Pothulapati , I understand, thank you for pointing me to the right place to add it. I'll try to raise a PR as suggested when I'll have some free time (:

sisrael-dn avatar Aug 14 '24 07:08 sisrael-dn

This will be needed to fix Weird error 1 switching to epoll

https://github.com/dragonflydb/dragonfly/issues/4042

Or maybe not? image

jonathon2nd avatar Nov 27 '24 19:11 jonathon2nd

I believe this can be closed since https://github.com/dragonflydb/dragonfly-operator/pull/255 has been merged. Though these fields are not yet documented at https://www.dragonflydb.io/docs/managing-dragonfly/operator/dragonfly-configuration it is possible to configure podSecurityContext and containerSecurityContext in the latest version of the operator.

dbackeus avatar Oct 08 '25 08:10 dbackeus