I am trying to run keycloak on kubernetes using Postgres as a database. The files I am referring to are on github.com.
I used kompose to generate the kubernetes yaml files, as a staring point, using the files that jboss published here.
I first start postgres with the command
./start-postgres.shThen I try to start keycloak:
kubectl create -f keycloak-deployment.yamlThe keycloak pod stops because it cannot connect to the database with the error:
10:00:40,652 SEVERE [org.postgresql.Driver] (ServerService Thread Pool -- 58) Error in url: jdbc:postgresql://172.17.0.4:tcp://10.101.187.192:5432/keycloakThe full log can be found on github. This is also the place to look at the yaml files that I use to create the deployment and the services.
Appreciate your help and suggestions.
Cheers
After some experimenting I found out that using the name postgres in the keycloak-deployment.yaml file
- env:
- name: DB_ADDR
value: postgresmesses things up and results in a strange expansion. After replacing this part of the yaml file with:
- env:
- name: DB_ADDR
value: postgres-keycloakmakes it work fine. This also requires changing the postgres-service.yaml file. The new versions of the files are in github.