Kubernetes Objects
Kubernetes objects are persistent entities in the Kubernetes system. Kubernetes uses these entities to represent the state of your cluster.
A Kubernetes object is a “record of intent”—once you create the object, the Kubernetes system will constantly work to ensure that object exists.
To work with Kubernetes objects—whether to create, modify, or delete them—you’ll need to use the Kubernetes API.
Almost every Kubernetes object includes two nested object fields that govern the object’s configuration:
- the object
specand - the object
status. current state of the object,
Object structure
In the manifest (YAML or JSON file) for the Kubernetes object you want to create, you’ll need to set values for the following fields:
apiVersion- Which version of the Kubernetes API you’re using to create this objectkind- What kind of object you want to createmetadata- Data that helps uniquely identify the object, including anamestring,UID, and optionalnamespacespec- What state you desire for the object- The precise format of the object
specis different for every Kubernetes object, and contains nested fields specific to that object.
- The precise format of the object