The object spec describes the desired state of Kubernetes objects. Most of the time, we write an object spec and send it to the API server via kubectl. Kubernetes will try to fulfill that desired state and update the object's status.
The object spec could be written in YAML (http://www.yaml.org/) or JSON (http://www.json.org/). YAML is more common in the Kubernetes world. We'll use YAML to write object spec in the rest of this book. The following code block shows a YAML-formatted spec fragment:
apiVersion: Kubernetes API version
kind: object type
metadata:
spec metadata, i.e. namespace, name, labels and annotations
spec:
the spec of Kubernetes object