Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenShift non root policy: missing emptyDir when no pvc is enabled #896

Open
antoinetran opened this issue Apr 26, 2024 · 1 comment
Open
Labels
defect Suspected defect such as a bug or regression

Comments

@antoinetran
Copy link

What version were you using?

nats helm chart 1.1.10

What environment was the server running in?

OpenShift , amd64

Is this defect reproducible?

Yes.
In a OpenShift cluster with non root policy.

  1. Deploy values:yaml as this
config:
  jetstream:
    enabled: true
    fileStore:
      enabled: true
      pvc:
        enabled: false
helm upgrade --install my-nats nats/nats --version 1.1.10 --namespace nats --values ./values.yaml

Given the capability you are leveraging, describe your expectation?

Helm chart deploys OK. nats pod deplomeny is OK.

Given the expectation, what is the defect you are observing?

nats pods deployment failed with logs:

kubectl -n nats logs my-nats-0
[40] 2024/04/26 18:15:07.716361 [INF] Starting JetStream
[40] 2024/04/26 18:15:07.716450 [FTL] Can't start JetStream: could not create storage directory - mkdir /data: permission denied
@antoinetran antoinetran added the defect Suspected defect such as a bug or regression label Apr 26, 2024
@antoinetran
Copy link
Author

This is because of missing emptyDir in case no pvc is deployed. As a workaround, this merge works (but because the merge cannot merge list, there is a duplication below):

container:
  merge:
    volumeMounts:
      # nats config
      - name: config
        mountPath: /etc/nats-config
      # PID volume
      - name: pid
        mountPath: /var/run/nats
      # Override
      - mountPath: /data
        name: js-data
podTemplate:
  # merge or patch the pod template
  # https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#pod-v1-core
  merge:
   spec:
      volumes:
        - configMap:
            name: my-nats-config
          name: config
        - emptyDir: {}
          name: pid
        # Override
        - emptyDir: {}
          name: js-data

@antoinetran antoinetran changed the title Missing emptyDir when no pvc is enabled OpenShift non root policy: missing emptyDir when no pvc is enabled Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

1 participant