Kubernetes/Openshift pods with PVC retain their cluster name and IP?

5/1/2019

If Kubernetes Pods bound to PVCs go down/restart, they are guaranteed to come back up with the same cluster name in order for the PVC binding to be valid. But Are they guaranteed to come back up with the same ClusterIp?

-- user2405589
kubernetes
openshift
persistent-volumes

1 Answer

5/1/2019

ClusterIP is not a property of Pod. It's a property of Service. Unless you delete and recreate the Service - its ClusterIP will stay the same no matter how many times Pods behind it will be restarted.

Regarding Pod IPs - they can definitely change unless they are a part of StatefulSet. Pods in StatefulSet preserve their IPs on restarts.

-- Vasily Angapov
Source: StackOverflow