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

Add PVC initialization job to resolve permission issues #17

Open
chris2k20 opened this issue Jul 23, 2024 · 0 comments
Open

Add PVC initialization job to resolve permission issues #17

chris2k20 opened this issue Jul 23, 2024 · 0 comments

Comments

@chris2k20
Copy link

Description:

Currently, the registry deployment encounters "permission denied" errors when accessing the Persistent Volume Claim (PVC). To resolve this, we need to add a initialization job to the Helm chart that sets the correct permissions on the PVC before the main registry container starts.

Proposed solution:
Add a Kubernetes Job to the Helm chart that runs before the main deployment and sets the correct permissions on the PVC or init container.

Example Job (to be adapted for Helm):

apiVersion: batch/v1
kind: Job
metadata:
  name: registry-pvc-init
spec:
  template:
    spec:
      restartPolicy: OnFailure
      initContainers:
      - name: init-pvc
        image: busybox
        command:
        - /bin/sh
        - -c
        - |
          mkdir -p /mnt/registry/docker
          chown 101:101 /mnt/registry/docker
        volumeMounts:
        - name: registry-storage
          mountPath: /mnt/registry
      containers:
      - name: dummy
        image: busybox
        command: ["sh", "-c", "echo 'Job completed' && sleep 5"]
      volumes:
      - name: registry-storage
        persistentVolumeClaim:
          claimName: registry-docker-registry-ui

Thx for your work!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant