K8s 테인트

(쿠버네티스 Taint에서 넘어옴)

1 개요[ | ]

k8s Taint
쿠버네티스 테인트
  • 세 가지 필수 속성: 키(key), 값(value), 효과(effect)로 구성된 코어 오브젝트
  • 테인트는 파드가 노드나 노드 그룹에 스케줄링되는 것을 방지한다.
  • 테인트 및 톨러레이션(toleration)은 함께 작동하며, 파드가 적절하지 못한 노드에 스케줄되는 것을 방지한다.
  • 하나 이상의 테인트가 노드에 적용될 수 있으며, 이것은 노드에 해당 테인트를 극복(tolerate)하지 않은 파드를 허용하지 않도록 표시한다.
kubectl taint nodes node1 key=value:NoSchedule
$ kubectl describe nodes | egrep ^'Name|Taints'
Name:               master
Taints:             node-role.kubernetes.io/master:NoSchedule
Name:               worker1
Taints:             <none>
Name:               worker2
Taints:             <none>

2 실습[ | ]

$ kubectl get no
NAME           STATUS   ROLES           AGE     VERSION
controlplane   Ready    control-plane   7d10h   v1.31.0
node01         Ready    <none>          7d9h    v1.31.0
$ kubectl get no node01 -ojson | jq .spec.taints
null
$ kubectl taint nodes node01 key1=value1:NoSchedule
node/node01 tainted
$ kubectl get no node01 -ojson | jq .spec.taints
[
  {
    "effect": "NoSchedule",
    "key": "key1",
    "value": "value1"
  }
]
$ kubectl taint nodes node01 key1=value1:NoExecute
node/node01 tainted
$ kubectl get no node01 -ojson | jq .spec.taints
[
  {
    "effect": "NoExecute",
    "key": "key1",
    "value": "value1"
  },
  {
    "effect": "NoSchedule",
    "key": "key1",
    "value": "value1"
  }
]
$ kubectl taint nodes node01 key1=value1:NoSchedule-
node/node01 untainted
$ kubectl get no node01 -ojson | jq .spec.taints
[
  {
    "effect": "NoExecute",
    "key": "key1",
    "value": "value1"
  }
]

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}