CKA lab 2 question 10

In the question I have to create a secret db-secret-wl05 with the values described in the question. I utilized the secret in web pod and created it. but still getting issue with curl http://cluster3-controlplane:31020

Checked with the solution in lab and all seems good but still getting the error that env values are not set.

Hi @Vigilante

It would have helped a lot if you had shared a screenshot covering your solution. That way, we would have been in a better position to point out any errors.

Can you please retry the lab, and if you face the same again, please do take a screenshot and share it with us.

Thanks!

Q: We have deployed a 2-tier web application on the cluster3 nodes in the canara-wl05 namespace. However, at the moment, the web app pod cannot establish a connection with the MySQL pod successfully.

You can check the status of the application from the terminal by running the curl command with the following syntax:

curl http://cluster3-controlplane:NODE-PORT

Solution by me: I have created the secret db-secret-wl05 with command below:

k create secret -n canara-wl05 generic db-secret-wl05 --from-literal=DB_Host=mysql-svc-wl05 --from-literal=DB_User=root --from-literal=DB_Password=password123

Entered the secret in pod webapp-svc-wl05 by adding these lines in spec:

envFrom:
- secretRef:
name: db-secret-wl05

After creating pod still getting error while running curl http://cluster3-controlplane:31020


 Environment Variables: DB_Host=mysql-svc-wl05; DB_Database=Not Set; DB_User=root; DB_Password=password123; 

From webapp-pod-wl05

1 Like

I did this ages ago… From memory no problems (unless it has changed).

I will try replaying the lab.