-
ETCD 이해하기SW개발/Kubernetes 2025. 8. 10. 02:26
Kubernetes(K8s)를 처음 접하면 수많은 컴포넌트와 용어에 압도되지만, 그 중심에는 ETCD라는 아주 중요한 저장소가 있으며, Kubernetes는 모든 클러스터 상태와 설정 정보를 ETCD에 저장합니다.어떤 Pod이 어디서 동작 중인지Service의 엔드포인트 정보ConfigMap과 Secret노드 상태, 네임스페이스, 이벤트 로그 등이 모든 것이 ETCD에 기록됩니다.즉, ETCD가 없으면 클러스터의 상태를 잃어버리게 되고, Kubernetes는 ‘내가 뭘 하고 있었는지’ 전혀 기억하지 못하게 됩니다.1. ETCD란 무엇인가?결국, ETCD는 분산 키-값 저장소(Distributed Key-Value Store)입니다.Raft 합의 알고리즘을 사용하여 여러 노드에 걸쳐 데이터 일관성 유지빠른..
-
[linux] cgroup v1과 v2 및 cgroup 메모리에 대한 이해(+metric)SW개발/Linux 2025. 7. 27. 19:44
리눅스 기반 시스템에서 리소스 관리와 격리는 매우 중요한 주제입니다. 특히 컨테이너 기술이 보편화된 지금, CPU, 메모리, I/O 등 다양한 리소스를 어떻게 효율적으로 제어할 것인가는 운영의 핵심이 되었습니다. 바로 이 지점에서 Cgroup(Control Groups)이 등장합니다.Cgroup은 리눅스 커널 기능 중 하나로, 프로세스 그룹에 대해 자원 사용량을 제한하거나 계측하고, 우선순위를 조정할 수 있도록 해줍니다. 그런데 이 Cgroup에는 두 가지 주요 버전이 존재합니다: v1과 v2. 두 버전은 구조와 동작 방식, 특히 메모리 관리 방식에서 상당한 차이를 보입니다.이 글에서는 Cgroup v1과 v2의 개념을 간단히 짚어보고, 특히 메모리 서브시스템의 차이점, OOM(Out of Memory)..
-
[k8s] watch/list 그리고 Thunder herdSW개발/Kubernetes 2025. 7. 20. 02:51
대규모 트래픽 환경에서 k8s를 운영하다보면 많은 일이 일어나지만, 그 중에서 일정시간의 네트워크 이슈 발생 후 복구된 과정에서 kube-apiserver 가 OOM으로 여러차례 죽으면서 알게된 것들에 대해 기록하고자 한다. 1. Thunder herd여러 프로세스나 스레드가 동시에 같은 이벤트(예: 소켓의 데이터 수신, 파일 디스크립터의 상태 변화)를 기다리다가, 이벤트가 발생했을 때 모든 대기자가 한꺼번에 깨어나는 현상으로 모든 대기자들이 동시에 깨서 자원(예: 네트워크 패킷, 파일 I/O)을 서로 차지하려고 경쟁하기 때문에, 불필요하게 많은 컨텍스트 스위칭과 CPU 오버헤드가 발생하고 성능이 저하 되는 것 예를 들어,수 천개의 노드를 가진 클러스터가 있다고 가정할 때, 네트워크 등의 이슈로 kube..
-
[Leetcode] 40. Combination Sum II코딩테스트 2021. 5. 6. 08:14
문제) Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. Each number in candidates may only be used once in the combination. Note: The solution set must not contain duplicate combinations. Example 1: Input: candidates = [10,1,2,7,6,1,5], target = 8 Output: [ [1,1,6], [1,2,5], [1,7]..
-
[Leetcode] 39. Combination Sum코딩테스트 2021. 5. 6. 00:42
문제) Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order. The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different. It i..
-
[Leetcode] 75. Sort Colors코딩테스트 2021. 5. 3. 22:35
문제) Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue. We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively. Example 1: Input: nums = [2,0,2,1,1,0] Output: [0,0,1,1,2,2] Example 2: Input: nums = [2,0,1] Output: [0,1,2] Exampl..
-
[Leetcode] 57. Insert Interval코딩테스트 2021. 5. 2. 20:58
문제) Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted according to their start times. Example 1: Input: intervals = [[1,3],[6,9]], newInterval = [2,5] Output: [[1,5],[6,9]] Example 2: Input: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8] Output: [[1,2],[3,10],[12,16..
-
[leetcode] 147. Insertion Sort List코딩테스트 2021. 4. 29. 22:43
문제) Given the head of a singly linked list, sort the list using insertion sort, and return the sorted list's head. The steps of the insertion sort algorithm: Insertion sort iterates, consuming one input element each repetition and growing a sorted output list. At each iteration, insertion sort removes one element from the input data, finds the location it belongs within the sorted list and inser..