A metadata section identifies and describes a Kubernetes object instance. It contains the object's name and may include labels, annotations, resourceVersion, managedFields, and other management fields. section 4.2.1
Use metadata when defining or inspecting objects:
- Set metadata.name to give an object a recognizable identity. section 5.2.1
- Expect the API to add fields after creation; a minimal Pod manifest may begin with only its name under metadata. section 5.2.1
- Inspect labels, annotations, and low-level management fields when reading a complete object returned by the API. section 4.2.1
A minimal Pod identity
metadata:\n name: kiada\n\nThis gives the Pod the name kiada. Its manifest can then define the Pod's containers under spec; additional metadata and status fields appear after the object is created. section 5.2.1
Listing 5.1 A basic pod manifest file
apiVersion: v1 #1
kind: Pod #2
metadata:
name: kiada #3
spec:
containers:
- name: kiada #4
image: luksa/kiada:0.1 #5
ports:
- containerPort: 8080 #6
Browse the complete basic Pod manifest to see metadata.name alongside apiVersion, kind, and spec. section 5.2.1
