< Previous Challenge - Home - Next Challenge >
Reconfigure the application to use the appropriate connection string that uses Azure DB and validate that the application is working. You have to do this by redeploying the Pizzeria container application(s).
You will reconfigure the application to use a connection string that points to the Azure DB for PostgreSQL/MySQL. You will need to update the ContosoPizza/values-mysql.yaml
, ContosoPizza/values-postgresql.yaml
and/or ContosoPizza/values-oracle.yaml
values file(s) with the updated values for dataSourceURL, dataSourceUser and dataSourcePassword using the appropriate values for Azure DB for PostgreSQL/MySQL:
appConfig:
dataSourceURL: "jdbc url goes here" # your JDBC connection string goes here
dataSourceUser: "user name goes here" # your database username goes here
dataSourcePassword: "Password goes here!" # your database password goes here
Once you make your changes, you will need to run helm upgrade command again to see them in the Pizzeria web application:
helm upgrade --install mysql-contosopizza ./ContosoPizza -f ./ContosoPizza/values.yaml -f ./ContosoPizza/values-mysql.yaml
kubectl -n contosoappmysql rollout restart deployment contosopizza
Wait for a minute or two until the status field for the kubectl command below is “Running” and “READY” state is “1/1”.
Status field changes from “Terminating” to “ContainerCreating” and then to “Running”.
kubectl -n contosoappmysql get pods
helm upgrade --install postgres-contosopizza ./ContosoPizza -f ./ContosoPizza/values.yaml -f ./ContosoPizza/values-postgresql.yaml
kubectl -n contosoapppostgres rollout restart deployment contosopizza
Wait for a minute or two until the status field for the command of kubectl is “Running” and “READY” state is “1/1”.
Status field changes from “Terminating” to “ContainerCreating” and then to “Running”.
kubectl -n contosoapppostgres get pods
You will need to change the database type in the values-oracle.yaml
file from “oracle” to “postgres” before you run these steps.
helm upgrade --install oracle-contosopizza ./ContosoPizza -f ./ContosoPizza/values.yaml -f ./ContosoPizza/values-oracle.yaml
kubectl -n contosoapporacle rollout restart deployment contosopizza
Wait for a minute or two until the status field for the command of kubectl is “Running” and “READY” state is “1/1”.
Status field changes from “Terminating” to “ContainerCreating” and then to “Running”.
kubectl -n contosoapporacle get pods
kubectl -n contosoapporacle get pods
If you see a CrashLoopBackoff, you can then do this to get more information:
kubectl -n contosoapporacle describe pod <name of the pod>
and also
kubectl -n contosoapporacle logs <name of the pod>
You may find it helpful to send the output of the above logs command to a file so you can grep it or use an editor to search it. Your problem may be identified by “Error” or “Exception”.