CKA 기록. 02

Logging·2023년 1월 11일
0

CKA

목록 보기
2/6

👩‍💻CKA자격증 공부하면서, 기록 중

✔ Kubernetes taint & toleration


✍🏻 00. intro

Udemy Labs - Certified Kubernetes Administrator with Practice Tests
Scheduling : Practice Test- Taints and Tolerations


✍🏻 01. taint & toleration ?

  • taint : 얼룩, Node 마다 설정가능
    Node 마다 설정하여 임의의 pod가 할당 방지
  • toleration : Pod에 설정
    노드에 taint가 설정되있는 경우, toleration 설정하여 스케줄링 허용
    taint를 무시할수있음

✍🏻 02. 실습

1. taint 추가하기

 $ kubectl taint node [노드 이름] [key]=[value]:[effect]

2. taint 제거하기

$ kubectl taint node [노드 이름] [key]=[value]:[effect]-
  • effect 뒤 "-" 표시 붙이면 삭제!


3. YAML 파일 속에 tolerations 지정하기

apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx
  tolerations:
  - key: "[key]"
    operator: "Exists"
    value: "[value]"
    effect: "NoSchedule"
  • podspec 하위 단에 containers랑 같은 계위
  • tolerations의 옵션들
    operator
    - Equal
    - Exists
    effect
    - NoSchedule
    - NoExecute

✍🏻 참고 링크
https://kubernetes.io/ko/docs/concepts/scheduling-eviction/taint-and-toleration/
https://nayoungs.tistory.com/entry/Kubernetes-k8s-Taint%EC%99%80-Tolerations

profile
개발새발쿼카발로 기록중💾

0개의 댓글