[Kubernetes Study] Multiple Schedulers

Scheduler Kubernetes cluster의 default scheduler는 nodes들 전반에 걸쳐서 어떻게 Pod를 배치할지 결정하는 역할을 한다. 각 node들의 상태와 affinity, tolerations, taints, selector등의 조건들을 기준으로 Pod의 배치를 결정한다. 하지만 kubernetes가 제공하는 조건들 외에 추가적인 조건을 확인해야 한다면? 사용자가 원하는 스케쥴러를 사용할 수 있다. Multiple scheduler 사용자는 기본 스케쥴러 대신에 새로운 스케쥴러를 만들어 기본 스케쥴러를 대체하거나 사용자가 만든 스케쥴러를 추가로 배치할 수 있다. 사용자는 Pod가 배치될 때 스케쥴러를 지정할 수 있다. kubernetes의 기본 스케쥴러는 kube-scheduler이며, 사용자가 생성한 스케쥴러는 이름이 고유해야한다....

February 25, 2024 · 2 min · 354 words · Me

[Kubernetes Study] Static Pod

Static Pod란? kubelet은 kube-apiserver를 통해서 Pod가 어떤 노드에 배치되어야 하는지 알아낸다. 이러한 Node를 결정하는 것은 kube-scheduler에 의해 결정되며, ETCD 데이터베이스에 저장된다. 이러한 일련의 작업을 해주는 k8s의 기본 리소스인 kube-apiserver와 kube-scheduler, ETCD 등이 없다면 어떻게 될까? 각 워커노드에서 동작하는 kubelet은 독립적으로 동작할 수 있다. 만약 Pod설정 정보인 yaml파일들이 /etc/kubernetes/manifests 하위에 있다면, kubelet은 해당 파일들을 주기적으로 검사해서 yaml에 설정된 대로 Pod들을 설치할 것이다. 파일이 존재한다면 Pod를 생성하는것 뿐만 아니라 Pod내에 container의 재시작, Pod 재생성 등의 작업 또한 가능하다....

February 13, 2024 · 2 min · 271 words · Me

Kubernetes Raspberry Pi Os

How to establish kubernetes cluster using Raspberry Pi OS Prepare Raspberry-pi OS image using imager Setting up raspberry-pi OS Update OS and repo sudo apt update -y && sudo apt dist-upgrade -y reboot sudo reboot Disable and uninstall swap sudo dphys-swapfile swapoff sudo dphys-swapfile uninstall sudo apt purge -y dphys-swapfile sudo apt autoremove -y Add cgroups echo " cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1" | sudo tee -a /boot/cmdline.txt Disable and uninstall swap sudo dphys-swapfile swapoff sudo dphys-swapfile uninstall sudo apt purge -y dphys-swapfile sudo apt autoremove -y Or update cmdline...

February 13, 2024 · 3 min · 606 words · Me

[Kubernetes Study] DaemonSets

DaemonSet DaemonSet는 Deployment와 유사한 object로 여러 여러 pod들의 집합이다. 하지만 가장 큰 차이는 Pod instance는 노드 별 하나만 설치된다는 점이다. 이는 새로운 노드가 클러스터에 추가되는 것도 포함하며, 신규 노드가 join 시 Daemon Sets는 해당 Pod를 노드에 추가한다. 위와 같은 특징으로 Daemon Sets는 각 노드별로 배치되어야 하는 기능에 사용 가능하다. 예를 들면 노드 별 네트워크 I/O를 모니터링 하는 agent들을 배치할 수 있다. 이처럼 노드 별 agent가 필요로 하는 서비스를 배치한다면 centralized service에서는 노드의 추가, 삭제등의 동작을 DaemonSet에 일임할 수 있다....

January 30, 2024 · 1 min · 88 words · Me

[Kubernetes Study] Resource requirements and limits

Resource requirements and limits 각 노드는 CPU와 Memory 리소스를 갖고 있다. 스케쥴러에 이해 Pod가 배치될 때, Pod의 리소스 요청 사항과 노드의 리소스 사용량은 스케쥴링에 직접적인 영향을 미친다. Requests 사용법 다음과 같이 spec.containers.resources.requests 를 이용해 Pod에 리소스 정보를 명세할 수 있다. apiVersion:v1kind:Podmetadata:name:simple-webapp-colorlabels:name:simple-webapp-colorspec:containers:- name:simple-webapp-colorimage:simple-webapp-colorports:- containerPort:8080resources:requests:memory:"4Gi"cpu:2단위 CPU CPU의 단위는 정수, 소수점, m 을 이용해서 설정할 수 있다. m은 milli의 뜻으로 1/1000이라서 cpu 0.1은 100m과 동일하며, 1은 1000m과 동일하다. CPU의 최소 단위는 1m이며 그 이하는 될 수 없다....

January 30, 2024 · 2 min · 315 words · Me