YAML Basics for Kubernetes
Step-01: Comments & Key Value Pairs¶
- Space after colon is mandatory to differentiate key and value
Step-02: Dictionary / Map¶
- Set of properties grouped together after an item
- Equal amount of blank space required for all the items under a dictionary
Step-03: Array / Lists¶
- Dash indicates an element of an array
Step-04: Multiple Lists¶
- Dash indicates an element of an array
Step-05: Sample Pod Tempalte for Reference¶
apiVersion: v1 # String
kind: Pod # String
metadata: # Dictionary
name: myapp-pod
labels: # Dictionary
app: myapp
spec:
containers: # List
- name: myapp
image: stacksimplify/kubenginx:1.0.0
ports: # Multiple Lists
- containerPort: 80
protocol: "TCP"
- containerPort: 81
protocol: "TCP"
🎉 New Course
Ultimate DevOps Real-World Project Implementation on AWS
$15.99
$84.99
81% OFF
DEVOPS2026FEB
Enroll Now on Udemy
🎉 Offer