good morning
Solved! Go to Solution.
Query 1: If I have two replicas for my App POD, one Replica set on NODE1 and another Replica Set on NODE2 .Does both Replica use the same PV and PVC to attach volume to both PODs ? or every replicaSet has its own PVC/PV ??
Ans : It depends on which kind of application and deployment type you are using. Basically if this is a DeploymentSet type application , then all the replicas will be using the same PVC as it is stateless and you need to use ReadwriteMany mode for PVC binding. On the otherside, if it is Stateful set application , then each replica will have unique PVC which can be setup using PVC templates.
Query 2 : If I want to mount external storage like NAS directly to container inside POD , can I do this and if yes what would happen if POD dies and recreated ? how I can automate NAS volume mount to Container in case POD rebooted or dies ?
Ans : Yes, you can attach or mount an external NAS as a PV/PVC inside a Pod as long as you create the provider's StorageClass in Kubernetes. Refer to StorageClassProvisioner for various Storage Class provisioners. On GKE, it is recommend that , you use one of the following provisioners:
Regarding the Reboot of Pod, Kubernetes will perform the necessary operation on that PV/PVC according to the Access-modes which are defined in the configuration yaml and the lifecycle-of-a-volume-and-claim
Query 1: If I have two replicas for my App POD, one Replica set on NODE1 and another Replica Set on NODE2 .Does both Replica use the same PV and PVC to attach volume to both PODs ? or every replicaSet has its own PVC/PV ??
Ans : It depends on which kind of application and deployment type you are using. Basically if this is a DeploymentSet type application , then all the replicas will be using the same PVC as it is stateless and you need to use ReadwriteMany mode for PVC binding. On the otherside, if it is Stateful set application , then each replica will have unique PVC which can be setup using PVC templates.
Query 2 : If I want to mount external storage like NAS directly to container inside POD , can I do this and if yes what would happen if POD dies and recreated ? how I can automate NAS volume mount to Container in case POD rebooted or dies ?
Ans : Yes, you can attach or mount an external NAS as a PV/PVC inside a Pod as long as you create the provider's StorageClass in Kubernetes. Refer to StorageClassProvisioner for various Storage Class provisioners. On GKE, it is recommend that , you use one of the following provisioners:
Regarding the Reboot of Pod, Kubernetes will perform the necessary operation on that PV/PVC according to the Access-modes which are defined in the configuration yaml and the lifecycle-of-a-volume-and-claim
Thanks for the detailed response . I am rephrasing Query 2
Query 2 : If I want to mount external storage like NAS directly to "container" inside POD , can I do this without using PVCs and if yes what would happen if POD dies and recreated ? how I can automate NAS volume mount to Container in case POD rebooted or dies ?
If I use PV to attach storage to all nodes inside K8s cluster and then PVCs to attach storage to POD then there no question of reattachment in case of POD or Node failure.
We have use case where extra storage needed is mounted directly to Containers without using PVC feature !
If I understand this correctly the volume attached/mount on Container Filesystem as below
Backend Storage(NFS/FC/iSCSI) --> SC --> PV(Storage Volume)--> PVC (request for storage volume ) --> attach to POD --> Mount the Volume on Container File System inside POD. Example /user/mynfs
Is it possible to use something like below
Backend Storage(NFS/FC/iSCSI) --> Container mount point
OR
Backend Storage(NFS/FC/iSCSI) --> SC --> PV(Storage Volume)--> mount on Container File System
Sorry asking some stupid query as I dont have access to K8s System to perform these options