このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
最近の更新
my-nginx.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: my-nginx spec: selector: matchLabels: run: my-nginx replicas: 1 template: metadata: labels: run: my-nginx spec: containers: - name: my-nginx image: nginx ports: - containerPort: 80
kubectl create -f my-nginx.yaml
# kubectl get deployments.apps my-nginx NAME READY UP-TO-DATE AVAILABLE AGE my-nginx 1/1 1 1 5m19s # kubectl get pod -l run=my-nginx NAME READY STATUS RESTARTS AGE my-nginx-cf54cdbf7-jd8xc 1/1 Running 0 2m23s
kubectl scale deployment my-nginx --replicas=3
Podが3つに増えている
# kubectl get deployments.apps my-nginx NAME READY UP-TO-DATE AVAILABLE AGE my-nginx 3/3 3 3 6m13s # kubectl get pod -l run=my-nginx NAME READY STATUS RESTARTS AGE my-nginx-cf54cdbf7-hgbdl 1/1 Running 0 27s my-nginx-cf54cdbf7-j5lmk 1/1 Running 0 27s my-nginx-cf54cdbf7-jd8xc 1/1 Running 0 6m32s
kubectl scale deployment my-nginx --replicas=1
Podが1つに減っている
# kubectl get pod -l run=my-nginx NAME READY STATUS RESTARTS AGE my-nginx-cf54cdbf7-jd8xc 1/1 Running 0 7m19s # kubectl get pod -l run=my-nginx NAME READY STATUS RESTARTS AGE my-nginx-cf54cdbf7-jd8xc 1/1 Running 0 7m39s