티스토리 뷰

반응형

잘 모르면 몸이 고생한다고, Deployment replicas를 계속 변경하며 테스트 할 일이 있었는데 `kubectl edit` 으로 replicas를 변경해가며 사용했다.

근데 더 간단하게 CLI 상에서 replicas를 변경할 수 있는 `kubectl scale` 명령어가 있었다.

# Scale a replica set named 'foo' to 3
kubectl scale --replicas=3 rs/foo

# Scale a resource identified by type and name specified in "foo.yaml" to 3
kubectl scale --replicas=3 -f foo.yaml

# If the deployment named mysql's current size is 2, scale mysql to 3
kubectl scale --current-replicas=2 --replicas=3 deployment/mysql

# Scale multiple replication controllers
kubectl scale --replicas=5 rc/foo rc/bar rc/baz

# Scale stateful set named 'web' to 3
kubectl scale --replicas=3 statefulset/web

 

예시에서 볼 수 있듯 replicas 필드가 존재하는 `Deployment`, `Replicaset`, `Statefulset` 다 사용가능하다.

320x100
반응형
댓글
반응형
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함