- Take me to Practice Test
Solutions for pracice test - Secrets
-
Run the command 'kubectl get secrets' and count the number of pods.
Details
``` $ kubectl get secrets ``` -
Run the command 'kubectl get secrets' and look at the DATA field
Details
``` $ kubectl get secrets ``` -
Run the command 'kubectl describe secret'
Details
``` $ kubectl describe secret ``` -
Run the command 'kubectl describe secret'
Details
``` $ kubectl describe secret ``` -
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.
-
Run command kubectl create secret generic db-secret --from-literal=DB_Host=sql01 --from-literal=DBUser=root --from-literal=DB_Password=password123
Details
``` $ kubectl create secret generic db-secret --from-literal=DB_Host=sql01 --from-literal=DB_User=root --from-literal=DB_Password=password123 ``` -
Check Answer at /var/answers/answer-webapp.yaml
Details
``` $ kubectl get pod webapp-pod -o yaml > web.yaml $ kubectl delete pod webapp-pod ```Update web.yaml with secret section
envFrom:
- secretRef: name: db-secret
Details
``` $ kubectl create -f web.yaml ``` -
View the web application to verify it can successfully connect to the database