목록Infra/Kubernetes (22)
Study Memory Work
Node Taint & Pod Toleration taint : 어플리케이션 pod를 실행시키게 되면 node의 taint와 매칭이되는 pod toleration이 없는 pod는 taint 되어있는 node에 배치될 수 없다. node의 tain와 동일한 value를 torleration의 value로 가진 pod는 해당 노드에도 scheduling 될 수 있다. node taint, pod toleration worker node에 tain가 설정된 경우 동일 값의 toleration이 있는 Pod만 배치된다. toleration이 있는 Pod는 동일한 taint가 있는 node를 포함하여 모든 node에 배치된다. effect 필드 종류 : NoSchedule : toleration이 맞지 않으면 배..

노드관리 pod가 실행되는 노드인 worker node를 대상으로 특정 worker노드에 scheduling을 허용하거나 금지하고싶을 때, worker node내 pod들을 비워서 cluster member에서 제외하고 싶을 때 등등 Node 스케줄링 중단 및 허용 컨테이너를 포함한 Pod는 node에서 실행됨 node는 Control-plane에 의해 관리 특정node의스케줄링중단(cordon)및 허용(uncordon) kubectl cordon : 특정 worker node 에서 scheduling에 대해 disabled상태로 만들고 kubectl uncordon : abled상태로 만든다. Node 비우기(drain) 특정 node 에서 실행중인 pod 비우기(drain) 및 제거(delete) (..

Deployment 컨테이너 기반으로 애플리케이션을 동작시킬 때 가장 많이 사용하는 API (배포) Pod를 직접 실행하지 않고 Deployment를 이용하여 컨테이너를 실행하는가? ReplicaSet 컨트롤러를 통해 replica 수 보장 및 scaling in/out 가능 (Pod직접실행 시, watch해주는 controller가 없어서 오류가 나면 재실행되지 않음.) Rolling update 또는 Roll back 지원 동작과정 : deployment 명령을 내리면 Deployment 가 생성, ReplicaSet controller 생성 controller 가 pod 실행/보장 deployment yaml 파일 구조 apiVersion: apps/v1 kind: Deployment metadat..

Pod Static Pod multi-container Pod sidecat-container Pod Pod 어플리케이션 컨테이너를 실행할 때 Pod를 통해서 실행시킬 수 있다. Pod란 컨테이너를 표현하는 k8s API의 최소 단위 Pod에는 하나 또는 여러 개의 컨테이너가 포함될 수 있음 동작방식 : master 컴포넌트에 Pod 실행 명령을 내리면 Api 서버가 명령을 받아 인증 Scheduler가 어느 node에서 실행시킬 지 결정 한 후 해당 node에 명령을 전달하여 Pod를 동작시킨다. Pod 생성 방법 1. CLI 명령어로 Pod 생성하기 $ kubectl run {podName} --image=nginx:1.14 --port=80 # nginx:1.14버전의 컨테이너를 실행해라. $ ku..

API 인증 종류 역할기반 인증 (rbac) attribute기반 인증 (abac) API 인증이란(rbac)? API서버에 접근하기 위해서는 인증 작업 필요 Role-based access control(RBAC.역할 기반 액세스 제어) 사용자의 역할에 따라 리소스에 대한 접근 권한를 가짐 User 인증: 클러스터 외부에서 쿠버네티스를 조작하는 사용자 인증 Service Account 인증: Pod가 쿠버네티스 API를 다룰 때 사용하는 계정 1.인증 / 2.권한 / 3.요청범위 확인 1-1. 인증 : User 인증 아래 명령을 실행한다고 했을 때, $ kubectl get pods username과 인증서와 함께 API server에 요청하게 된다. (.kube/config 파일에 user정보와 인증..
worker node 오류 메세지 The connection to the server localhost:8080 was refused - did you specify the right host or port? 솔루션 $ mkdir -p $HOME/.kube $ sudo scp root@{master node name}:/etc/kubernetes/admin.conf $HOME/.kube/config