k8s:core:yaml_basics
This is an old revision of the document!
Table of Contents
YAML Structure in Kubernetes
Kubernetes uses YAML files to describe what you want the cluster to create.
Instead of writing code, you declare the desired state.
—
Basic structure
Every Kubernetes YAML usually has 4 main parts:
- apiVersion
- kind
- metadata
- spec
—
Simple example
apiVersion: v1 kind: Pod metadata: name: my-pod spec: containers: - name: nginx image: nginx
—
Key idea
YAML is NOT procedural. It is declarative:
- You say what you want
- Kubernetes figures out how to do it
k8s/core/yaml_basics.1780196707.txt.gz · Last modified: by phong2018
