Object Names and IDs
For example, you can only have one Pod named within the same namespace, but you can have one Pod and one Deployment that are each named .
For non-unique user-provided attributes, Kubernetes provides and annotations.
A client-provided string that refers to an object in a resource URL, such as .
Only one object of a given kind can have a given name at a time. However, if you delete the object, you can make a new object with the same name.
Below are four types of commonly used name constraints for resources.
Most resource types require a name that can be used as a DNS subdomain name as defined in . This means the name must:
- contain no more than 253 characters
- contain only lowercase alphanumeric characters, ‘-‘ or ‘.’
- start with an alphanumeric character
- end with an alphanumeric character
Some resource types require their names to follow the DNS label standard as defined in RFC 1123. This means the name must:
- contain at most 63 characters
- contain only lowercase alphanumeric characters or ‘-‘
- end with an alphanumeric character
Some resource types require their names to follow the DNS label standard as defined in . This means the name must:
- contain at most 63 characters
- contain only lowercase alphanumeric characters or ‘-‘
- start with an alphabetic character
- end with an alphanumeric character
Here’s an example manifest for a Pod named .
Note: Some resource types have additional restrictions on their names.
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.
- Read about labels in Kubernetes.