본문 바로가기
cloud/k8s(문제풀이)

[cka]kodekloud-Deployments

by mozi2 2022. 6. 7.
반응형

이번에는 Deployments 관련된 예제를 풀어보도록 하겠습니다. 

 

1. How many PODs exist on the system?

# k get pods

 

 A) 0

 

2. How many ReplicaSets exist on the system?

# k get rs

 

 A) 0

 

3.How many Deployments exist on the system?

# k get deployments.apps 

 : deployments 의 약어는 ds

 

 A) 0

 

4. How many Deployments exist on the system now?

# k get deployments.apps 

5. How many ReplicaSets exist on the system now?

# k get rs

A) 1

 

6.How many PODs exist on the system now?

# k get pods

A) 4

 

7.Out of all the existing PODs, how many are ready?

: 위의 그림을 참조

 

 A) 0

 

8.What is the image used to create the pods in the new deployment?

# k describe pods frontend-deployment-7fd8cdb696-9sjhl 

A) busybox888

 

9.Why do you think the deployment is not ready?

# k describe pods frontend-deployment-7fd8cdb696-9sjhl  

A) The image BUSYBOX888 doesn't exist.

 

10.Create a new Deployment using the deployment-definition-1.yaml file located at /root/.

     There is an issue with the file, so try to fix it.

#  vi deployment-definition-1.yaml 

#  k apply -f deployment-definition-1.yaml 

# k get deployments.apps

11.Create a new Deployment with the below attributes using your own deployment definition file.

Name: httpd-frontend;
Replicas: 3;
Image: httpd:2.4-alpine

 

# vi test.yaml

# k apply -f test.yaml

# k get deployments.apps

https://kubernetes.io/docs/concepts/workloads/controllers/deployment/

 

Deployments

A Deployment provides declarative updates for Pods and ReplicaSets. You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new Rep

kubernetes.io

 

 : yaml 파일이 필요할때는 docs를 활용해서 만들어보자

 : 실 시험에서도 docs를 활용하는 문제가 많으니 좋은 템플릿을 찾아서 필요한 부분만 수정해 사용하자 

 

728x90
반응형

'cloud > k8s(문제풀이)' 카테고리의 다른 글

[cka]kodekloud-services  (0) 2022.06.07
[cka] kodekloud-namespaces  (0) 2022.06.07
[cka]kodekloud-replicasets  (0) 2022.06.07
[cka]kodekloud-pods  (0) 2022.06.07
[cka]kodekloud -시작하기에 앞서...  (0) 2022.06.07