Wanted to know best combination with deployment and pvc

Hi Guyz…

if we have a deployment have PVC attached…strategy rolling update. The pods are deployed on azure. PVC is also on azure

wanted to know best combination

  1. rolling update with PVC policy retain
  2. recreate with PVC policy retain
  3. rolling update with PVC policy delete
  4. recreate with PVC policy delete

Depends whether you expect the data on the PVC to be available to the new pods. If it’s a stateful application - i.e. the data should remain consistent through restarts and upgrades, then a StatefulSet using volumeClaimTemplate instead of a PVC is a better option.

I want data to be available to the new pod after restart/upgrade of the pod. Also volumeClaimTemplate can only be used in statefulset kind but not to kind deployment or pod right ?

I believe it is indeed specific to statefulSets.