Keycloak has utility kcadm.sh which can be used for managing it from cli. It doesn't work in our deployment, because it needs to create file in /opt/keycloak/.keycloak/
$ /opt/keycloak/bin/kcadm.sh config credentials --server http://localhost:8080/kc --realm master --user admin
Logging into http://localhost:8080/kc as user admin of realm master
Enter password: *****
Failed to create config file: /opt/keycloak/.keycloak/kcadm.config
Solution is to add ephemeral directory on this path. After adding it kcadm.sh works:
$ /opt/keycloak/bin/kcadm.sh config credentials --server http://localhost:8080/kc --realm master --user admin
Logging into http://localhost:8080/kc as user admin of realm master
Enter password: *****
$ /opt/keycloak/bin/kcadm.sh create users -s username=test -s email=test@example.com -s enabled=true -s emailVerified=true -r CZERTAINLY
Keycloak has utility
kcadm.sh
which can be used for managing it from cli. It doesn't work in our deployment, because it needs to create file in/opt/keycloak/.keycloak/
Solution is to add ephemeral directory on this path. After adding it
kcadm.sh
works: