ื ืืฆืืจ ืงืืืฅ ืืืฉ, ืืืืืื:
touch nginx-rs.yaml
ื ืื ืืก ืืืื ืืื ื ืืกืืกื:
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: nginx-replicaset
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
๐น replicas: 3
ืืื ืืกืคืจ ื-Pods ืฉืฆืจืืืื ืืจืืฅ ืืื ืจืืข.
ืืื Source of Truth.
๐น selector.matchLabels
ืื ื-ReplicaSet ืืืื ืืืื Pods ืฉืืืืื ืืืื.
๐น template
ืืืืืจ ืืช ื-Pod ืฉืืืืฆืจ ืืืฉืจ ืืกืจืื replicas.
โ ๏ธ ืืืืืช ืืืืืช ืืชืืื ืืื ื-label ื-template ืืืื ื-selector.
ื ืืื ืืช ืืงืืืฅ:
kubectl apply -f nginx-rs.yaml
ื ืืืืง: