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

[cka]kodekloud-secrets

by mozi2 2022. 6. 16.
반응형

1.How many Secrets exist on the system? in the current(default) namespace

# k get secrets

A) 1

 

2. How many secrets are defined in the default-token secret?

 : 위의 그림과 동일 

 

 A) 3 

 

3. What is the type of the default-token secret?

 : 위의 그림과 동일 

 

 A) Kubernetes.io/service-account-token

 

4. Which of the following is not a secret data defined in default-token secret?

 : default-token 중 정의되지 않은 항목 즉 없는 항목

 # k describe secret default-token-p47rr 

A) type

 

5.We are going to deploy an application with the below architecture

We have already deployed the required pods and services. Check out the pods and services created. Check out the web application using the Webapp MySQL link above your terminal, next to the Quiz Portal Link.

A) ok

 

6.The reason the application is failed is because we have not created the secrets yet. Create a new secret named db-secret with the data given below.

You may follow any one of the methods discussed in lecture to create the secret.

# k create secret generic db-secret --from-literal=DB_Host=sql01 --from-literal=DB_User=root --from-literal=DB_Password=password123

 
7. Configure webapp-pod to load environment variables from the newly created secret.
    Delete and recreate the pod if required.
# k edit pod webapp-pod
# k replace --force -f /tmp/kubectl-edit-214771587.yaml

8. View the web application to verify it can successfully connect to the database

A) ok

728x90
반응형