简体   繁体   中英

Is Pod UID unique across multiple k8s clusters?

As mentioned here ,

A Kubernetes systems-generated string to uniquely identify objects. Every object created over the whole lifetime of a Kubernetes cluster has a distinct UID. It is intended to distinguish between historical occurrences of similar entities.


We have multiple k8s clusters in GCP

Each k8s cluster has multiple namespace.

Each namespace has multiple pods


Using kubernetes API, We monitor Pod health( Podname, ready, status, restarts, age, Podnamespace ) from each namespace of each K8s clusters and store data in MongoDB document.

Goal is to make unique entry of each Pod in a MongoDB document


Is Pod UID a unique id across multiple K8s cluster? if no, what is the best primary key to store Pod entry in a MongoDB document?

Every object created over the whole lifetime of a Kubernetes cluster has a distinct UID. It is intended to distinguish between historical occurrences of similar entities. But there is no guarantee it would stay unique across clusters.

Can you consider the cluster name and pod UID combination as the primary key in the database table to identify specific pod in a cluster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM