2023.01.31
๐ฆ yaml ํ์ผ ์์ฑ
cat > rc-nginx.yaml
apiVersion: v1
kind: ReplicationController
metadata:
name: rc-nginx
spec:
replicas: 3
selector:
app: webui
template:
metadata:
name: nginx-pod
labels:
app: webui
spec:
containers:
- name: nginx-container
image: nginx:1.14
๐ฆ ์คํ ๋ฐ ํ์ธ
kubectl apply -f rc-nginx.yaml
kubectl delete pod [pod์ด๋ฆ]
์ณ๋ณด๋ฉด ๋ค์ ์ด์๋๋ค.
kubectl get rc
kubectl get rc rc-nginx
kubectl get replicationcontrollers
- kubectl edit rc rc-nginx์์ replica ๊ฐ ๋ณ๊ฒฝ
- kubectl scale rc rc-nginx --replicas=3 ๋ช ๋ น์ด ์ฌ์ฉ