전체 글
-
K8S 아키텍처 정리 (Kube-scheduler, Kubelet, Kube-proxy)K8S 2021. 6. 2. 22:06
1. Kube-Scheduler 스케줄러는 어떤 포드가 어떤 노드로 갈지를 결정하는 등 스케줄을 짠다. 하지만 스케줄을 짤 뿐, 실제로 노드 위에 포드를 놓지는 않는다. (노드 위에 포드를 할당하는 것은 Kubelet의 역할) 스케줄러는 오직 포드를 어떤 노드로 옮길 것인지만 결정한다. 그렇다면 스케줄러는 어떻게 적당한 노드를 선택하고 포드를 옮길까? 스케줄러는 먼저 포드들을 관찰하면서 포드가 할당되기 좋은 최적의 노드를 결정한다. 예를 들어 다음과 같이 CPU 10을 필요로 하는 포드를 CPU 4, CPU 4, CPU 12, CPU 16를 리소스를 갖는 노드에 배포한다고 해보자. 이 때 다음과 같은 과정을 통해 최적의 노드를 결정한다. 1) Filter Nodes 해당 포드에 적합하지 않는 노드는 먼저..
-
K8S 아키텍처 정리(ETCD, Kube-api server, Kube-controller-manager)K8S 2021. 6. 1. 12:52
1. ETCD ETCD는 안전하고 빠른 distributed reliable key-value store로 다음과 같은 RDB를 생각하면 된다. ETCD는 기본적으로 2379번 포트를 이용하며 다음 커맨드를 통해 key value을 저장할 수 있다. ./etcdctl set key1 value1 ETCD에서 값 반환하기 ./etcdctl get key1 K8S에서 ETCD의 역할 kubectl command에서 얻을 수 있는 모든 정보는 마스터 노드의 ETCD 서버로부터 얻는다. 노드를 추가할 때, 포드를 배포할때, 레플리카 셋을 변경할때 등 상태가 변화할때 ETCD 서버에서 업데이트된다. K8S 배포형태는 2가지의 타입이 있는데 scratch를 이용한 배포와 kubeadm이 있다. scratch를 이용..
-
자료구조: Chained Hash Table 구현하기 (feat. c++)알고리즘/자료구조 2021. 5. 31. 21:36
Characteristic: - MyTable class is a hash table class consisted of linked list Operations: - insert - lookup - deletKey - dump #include using namespace std; const int MAX_TABLE = 11; template class MyTable { public: MyTable(); void insert(const tableKeyType& key, const tableDataType& data); bool lookup(const tableKeyType & key, tableDataType& data); void deleteKey(const tableKeyType& key); void ..
-
자료구조: Array Table 구현하기 (feat. c++)알고리즘/자료구조 2021. 5. 31. 20:07
Characteristic: - Table class is an array Table class Operations: - insert - lookup - deleteKey #include #include using namespace std; const int MAX_TABLE = 100; template class Table { public: Table(); bool lookup(tableKeyType lookupKey, tableElementType& data); void insert(tableKeyType insertKey, tableElementType insertData); void deleteKey(tableKeyType deleteKey); private: struct item { tableK..
-
자료구조: Linked List Queue 구현하기 (feat. c++)알고리즘/자료구조 2021. 5. 31. 19:35
Characteristic: - MyQueue class is a Queue class consisted of linked list Operations: - enqueue - dequeue - front - isEmpty #include #include using namespace std; template class MyQueue { public: MyQueue(); void enqueue(queueElementType elem); queueElementType dequeue(); queueElementType front(); bool isEmpty(); private: struct Node; typedef Node* nodePtr; struct Node { queueElementType elem; no..
-
자료구조: Circular Queue 구현하기 (feat. c++)알고리즘/자료구조 2021. 5. 31. 18:57
Characteristic: - queue class is an array Circular Queue class Operations: - enqueue - dequeue - front - isEmpty #include #include using namespace std; const int maxQueue = 10; int nextPos(int p); template class queue { public: queue(); void enqueue(QueueElementType e); QueueElementType dequeue(); QueueElementType front(); bool isEmpty(); private: int f; int r; QueueElementType queueArray[maxQue..
-
Python: matplot 라이브러리 정리 (선, 막대, 산포도, 파이, 히스토그램)Python 2021. 5. 31. 17:32
데이터 시각화는 점이나 선, 막대 그래프 등의 시각적 이미지를 사용하여 데이터를 화면에 표시하는 기술이다. 또한 데이터 시각화를 통해서 데이터에 내재되어 있는 패턴을 알아내는데도 사용된다. python에서는 matplot이라는 데이터 시각화 라이브러리를 제공하며 간단한 막대 그래프, 선 그래프, 산포도를 그리는 용도로 활용 가능하다. 1. matplot 라이브러리 사용하기 import matplotlib.pyplot as plt years = [1950, 1960, 1970, 1980, 1990, 2000, 2010] gdp = [67, 80, 257, 1686, 6505, 11865, 22105] # 선 그래프를 그린다. x축에는 years, y축에는 gdp plt.plot(years, gdp, col..
-
Python: numpy 라이브러리 정리(indexing, slicing, 정규분포 난수)Python 2021. 5. 30. 21:13
데이터 처리 시 리스트 간의 다양한 연산이 필요하지만 파이썬 기본 리스트는 이러한 기능이 부족하며 연산 속도도 빠르지 않다. 넘파이는 파이썬에서 수치 데이터를 다루는 가장 기본적이고 강력한 패키지로써 pandas, scikit-learn, tensorflow등이 넘파이 위에서 동작한다. 넘파이는 ndarray를 사용하는데 이는 C 언어에 기반한 배열 구조로써 메모리를 적게 차지하며 속도가 빠르다. 또한 고급 연산자와 풍부한 함수를 제공한다. 1. 다차원 배열(ndarray)의 속성 # ndarray를 이용한 연산 import numpy as np a = np.array(range(1, 11)) b = np.array(range(10, 20)) print(a) print(b) print(a+b) print..