Search

Daemon Sets

Created
2023/10/01 03:57
Tags
k8s
CKA
Mumshad Mannambeth
Scheduling

1) About

Daemon Set은 Replica Set과 같은 Pod의 집합인데, Replica Set은 복제에 초점이 맞춰져있었다면 Daemon Set은 노드마다 1개의 Pod를 두는 것이 목적
노드가 삭제되면 해당 노드의 Daemon Set인 Pod도 삭제 되고, 노드가 추가되면 해당 노드에 Daemon Set인 Pod를 추가
모니터링 에이전트 혹은 로그 수집기를 사용할 때 Daemon Set이 유용
Kube Proxy 역시 Daemon Set의 좋은 예시
Daemon Set이 각 노드마다 Pod를 두는 것을 보장할 수 있는 이유는, Pod를 생성하기 이전에 노드의 이름을 nodeName에 기입하여 생성하는 식으로 동작하기 때문

2) YAML

apiVersion: apps/v1, kind: DaemonSet
apiVersion: apps/v1 kind: DaemonSet metadata: name: ds-sample spec: selector: matchLabels: app: ds-monitor-agent template: metadata: labels: app: ds-monitor-agent spec: containers: - name: ds-monitor-agent image: ds-monitor-agent
YAML
복사

3) Commands

kubectl get daemonset
DaemonSet들을 읽음
kubectl describe daemonset ${NAME}
상세 정보를 확인

4) Abbreviation

Damon Set == ds