MySQL password management
Changing the MySQL password
Section titled “Changing the MySQL password”1. Update the password in MySQL
Section titled “1. Update the password in MySQL”Connect to MySQL and run the following commands:
ALTER USER 'metalsoft'@'%' IDENTIFIED BY 'New-password1';flush privileges;2. Update the Kubernetes secret
Section titled “2. Update the Kubernetes secret”Edit secrets.yaml with the new password and apply it:
---apiVersion: v1kind: Secretmetadata: name: bsi-mysql-creds namespace: demo-metalsoft labels: app.kubernetes.io/component: demo-metalsoft app.kubernetes.io/part-of: demo-metalsofttype: OpaquestringData: password: New-password13. Restart affected deployments
Section titled “3. Restart affected deployments”Restart the MySQL deployment and any other deployments in the namespace that use the bsi-mysql-creds secret:
cd manifests/grep bsi-mysql-creds * -l 2>/dev/null|grep deployment|sed 's/-deploy.*//g'|while read zdo kubectl -n demo-metalsoft rollout restart deployment $zdone