Update postgresql default password

There are two postgresql databases kfuse-configdb and orchestrator-postgresql that Kloudfuse installation uses and both are using the default password obtained from kfuse-pg-credentials secret.

If you wish to update the default password for postgresql, it can be updated with following steps

  1. Get the default password with following steps

kubectl -n kfuse get secret kfuse-pg-credentials -o yaml apiVersion: v1 data: postgres-password: <<default password base64 encoded>> postgresql-password: <<default password base64 encoded>> postgresql-postgres-password: <<default password base64 encoded>> postgresql-replication-password: <<default password base64 encoded>> kind: Secret metadata: . . .
  1. Decrypt the default password

echo -n <<default password base64 encoded>> | base64 -d # Ignore the end character %
  1. Login to kfuse-configdb and change the default postgres password

kubectl -n kfuse exec -it kfuse-configdb-0 -- bash I have no name!@kfuse-configdb-0:/$ psql -U postgres Password for user postgres: psql (14.11) Type "help" for help. postgres=# \password postgres Enter new password for user "postgres": Enter it again: postgres=# exit
  1. Login to orchestrator-postgresql and change the default postgres password

kubectl -n kfuse exec -it orchestrator-postgresql-0 -- bash I have no name!@orchestrator-postgresql-0:/$ psql -U postgres Password for user postgres: psql (14.11) Type "help" for help. postgres=# \password postgres Enter new password for user "postgres": Enter it again: postgres=# exit
  1. Base64 Encode the new password

echo -n "<<new password>>" | base64
  1. Edit the existing kfuse-pg-credentials secret and update with new base64 encoded password

kubectl -n kfuse edit secrets kfuse-pg-credentials
  1. Restart the dependent services to update with the new password

kubectl rollout restart statefulset kfuse-configdb logs-parser logs-query-service orchestrator-postgresql pinot-broker pinot-controller pinot-server-offline kubectl rollout restart deployment advance-functions-service beffe events-query-service ingester kfuse-grafana logs-transformer query-service trace-query-service trace-transformer

Related content