Change the otomi-admin password
This how to provides step-by-step instructions to reset the otomi-admin password.
Prerequisites:
-
Access to the Keycloak admin console.
-
Docker installed and configured.
-
SOPS set up with Age encryption (default in LKE).
Steps:
Step 1: Generate a New Password
# Generate a random 16-character alphanumeric password
head /dev/urandom | LC_ALL=C tr -dc A-Za-z0-9 | head -c 16
# Example output: FPpLvZyAdAmuzc3N
Step 2: Update the Password in Keycloak
-
Log in to Keycloak as the
otomi-adminuser. -
Go to Users in the left-hand sidebar and find the
otomi-adminuser. -
Navigate to the Credentials tab.
-
Change the password to the one you generated.
-
Save changes (set Temporary to Disabled).
Don’t make any other changes during this operation.
Step 3: Update the Password in Otomi’s Values Repository
-
Clone the Otomi values repository if you haven't already:
git clone https://gitea.<cluster.domainSuffix>/otomi/values.git ~/workspace/values-folder -
Export
ENV_DIRto point to your values directory:export ENV_DIR=~/workspace/values-folder -
Create the
.secretsfile:- Retrieve the SOPS_AGE_KEY from secret:
kubectl get secret otomi-sops-secrets -n otomi-pipelines -o jsonpath='{.data.SOPS_AGE_KEY}' | base64 -dExample output:
AGE-SECRET-KEY-1KTYK6RVLN5TAPE7VF6FQQSKZ9HWWCDSKUGXXNUQDWZ7XXT5YK5LSF3UTKQ- Create the
.secretsfile in the root of the values directory with the SOPS_AGE_KEY secret. The file contents should look like this:
SOPS_AGE_KEY=<PASTE_HERE_THE_SOPS_AGE_KEY> -
Decrypt the secrets in your values repository by running:
docker run -it -v $ENV_DIR:/home/app/stack/env linode/apl-core binzx/otomi decrypt -
Open the
env/secrets.settings.yaml.decfile. -
Update the
otomi-adminpassword:otomi: adminPassword: <YOUR_NEW_PASSWORD>
Step 4: Re-encrypt the Secrets
-
Encrypt the
.decfile to secure the updated password:docker run -it -v $ENV_DIR:/home/app/stack/env linode/apl-core binzx/otomi encrypt -
Commit and push your changes to the values repository:
cd ~/workspace/values-folder git add . git commit -m "Update otomi-admin password" git push
Step 5: Apply the Changes
-
Allow the Tekton pipeline to run and verify it passes.
-
After the pipeline completes, restart the
otomi-apiandapl-keycloak-operatorto ensure it applies the new credentials.kubectl rollout restart deployment -n otomi otomi-api kubectl rollout restart deployment -n apl-keycloak-operator apl-keycloak-operator -
Verify that the Otomi platform is working as expected with the new credentials.
This completes the password reset process for otomi-admin.
Updated 5 months ago
