Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.

Repository files navigation

keycloak

Keycloak microservice for identity and access management.

Important URLs

Setup

Load Keycloak seed file

Copy cinepik-realm.json to the data directory for local deployment or copy it to the k8s config map for cloud deployment.

kubectl create configmap cinepik-realm --from-file=cinepik-realm.json=data/cinepik-realm.json

Export Keycloak seed file (optional)

If you've changed something you need to export the seed file again and copy it to the host.

 /opt/keycloak/bin/kc.sh export --dir /tmp/keycloak/data/import --realm cinepik --users realm_file

Kubernetes Deployment

Setup configs

Create config map from cinepik-realm

kubectl create configmap cinepik-realm --from-file=cinepik-realm.json=data/cinepik-realm.json

Create config map for keycloak

kubectl create configmap keycloak-config --from-literal=KEYCLOAK_BASE_URL="http://cinepik-keycloak" --from-literal=KEYCLOAK_CLIENT_ID="nest-auth" --from-literal=KEYCLOAK_PORT=8080 --from-literal=KEYCLOAK_REALM="cinepik"

Create secret for keycloak

kubectl create secret generic keycloak-credentials --from-literal=KEYCLOAK_ADMIN="admin" --from-literal=KEYCLOAK_ADMIN_PASSWORD="<REPLACE_ME>" --from-literal=KEYCLOAK_CLIENT_SECRET="<REPLACE_ME>" --from-literal=KEYCLOAK_REALM_RSA_PUBLIC_KEY="<REPLACE_ME>"

Apply changes

Apply deployment

kubectl apply -f k8s/cinepik-keycloak.yml

Apply service

kubectl apply -f k8s/cinepik-keycloak-svc.yml

Other useful commands

kubectl get pods
kubectl delete deployment cinepik-keycloak-deployment
kubectl delete configmap <configmap name>
kubectl rollout restart deployment/cinepik-keycloak-deployment
kubectl logs <pod-id>
kubectl describe secret <secret-name>
kubectl get secret <secret-name>
kubectl get service
kubectl describe pods

About

Keycloak microservice for identity and access management.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages