Home > Net >  Persistent volume claim attach to kubernetes deployment to access files present in PVC but should no
Persistent volume claim attach to kubernetes deployment to access files present in PVC but should no

Time:01-21

I have a requirement to store files in a PVC and attach that PVC to a Nginx ingress controller deployment so that application can access the files which are present in PVC but at the same application should not write back logs and configurations to PVC.

Can you please let me know how can i achieve it?

I Created a PVC and attached it a deployment but it is writing logs and configurations to it.

CodePudding user response:

You can use the GCP fuse and store files to S3 directly that way it would be a little easy to manage if it's works for you.

However, if you want to go with your Idea you have to implement the ReadWriteMany (Read More). So two POD can attach to one PVC and one write and the other one read.

You can also use the EFS, or NFS file systems GKE with Filestore from GCP or MinIO, GlusterFS.

Ref answer glusterfs

I Created a PVC and attached it a deployment but it is writing logs and configurations to it.

volumeMounts:
          - name: file
            mountPath: /var/data
            readOnly: true

You can set the mode when mounting the file or directory and set it as read-only mode also readOnly: true.

  • Related