티스토리 뷰
Node 의 Label 검사하기.
kubectl describe nodes node01 | grep -A10 Labels
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
kubernetes.io/arch=amd64
kubernetes.io/hostname=node01
kubernetes.io/os=linux
Node Label 목록만 보기
kubectl get nodes node01 --show-labels
Node Label 추가힉.
kubectl label node node01 color=blue
node/node01 labeled
kubectl describe nodes node01 | grep -A10 Labels
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
color=blue
kubernetes.io/arch=amd64
kubernetes.io/hostname=node01
kubernetes.io/os=linux
6개의 pod 를 가진 Deployment 생성하기.
- name: blue
- image: nginx
- replicas: 6
kubectl create deployment blue --image=nginx --replicas=6
deployment.apps/blue created
Affinity 설정하기.
cat nginx-deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: red
name: red
spec:
replicas: 3
selector:
matchLabels:
app: red
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: red
spec:
containers:
- image: nginx
name: nginx
resources: {}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/master
operator: Exists
status: {}
- affinity: 이하 부분부터 노드에 맞는 Pod를 배포하게 된다.
'Kubernetes' 카테고리의 다른 글
[Kubernetes] 명령적/선언적 방법 실습 (0) | 2022.04.11 |
---|---|
[Kubernetes] Taint and Toleration (0) | 2022.04.11 |
[Kubernetes] Kubernetes Resource Limit 실습 (0) | 2022.04.11 |
[Kubernetes] Kubernetes DaemonSet 실습 (0) | 2022.04.11 |
[Kubernetes] Kubernet ConfigMap 실습 (0) | 2022.04.11 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- java
- jenkins
- AWS
- gitops
- CI
- deploy
- Gorilla
- MySQL
- NodeSelector
- Spring
- tfsec
- Terraform
- mapping
- kafka-springboot
- MongoDB
- go
- kubectl
- Golang
- declative
- Database
- mongo
- D3
- jpa
- springboot
- docker
- docker-compose
- CD
- kubernetes
- argocd
- Kafka
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함