Docker image URL:
kubectl apply -f __db_volume.yaml && kubectl apply -f __configMaps.yaml && kubectl apply -f __secrets.yaml && kubectl apply -f __db_deployment.yaml && kubectl apply -f __deployment.yaml
Note: (In case of any issues, we can delete all containers, services, configMaps etc.. by runnine below command and start afresh from step 1)
kubectl delete -f __deployment.yaml && kubectl delete -f __db_deployment.yaml && kubectl delete -f __secrets.yaml&& kubectl delete -f __configMaps.yaml && kubectl delete -f __db_volume.yaml
docker cp db.sql [mysql_container_id]:/db.sql (Copy the database file to db container)
docker exec -it [mysql_container_id] /bin/bash (exec into db container)
mysql -u root -p (login into mysql)
ENTER PASSWORD as "password"
source db.sql (Run db.sql file to import database)
Note: We can find mysql_container_id from "docker ps" command
Run the application on http://localhost:5000 if you are running on local or http://[IP_ADDR]:5000 where IP_ADDR is IP address where your node-js service is exposed.
If everything works well, you will see something like this:
In case of errors, you might see these screens:
When Database server not configured properly |
When Database not setup properly |
When no user record exists |