cancel
Showing results for 
Search instead for 
Did you mean: 
jazz-nz
Cadet
Cadet
  • 224 Views

DO288- Questions about Lab:Deploying Simple Applications

Hi,

A few questions about DO288- Lab:Deploying Simple Applications

I created DB in web console, however, when I created the nodejs application, how can I find out the missing environment variable is called DB_PASSWORD ?

Which steps and cmds I need to run in order to find it?

Why do no other environment variables are needed in this case? Like DB_USERNAME and DB_NAME?

What will be the solution in this case by using "oc set env"?

Thanks.

Parameter Value

Database Service Namepostgresql
PostgreSQL Connection Usernamedeveloper
PostgreSQL Connection Passwordtest
PostgreSQL Database Nametodo_list
Application Nametodo-list
Application Imageregistry.ocp4.example.com:8443/redhattraining/openshift-dev-deploy-review-todo-list
Labels (1)
3 Replies
Chetan_Tiwary_
Community Manager
Community Manager
  • 176 Views

@jazz-nz you can check env variables using oc describe deployment command. You might find it in oc logs if you did not set those env variables. 

Since this exercise uses templates , it must have created those variables using the data in the table provided. 

This error : Error: could not connect to the database:error: password authentication failed for user "developer" suggests that the password env variable was not correctly set. 

you can use oc set env deployment and then oc rollout to set that env variable.

0 Kudos
jazz-nz
Cadet
Cadet
  • 103 Views

Hi Chetan,

When todo-list pod failed at the begining, I used "oc describe deploy todo-list" to check, since no env was setting, so ENV only showed <none>.

If I run "oc describe po postgresql-1-xxxx" and I could see the below env: 

jazznz_0-1762052949668.png

However, both can not help me to figure out why DB_PASSWORD is the right env's name I need to set to fix the password issue, why not be POSGRESQL_PASSWORD? 

Can you explain step by step?

Thanks.

 

0 Kudos
Join the discussion
You must log in to join this conversation.