STUDY

    [kodekloud] 02 Scheduling : Labels and Selectors 풀이

    Q1. We have deployed a number of PODs. They are labelled with tier, env and bu. How many PODs exist in the dev environment (env)? k get pods --selector env=dev # env가 dev인 파드 불러오기 k get pods --selector env=dev --no-headers | wc -l #개수 세기 Q2. How many PODs are in the finance business unit (bu)? k get pods --selector bu=finance --no-headers | wc -l '''--no-headers를 하지 않으면 헤더까지 카운팅 되기 때문에 제외해야함''' ..

    [kodekloud] 02 Scheduling : Manual Scheduling 풀이

    Q1. A pod definition file nginx.yaml is given. Create a pod using the file. k create -f nginx.yaml Q2. What is the status of the created POD? Q3. Why is the POD in a pending state? 위 내용을 봤을 때 스케쥴이 없어서 그러하다.. Q4. Manually schedule the pod on node01 controlplane ~ ➜ ls nginx.yaml sample.yaml controlplane ~ ➜ vi nginx.yaml controlplane ~ ✖ k get pods NAME READY STATUS RESTARTS AGE nginx 0/1 Pending..

    [kodekloud] 01 Core Concepts : Imperative-Commands 풀이

    Q1. Deploy a pod named nginx-pod using the nginx:alpine image. k run nginx-pod --image=nginx:alpine Q2. Deploy a redis pod using the redis:alpine image with the labels set to tier=db. k run redis --image=redis:alpine --labels=tier=db Q3. Create a service redis-service to expose the redis application within the cluster on port 6379. 명령어 예시 공식문서 kubectl expose (-f FILENAME | TYPE NAME) [--port=por..

    [kodekloud] 01 Core Concepts : Service 풀이

    Q1. How many Services exist on the system? alias k=kubectl; k get services Q2. What is the type of the default kubernetes service? 위에서 k get services 명령어를 통해 type이 clusterIP임을 확인했다. Q3. What is the targetPort configured on the kubernetes service? k describe services # 서비스가 1개만 있기 때문에 위의 명령어로도 가능하지만 정확한 서비스 명과 조회하려면 k describe svc kubernetes Q4. How many labels are configured on the kubernetes se..