Does Kubernetes include a UUID service?

6/15/2018

UUIDs are hard. Many Implementations use a pseudo-random number generator to produce UUIDs, so multiple calls to get the next UUID have a very low probability of collision. However, pseudo-random numbers are hard.

Random number generators often use a seed value to start, and if there is sufficient randomness in that seed, then you are good. Timestamp, machine information, Mac address, etc... are often used. This is fine on a single machine, but in a cluster when multiple containers are running on the same physical hardware, and often boot at the same time, these common seed techniques may not be random at all.

But there is one actor that can help, the cluster manager. Since the cluster manager is responsible for managing the nodes, it has the ability to start each node with a random seed, allowing each node to assist with UUID creations.

UUID creation seems like something useful in a cluster, so my question, does Kubernetes support a highly scalable, highly available service for generating cluster-wide UUIDs that applications running in pods can use?

-- irbull
kubernetes

1 Answer

6/16/2018

No, as kubernetes is a cluster management control plane, and not in the business of application-level toys. If you have such strict requirements for UUID generation, kubernetes will help you make your service available to the other members of the cluster, but (aside from its own UUID generation) doesn't try to make such a generic thing available to cluster members

-- mdaniel
Source: StackOverflow