- Clone the repo.Ex:
git clone https://github.com/OpsMx/helm-cnoe.git
cd helm-cnoe/charts/keycloak
- Edit values.yaml by passing host keycloak(Keycloak ingress) and set createIngress to true.
- Run the command
helm install kc . -f values.yaml -n keycloak --timeout=10m --create-namespace
- Once keycloak is up and running, Login to the Keycloak UI.Click on Admin console.Username is cnoe-admin and get the password by decoding KEYCLOAK_ADMIN_PASSWORD from keycloak-config secret. Ex:
kubectl -n keycloak get secret keycloak-config -o jsonpath='{.data.KEYCLOAK_ADMIN_PASSWORD}' | base64 -d; echo
- Now apply keycloak-script cm in the keycloak namespace. Ex:
kubectl apply -f keycloak-script.yml -n keycloak
- Edit the keycloak-payload.yml and pass the correct backstage host name in redirectUri's parameter in lineno:85.
- Apply keycloak-payload cm in the keycloak namespace. Ex:
kubectl apply -f keycloak-payload.yml -n keycloak
- Run the keycloak-job in the keycloak namespace. Ex:
kubectl apply -f kc-job.yml -n keycloak
- Once the job is completed, Refresh the Keycloak UI and you will be seeing cnoe realm created, Groups created, Users 1 and 2 created. Also in clients backstage will be created.
- Get the Keycloak client secret from the keycloak UI.For this select cnoe realm from the top-left dropdown then click on clients from the left-side menu and click on backtage client and click credentials tab then copy the client secret by clicking on eye icon.Save it and later add it to the backstage-env-vars in backstage installation.
- Create a namespace. Ex: kubectl create ns backstage
cd ../..
cd backstage
- Edit values.yaml by passing host backtage(backstage ingress) and set createIngress to true. Pass the host-name that you entered in keycloak-payload.yml.
- Run the command
helm install bs . -f values.yaml -n backstage --timeout=10m
- Create backstage-env-vars secret. Ex:
kubectl create secret generic backstage-env-vars --from-literal=ARGO_CD_URL=https://<ARGO_CD_URL> --from-literal=ARGO_WORKFLOWS_URL=https://<ARGO_WF_URL> --from-literal=ARGOCD_AUTH_TOKEN=<ARGO_CD_TOKEN> --from-literal=BACKSTAGE_FRONTEND_URL=https://<BACKSTAGE_URL> --from-literal=KEYCLOAK_CLIENT_SECRET=<CLIENT_SECRET> --from-literal=KEYCLOAK_NAME_METADATA=https://<KEYCLOAK.HOST.NAME>/realms/cnoe/.well-known/openid-configuration --from-literal=POSTGRES_HOST=postgresql --from-literal=POSTGRES_PASSWORD=<psql_password> --from-literal=POSTGRES_PORT=5432 --from-literal=POSTGRES_USER=backstage -n backstage
. Get the postgres details from postgresql-config secret and decode. - Restart backstage deployment if necessary. Ex:
kubectl rollout-restart deploy/backstage -n backstage
- Once the pod is up and running, Login to the Backstage UI.
- Click on SignIn button. Username is user1 and get the password by decoding user1-password from keycloak-user-config secret Ex:
kubectl -n keycloak get secret keycloak-user-config -o jsonpath='{.data.user1-password}' | base64 -d; echo