Globally assign per-pod UUID/unique-ID for all pods Globally assign per-pod UUID/unique-ID for all pods kubernetes kubernetes

Globally assign per-pod UUID/unique-ID for all pods


You can access pod's uid by kubectl get pods/$POD_NAME -o yaml, it is under metadata.uid.

It is also exposed to pod by env var, but make sure your kubernetes contain this commit.


you should be using Statefulsets for running stateful containers such as databases and not deployment.you will have control over the pod names like db-0, db-1, db-2