[Kubernetes Study] Taints Tolerations

Taints and Tolerations 개념 본 포스트에서 사용되는 예시들은 Security나 Intrusion 설정이 되지 않은 것으로 간주한다. Taint와 Tolerations는 Label과 Selector와 유사하다. Label과 Selector는 필터링과 필터링을 이용한 객체들간의 매핑과 관련되었다면, Taint와 Tolerations는 Pod가 노드에 배치 될 때 제약사항을 만드는 것이다. 예시 관리자가 Pod 배치를 요청하면, 쿠버네티스 스케쥴러는 노드 중 가용 가능한 노드에 Pod를 배치하려 할 것이다. 만약 제약사항이 없다면 스케쥴러는 균등하게 Pod들을 노드에 배치할 것이다. 클러스터에 노드가 3개 있으며, 그 중 A라는 노드는 특정 목적을 위해 사용되는 노드라고 가정해보자....

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

[Kubernetes Study] Labelselector

Label selector kubectl의 --seletor 옵션을 이용해서 필터링을 직접 가능하다 apiVersion:v1kind:Podmetadata:name:simple-webapplabels:app:App1function:Front-end......spec:containers:- name:simple-webappimage:siple-webappports:- containerPort:8080kubectl get pods --selector app=App1 Label은 ReplicaSet, Pod, Service 등 다른 객체들 간의 연결에도 사용할 수 있다. 다음의 ReplicaSet의 예제다. apiVersion:v1kind:ReplicaSetmetadata:name:simple-webapplabels:app:App1function:Front-endspec:replicas:3selector:matchLabels:app:App1template:metadata:labels:app:App1function:Front-endspec:containers:- name:simple-webappimage:simple-webappmetadata.labels는 ReplicaSet에 할당되는 Label이다. spec.selector.matchLabels는 ReplicaSet과 매치되는 Pod를 지정한다. 위 yaml파일이 실행되면, ReplicaSet과 Pod가 연결된다. ReplicaSet과 Pod를 연결한 것과 같이 Service와 Pod를 연결할 수도 있다. apiVersion:v1kind:Servicemetadata:name:my-servicespec:selector:app:App1ports:- protocol:TCPport:80targetPort 9376위처럼 spec.selector를 이용해 Service와 연결된 Pod를 특정할 수 있다. Annotations annotation은 객체에 추가적인 정보를 입력할 때 사용된다....

January 29, 2024 · 1 min · 95 words · Me

Kubernetes Raspberry Pi

라즈베리파이로 Kubernetes 클러스터 구축하기 회사에서 동일한 구글계정을 사용해서 그런지 유튜브에 Satisfying 비디오로 서버실 선정리, 라즈베리파이로 쿠버네티스 구축하기 등 영상들이 올라왔다. 신기하네, 재밌네 로 끝났었는데 한 한국인 블로거가 빠른 실행력으로 라즈베리파이로 클러스터를 구축한 포스트를 보고 나도 하기로 마음먹었다. https://www.binaryflavor.com/raspberry-pi-kubernetes-1/ 구성 환경 구성 라즈베링파이4 모델B 4GB 메모리, 128GB SD Card * 4대 L2용 8포트 iptime공유기 라즈베리파이는 6대를 준비하였으나, 2대는 추후에 master node, worker node추가 실습용으로 남겨두고, 1대의 마스터노드, 3대의 워크노드로 클러스터를 구축하기로 했다....

September 10, 2023 · 4 min · 685 words · Me

LeetCode - Jewels and Stones

LeetCode(771) - Jewels and Stones 문제 문자열 jewels와 stones가 주어진다. stones는 내가 가지고 있는 동의 종류들이고, jewels는 보석의 종류들이다. 내가 가지고 있는 돌들 중 보석이 몇개인지 반환하라. 입력 Input: jewels = "aA", stones = "aAAbbbb" 출력 Output: 3 설명 stones는 중복이 가능하다. stones와 jewels의 각 문자는 대소문자가 구분된다. 풀이 stones를 순회하며 각 문자들을 map의 key로, 등장 횟수를 value로 저장한다. jewels를 순회하며 각 문자들을 map에서 검색 후 등장횟수들을 모두 카운트 후 반환한다....

February 5, 2023 · 1 min · 118 words · Me

LeetCode - Degree of an Array

LeetCode(697) - Degree of an Array 문제 정수 배열 nums가 주어진다. nums에서 가장 많이 등장하는 정수를 찾고, nums에서 가장 많이 등장하는 정수를 포함하는 sub array를 만들 때, 배열의 길이를 구하라. 입력 Input: nums = [1,2,2,3,1] 출력 Output: 2 설명 가장 많이 등장하는 정수는 1과 2다. 1 혹은 2가 모두 포함되는 배열의 sub array를 만들 면 다음과 같다. [1, 2, 2, 3, 1], [1, 2, 2, 3], [2, 2, 3, 1], [1, 2, 2], [2, 2, 3], [2, 2] 이 sub array 중 가장 짧은 배열의 길이를 갖는 배열은 [2, 2] 이며, 길이는 2이므로 2를 반환한다....

February 5, 2023 · 2 min · 290 words · Me