티스토리 뷰
잘 모르면 몸이 고생한다고, 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
반응형
'Development > Docker & Kubernetes (K8s)' 카테고리의 다른 글
Podman 사용하기 (M1 mac, 아주 심플하게) (0) | 2022.12.23 |
---|---|
Kubernetes Pod Restart에 대하여 (0) | 2022.04.05 |
[Kubernetes] Owner - Dependent (Garbage collector) (0) | 2022.02.16 |
Sealed- secrets 바로 사용하기 (0) | 2022.01.30 |
Kubernetes resource uid 추출하기 (0) | 2021.12.17 |
댓글
반응형
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- docker
- gradle
- MySQL
- Spring boot
- Kubernetes
- Intellij
- java
- WebFlux
- Log
- jasync
- Algorithm
- 알고리즘
- container
- 쿠버네티스
- OpenTelemetry
- c++
- python
- HTTP
- k8s
- Istio
- 로그
- boj
- 클린 아키텍처
- Spring
- tag
- Clean Architecture
- 비동기
- 백준
- 하루
- 일상
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함