helm install bitnami/mysql --generate-name Tip:
Watch the deployment status using the command: kubectl get pods -w --namespace default
Services:
echo Primary: mysql-1698033874.default.svc.cluster.local:3306
Execute the following to get the administrator credentials:
echo Username: root MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default mysql-1698033874 -o jsonpath="{.data.mysql-root-password}" | base64 -d)
To connect to your database:
-
Run a pod that you can use as a client:
kubectl run mysql-1698033874-client --rm --tty -i --restart='Never' --image docker.io/bitnami/mysql:8.0.34-debian-11-r75 --namespace default --env MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD --command -- bash
-
To connect to primary service (read/write):
mysql -h mysql-1698033874.default.svc.cluster.local -uroot -p"$MYSQL_ROOT_PASSWORD"