티스토리 뷰
반응형
Label 확인
kubectl get nodes --show-labels
해당 명령어로 node 별로 설정되어 있는 label을 확인할 수 있으며,
label의 종류가 꽤나 많습니다...
Label 추가
kubectl label node <node_name> <key>=<value>
추가한 후 아래 커맨드로 확인 시 추가 되어 있는 걸 볼 수 있습니다.
kubectl describe nodes <node_name>
Label 삭제
key-만 넣어주면 삭제가 됩니다.
kubectl label nodes <node_name> <key>-
Label이 설정이 됬으니 deployment에서
spec.nodeSelector.<key>.<value> 를 추가하고 배포하면 됩니다.
apiVersion: apps/v1
kind: Deployment
...
spec:
containers:
...
nodeSelector:
<key>: <value>
그 후에 확인을 하려면
kubectl get pods -o wide
이 외에 node affinity 라는 명령어도 있습니다.
크게는 아래와 같이 분류 됩니다.
- requiredDuringSchedulingIgnoredDuringExecution
- preferredDuringSchedulingIgnoredDuringExecution
- requiredDuringSchedulingRequiredDuringExecution
- preferredDuringSchedulingRequiredDuringExecution
실제 affinity까지 사용을 해보진 않아서
아직까진 정리가 부족합니다...
더 자세한 사항은 공식 문서로
https://kubernetes.io/ko/docs/concepts/scheduling-eviction/assign-pod-node/
반응형
'Development > Docker and k8s' 카테고리의 다른 글
Kubernetes 애플리케이션 배포 도구 : Helm chart and Kustomize (0) | 2024.12.23 |
---|---|
Docker Stack (0) | 2024.12.19 |
Kubernetes Secrets: 보안 애플리케이션 관리 방법 (2) | 2024.12.18 |
[k8s] pod 내부에서 외부 연결 (0) | 2021.12.24 |
[Docker error] 서버 재시작 후 도커 에러 처리 (0) | 2021.12.21 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- LLM
- book
- error
- kubernetes context
- 나는리뷰어다
- Git
- K8S
- Algorithm
- Python
- csv
- 파이썬
- leetcode
- palindrome
- Gemma
- docker
- Kubernetes
- 키보드
- lllm
- Binary
- feed-forward
- BASIC
- kubens
- collator
- 한빛미디어
- go
- Fine-Tuning
- Shell
- AWS
- 책리뷰
- Container
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함
반응형