# Object Names and IDs

Object Names and IDsEach object in your cluster has a Name that is unique for that type of resource. Every Kubernetes object also has a UID that is unique across your whole cluster.For example, you can only have one Pod named myapp-1234 within the same namespace, but you can have one Pod and one Deployment that are each named myapp-1234.For non-unique user-provided attributes, Kubernetes provides labels and annotations.NamesA client-provided string that refers to an object in a resource URL, such as /api/v1/pods/some-name.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.Names must be unique across all API versions of the same resource. API resources are distinguished by their API group, resource type, namespace (for namespaced resources), and name. In other words, API version is irrelevant in this context.Note:In cases when objects represent a physical entity, like a Node representing a physical host, when the host is re-created under the same name without deleting and re-creating the Node, Kubernetes treats the new host as the old one, which may lead to inconsistencies.The server may generate a name when generateName is provided instead of name in a resource create request. When generateName is used, the provided value is used as a name prefix, which server appends a generated suffix to. Even though the name is generated, it may conflict with existing names resulting in a HTTP 409 response. This became far less likely to happen in Kubernetes v1.31 and later, since the server will make up to 8 attempt to generate a unique name before returning a HTTP 409 response.Below are four types of commonly used name constraints for resources.DNS Subdomain NamesMost resource types require a name that can be used as a DNS subdomain name as defined in RFC 1123. This means the name must:contain no more than 253 characterscontain only lowercase alphanumeric characters, '-' or '.'start with an alphanumeric characterend with an alphanumeric characterRFC 1123 Label NamesSome 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 characterscontain only lowercase alphanumeric characters or '-'start with an alphanumeric characterend with an alphanumeric characterRFC 1035 Label NamesSome resource types require their names to follow the DNS label standard as defined in RFC 1035. This means the name must:contain at most 63 characterscontain only lowercase alphanumeric characters or '-'start with an alphabetic characterend with an alphanumeric characterNote:The only difference between the RFC 1035 and RFC 1123 label standards is that RFC 1123 labels are allowed to start with a digit, whereas RFC 1035 labels can start with a lowercase alphabetic character only.Path Segment NamesSome resource types require their names to be able to be safely encoded as a path segment. In other words, the name may not be "." or ".." and the name may not contain "/" or "%".Here's an example manifest for a Pod named nginx-demo.apiVersion: v1 kind: Pod metadata: name: nginx-demo spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80 Note:Some resource types have additional restrictions on their names.UIDsA 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.Kubernetes UIDs are universally unique identifiers (also known as UUIDs). UUIDs are standardized as ISO/IEC 9834-8 and as ITU-T X.667.What's nextRead about labels and annotations in Kubernetes.See the Identifiers and Names in Kubernetes design document.