분류 전체보기 45

Deployment

ReplicaSet을 컨트롤해서 파드수를 조절 Rolling update & Rolling back (Rolling update : 서비스 중단없이 버전을 업데이트) 롤링업데이트를 위해 만들어진 api리소스가 deployment이다. Deployment definition Deployment example kubectl get deploy, rs, pod =>현재 동작중인 deploy, replicaSet, pod를 출력 Deployment rolling update & rolling back(1) *Rolling Update kubectl set image deployment = *RollBack kubectl rollout history deployment =>의 버전기록을 표시 kubectl rol..

Kubernetes 2022.01.10

ReplicaSet

ReplicationController와 같은 역할을 하는 컨트롤러 ReplicationController보다 풍부한 selector *matchExressions - In : 키와 밸류를 지정하여 key, value가 일치하는 파드만 연결 - NotIn : key는 일치하고 value는 일치하지 않는 파드에 연결 - Exists : key에 맞는 label의 파드를 연결 - DoesNotExist : key와 다른 label의 파드를 연결 ReplicaSet definition ReplicaSet의 selector ReplicaSet example kubectl delete rs rs-nginx --cascade=false =>pod는 삭제되지않고 컨트롤러만 삭제

Kubernetes 2022.01.10

Replication Controller

*컨트롤러 종류 *Replication Controller 요구하는 pod의 개수를 보장하며 파드집합의 실행을 항상 안정적으로 유지하는 것을 목표 ReplicationController-definition *Replication Controller 실습예제 kubectl create -f rc-nginx.yaml kubectl get replicationcontrollers (=kubectl get rc) kubectl describe rc rc-nginx kubectl run redis --image=redis --labels=app=webui --dry-run > redis.yaml kubectl get pod --show-labels kubectl create -f redis.yaml kubectl..

Kubernetes 2022.01.10

H/W resource 관리

*Resource Requests -파드를 실행하기위한 최소 리소스양 요청 *Resource Limits -파드가 사용할 수 있는 최대 리소스양을 제한 -Memory limit을 초과해서 사용되는 파드는 종료(OOM Kill)되며 다시 스케줄링된다. *resource, env관련 실습 [solution] apiVersion: v1 kind: Pod metadata: name: myweb spec: containers: - image: nginx:1.14 name: myweb env: - name: DB value: mydb resources: requests: memory: 500Mi cpu: 200m limits: memory: 1Gi cpu: 1

Kubernetes 2022.01.07

init container, static pod

*init container -앱 컨테이너 실행 전에 미리 동작시킬 컨테이너 -본 컨테이너가 실행되기 전에 사전작업이 필요할 경우 사용 -Init container가 실행된 후에 앱 컨테이너를 실행 *static pod API서버 없이 특정노드에 있는 kubelet데몬에 의해 직접관리 /etc/kubernetes/manifests/ 디렉토리에 k8s yaml파일을 저장시 pod가 바로 생성됨. ((안될 시 var/lib/kubelet/config.yaml파일의 staticPodPath속성값 확인)) static pod 삭제하고싶을때는 path의 yaml파일을 삭제해야됨.

카테고리 없음 2022.01.07