Change password

Changing the UI password

You can use the command below to change the password:

kubectl create secret generic -n stackgres stackgres-restapi  --dry-run=client -o json \
  --from-literal=k8sUsername="$NEW_USER" \
  --from-literal=password="$(echo -n "${NEW_USER}${NEW_PASSWORD}"| sha256sum | awk '{ print $1 }' )" > password.patch

kubectl patch secret -n stackgres stackgres-restapi -p "$(cat password.patch)" && rm password.patch

Remember to remove the generated password hint from the secret to avoid security flaws:

kubectl patch secrets --namespace stackgres stackgres-restapi --type json -p '[{"op":"remove","path":"/data/clearPassword"}]'

To clean up the resources created by the demo just run:

kubectl delete --ignore-not-found -f