Step-04: Connect to RDS Database using kubectl and create usermgmt schema/db¶
# Template
kubectl run -it --rm --image=mysql:5.7.22 --restart=Never mysql-client -- mysql -h <AZURE-MYSQ-DB-HOSTNAME> -u <USER_NAME> -p<PASSWORD>
# Replace Host Name of Azure MySQL Database and Username and Password
kubectl run -it --rm --image=mysql:5.7.22 --restart=Never mysql-client -- mysql -h akswebappdb.mysql.database.azure.com -u dbadmin@akswebappdb -pRedhat1449
mysql> show schemas;
mysql> create database webappdb;
mysql> show schemas;
mysql> exit
Step-05: In User Management WebApp deployment file change username from root to dbadmin@akswebappdb¶
# Deploy all Manifests
kubectl apply -f kube-manifests/
# List Pods
kubectl get pods
# Stream pod logs to verify DB Connection is successful from SpringBoot Application
kubectl logs -f <pod-name>