Follow the next steps to deploy Mysql in kubernetes using configmap, secrets, pv, pvc and db_deployment ymls.
$ kubectl apply -f <config-manifest-yml>
$ kubectl apply -f 1_weshopify-db-configmap.yml
$ kubectl apply -f <secret-manifest-yml>
$ kubectl apply -f 2_weshopify-db-secret.yml
$ kubectl apply -f <pv-manifest-yml>
$ kubectl apply -f 3_weshopify-db-pv.yml
$ kubectl apply -f <pvc-manifest-yml>
$ kubectl apply -f 4_weshopify-db-pvc.yml
$ kubectl apply -f <database-manifest-yml>
$ kubectl apply -f 5_weshopify-db-deployment.yml
$ kubectl get pods
$ kubectl get svc
$ kubectl get deployment
$ kubectl get secrets
$ kubectl get pv
$ kubectl get pvc
With above steps, the databse deployment was completed. Now we want to connect to the Mysql datasbase using the pod.
$ kubectl get pods
$ kubectl exec -it <pod-name-above-command> bash
$ mysql -h localhost -u root -p
Note: It will ask for password, enter password as root.
$ show databases;
$ use weshopify-app;
$ create table emp(emp_id int, emp_name varchar(50));
$ show tables;
$ insert into emp values(101, 'Raju');
$ insert into emp values(102, 'Rani');
$ select * from emp;
$ exit
$ exit