Hi,
Since keycloak 17 the “/auth” context has been removed. According to the migration guide (https://www.keycloak.org/migration/migrating-to-quarkus) a simple setting of --http-relative-path should do the trick.
However when i run my container using that setting (through the environment variable) i get the warning:
quarkus.http.root-path is set to ‘/‘ but it is build time fixed to ‘/auth’. Did you change the property quarkus.http.root-path after building the application?
And my k8s livenessProbes fails. I tried setting -Dquarkus.http.root-path=/auth in the JAVA_OPTS_APPEND env variable, but to no avail.
I am using the quay.io/keycloak/keycloak:18.0.1 image on kubernetes. The following is the full deployment yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: keycloak-next
namespace: sso
spec:
replicas: 1
selector:
matchLabels:
app: keycloak-next
stack: java
type: canary
template:
metadata:
labels:
app: keycloak-next
stack: java
type: canary
spec:
containers:
- name: keycloak
image: quay.io/keycloak/keycloak:18.0.1
args:
- "start"
env:
- name: JAVA_OPTS_APPEND
value: "-Dquarkus.http.root-path=/auth"
- name: KC_HTTP_RELATIVE_PATH
value: "/auth"
- name: KC_PROXY
value: edge
- name: KC_HTTP_ENABLED
value: "true"
- name: KC_HOSTNAME
value: toto.foobar.com
- name: KEYCLOAK_LOGLEVEL
value: WARN
- name: PROXY_ADDRESS_FORWARDING
value: "true"
- name: KEYCLOAK_USER
value: admin
- name: KEYCLOAK_PASSWORD
valueFrom:
secretKeyRef:
key: keycloak-password
name: keycloak
- name: JDBC_PARAMS
value: useSSL=false
- name: DB_ADDR
value: postgres-keycloak-headless
- name: DB_VENDOR
value: postgres
- name: DB_DATABASE
value: keycloak
- name: DB_USER
value: postgres
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
key: postgres-password
name: keycloak
ports:
- containerPort: 8080
name: http
livenessProbe:
failureThreshold: 3
httpGet:
path: /auth/
port: http
initialDelaySeconds: 300
periodSeconds: 1
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
failureThreshold: 3
httpGet:
path: /auth/realms/master
port: http
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app: postgres-keycloak
topologyKey: kubernetes.io/hostname
weight: 1