ReplicaSet -> Find pod by labels -> Create pod from template
guide-03/task-03/whoami-rs.yml
apiVersion: apps/v1beta2
kind: ReplicaSet
metadata:
name: whoami-rs
spec:
replicas: 1
selector:
matchLabels:
type: app
service: whoami
template:
metadata:
labels:
type: app
service: whoami
spec:
containers:
- name: whoami
image: subicura/whoami:1
livenessProbe:
httpGet:
path: /
port: 4567
kubectl get pods --show-labels
kubectl label pod/whoami-rs-<xxxx> service-
kubectl label pod/whoami-rs-<xxxx> service=whoami
kubectl scale --replicas=3 -f whoami.yml
guide-03/task-03/whoami-rs-scaled.yml
apiVersion: apps/v1beta2
kind: ReplicaSet
metadata:
name: whoami-rs
spec:
replicas: 4
selector:
matchLabels:
type: app
service: whoami
template:
metadata:
labels:
type: app
service: whoami
spec:
containers:
- name: whoami
image: subicura/whoami:1
livenessProbe:
httpGet:
path: /
port: 4567
guide-03/task-03/exam-1.yml
- Name: nginx
- Labels: app => nginx
- Container Name: nginx
- Image: nginx
- Replicas: 3
kubectl delete -f ./