keycloak Kubernetes multiple pods - Network issue

241 views
Skip to first unread message

Sujad Syed

unread,
Apr 15, 2024, 12:27:50 AM4/15/24
to Keycloak User
Hi Team,

I am trying to set multiple replicas on Kubernetes with mulitple replicas and one or the other issue is popping up, Request your help .. Below is my deployment file, pls suggest

apiVersion: apps/v1
kind: Deployment
metadata:
  name: keycloak
  labels:
    app: keycloak
spec:
  replicas: 2
  selector:
    matchLabels:
      app: keycloak
  template:
    metadata:
      labels:
        app: keycloak
    spec:
      containers:
        - name: keycloak
          image: container registry (Morphed)
          command: ["/opt/keycloak/bin/kc.sh"]
          args: ["start","--cache-stack=kubernetes"]
          env:
            - name: KEYCLOAK_ADMIN
              value: "admin"
            - name: KEYCLOAK_ADMIN_PASSWORD
              value: "admin"
            - name: KC_PROXY
              value: "edge"
            - name: KC_CACHE_STACK
              value: "kubernetes"
            - name: jgroups.dns.query
              value: "keycloak"
            - name: PROXY_ADDRESS_FORWARDING
              value: "true"
            - name: KC_HEALTH_ENABLED
              value: "true"
            - name: KC_METRICS_ENABLED
              value: "true"
            - name: KC_HTTP_ENABLED
              value: "true"
            - name: KC_HOSTNAME
              value: keycloak-qa.com[morphed]
            - name: KC_HOSTNAME_STRICT_HTTPS
              value: "false"
            - name: KC_HOSTNAME_STRICT_BACKCHANNEL
              value: "true"
            - name: db-url
              value: postgresql://1.1.3.3:5432/kcloak?sslmode=disable [morphed]
            - name: db-username
              value: morphed
            - name: db-password
              value: morphed
            - name: CACHE_OWNERS_COUNT
              value: "2"
            - name: CACHE_OWNERS_AUTH_SESSIONS_COUNT
              value: "2"
     #       - name: INFINISPAN_URL
     #         valueFrom:
     #           fieldRef:
     #             fieldPath: status.podIP
     #       - name: INFINISPAN_PORT
     #         value: "11222" # Use the default port unless you've configured otherwise
          ports:
            - name: http
              containerPort: 8080

Alexander Schwartz

unread,
Apr 15, 2024, 2:23:30 AM4/15/24
to Sujad Syed, Keycloak User
Hi Sujad,

Please use the Keycloak Operator as it will create the necessary resources so that Keycloak can form a cluster. See "Installing by using kubectl without Operator Lifecycle Manager" if you choose to now use the OLM.


Best,
Alexander

--
You received this message because you are subscribed to the Google Groups "Keycloak User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-user/cb0a23a3-679f-4d70-9649-b3ca9885ac6cn%40googlegroups.com.


--

Alexander Schwartz, RHCE

He/Him

Principal Software Engineer, Keycloak Maintainer

Red Hat - Germany remote

asch...@redhat.com   

Red Hat GmbH, Registered seat: Werner von Siemens Ring 12, D-85630 Grasbrunn, Germany 
Commercial register: Amtsgericht Muenchen/Munich, HRB 153243,
Managing Directors: Ryan Barnhart, Charles Cachera, Michael O'Neill, Amy Ross

Sujad Syed

unread,
Apr 17, 2024, 3:46:00 AM4/17/24
to Alexander Schwartz, Keycloak User
Hi Alex,

Issue is not resolved even with the operator, is there a specific image that needs to be used, Please help me know
Reply all
Reply to author
Forward
0 new messages