Writing Manifests
YAML
- This a file format for representing data which uses name value or key value pairs as a basic structure.
- YAML files generally have an extension of .yml or .yaml
- Basic structure
name-1: <value-1>
name-2: <value-2>
..
..
name-n: <value-n>
- Types of data
- Simple/Scalar
- Text
- number
- boolean
- Complex
- object/map
- array/list
- Simple/Scalar
- Text
city: Hyderabad
city: 'Hyderabad'
city: "Hyderabad"
- number
population: 11.3
- boolean
metro: true
metro: yes
- list or array
areas: ['Ameerpet', 'SRNagar']
areas:
- Ameerpet
- SR Nagar
areas:
- Ameerpet
- SR Nagar
- object|map:
address:
flatno: 601-b
builing: nilgiri
area: Ameerpet
city: Hyderabad
- YAML Tutorial
- Generally YAML for a specific tool comes with a structure or schema
- Lets create a structure for filling a product information in ecommerce website
- create a yaml file based on following
name string
manufacturer: string
skus: sku array
gst: number (default: 18)
## sku
name: string
description: string
price: number
- Lets create a sample yaml file
---
name: Sony PlayStation5
manufacturer: Sony
skus:
- name: Slim
description: Slim
price: 54990
- name: Muscular
description: Muscular
price: 154990
Lets start writing pod manifests
- Kubernetes Pods have containers
- Any thing which you create in k8s is an object
- Refer Here for k8s api reference
- Refer Here for pod spec
Example 1: A pod with nginx container
-
Refer Here for the changes done
-
API Server fills the status

Example 2: A pod with nginx container and alpine container
- Refer Here for the changes done

Example 3: A pod with alpine container without cmd
apiVersion: v1
kind: Pod
metadata:
name: third
spec:
containers:
- name: alp
image: alpine

