MLOps/Doker & Kubernetes

Udemy CKA 강의 정리 102: Solution - Environment Variables (optional)

공부하는 무니 2023. 1. 12. 05:07
반응형

해당 내용은 Udemy의 Certified Kubernetes Administrator (CKA) with Practice Tests 강의를 공부한 내용입니다. 내용을 그대로 번역하기보다는, 제가 이해하기 쉬운 대로 수정한 부분들이 있습니다.

⚠️ 영어 독해가 많이 부족합니다. 틀린 내용이 있으면 알려주시면 감사하겠습니다.


(보충필요)

Q1. How many PODs exist on the system?

$ kubectl get pods

Q2. What is the environment variable name set on the container in the pod?

$ kubectl describe pod

Q3. What is the value set on the environment variable APP_COLOR on the container in the pod?

$ kubectl describe pod

Q4. View the web application UI by clicking on the Webapp Color Tab above your terminal.

 

Q5. Update the environment variable on the POD to display a green background

$ kubectl get pods webapp-color -o yaml > green.yaml
$ kubectl delete pods webapp-color
Update APP_COLOR to green
$ kubectl create -f green.yaml

Q6. View the changes to the web application UI by clicking on the Webapp Color Tab above your terminal.

 

Q7. How many ConfigMaps exists in the default namespace?

$ kubectl get configmaps

Q8. Identify the database host from the config map db-config

$ kubectl describe configmaps

Q9. Create a new ConfigMap for the webapp-color POD. Use the spec given below.

$ kubectl create configmap webapp-config-map --from-literal=APP_COLOR=darkblue

Q10. Update the environment variable on the POD to use the newly created ConfigMap

$ kubectl get pods webapp-color -o yaml > new-webapp.yaml
$ kubectl delete pods webapp-color
 Update pod definition file, under spec.containers section update the below.
- envFrom:
  - configMapRef:
     name: webapp-config-map
$ kubectl create -f new-webapp.yaml

Q11. View the changes to the web application UI by clicking on the Webapp Color Tab above your terminal.

반응형