Keycloak crashes when trying to start up in a Kubernetes Pod using helm Keycloak crashes when trying to start up in a Kubernetes Pod using helm kubernetes kubernetes

Keycloak crashes when trying to start up in a Kubernetes Pod using helm


Not sure which helm chart are you using.

i have used this : https://github.com/codecentric/helm-charts/tree/master/charts/keycloak#database-setup helm chart and by default it create the database setup however if you want to use the MySQL you can update your values.yaml

in values.yaml you can configure the Postgres option, if true it will get auto-installed or if already running a database you can simply update the environment vars.

postgresql:  # Disable PostgreSQL dependency  enabled: falseextraEnv: |  - name: DB_VENDOR    value: postgres  - name: DB_ADDR    value: mypostgres  - name: DB_PORT    value: "5432"  - name: DB_DATABASE    value: mydb

here sharing simple YAML file for reference if you dont want to use to the helm it's only for development purpose

apiVersion: v1kind: Servicemetadata:  name: keycloak  labels:    app: keycloakspec:  ports:  - name: http    port: 8080    targetPort: 8080  selector:    app: keycloak  type: ClusterIP---apiVersion: apps/v1kind: Deploymentmetadata:  name: keycloak  namespace: default  labels:    app: keycloakspec:  replicas: 1  selector:    matchLabels:      app: keycloak  template:    metadata:      labels:        app: keycloak    spec:      containers:      - name: keycloak        #image: quay.io/keycloak/keycloak:10.0.0        image: harshmanvar/keycloak-demo        env:        - name: KEYCLOAK_USER          value: "admin"        - name: KEYCLOAK_PASSWORD          value: "admin"        - name: PROXY_ADDRESS_FORWARDING          value: "true"        - name: DB_VENDOR          value: POSTGRES        - name: DB_ADDR          value: postgres        - name: DB_DATABASE          value: keycloak        - name: DB_USER          value: root        - name: DB_PASSWORD          value: password        - name : KEYCLOAK_HTTP_PORT          value : "80"        - name: KEYCLOAK_HTTPS_PORT          value: "443"        - name : KEYCLOAK_HOSTNAME          value : keycloak.example.com        ports:        - name: http          containerPort: 8080        - name: https          containerPort: 8443        readinessProbe:          httpGet:            path: /auth/realms/master            port: 8080