Explaining Pod manifest structure
Every Kubernetes resource manifest inlude following sections
- apiVersion
- kind
- metadata
- spec
You can see some example bellow.
Pod example:
apiVersion: v1
kind: Pod
metadata:
name: app
spec:
containers:
- name: app
image: nginx
Replicaset example:
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80