<p>I just follow the Keycloak Documentation for Kubernetes.</p>
<p><a href="https://www.keycloak.org/getting-started/getting-started-kube" rel="nofollow noreferrer">https://www.keycloak.org/getting-started/getting-started-kube</a></p>
<p><a href="https://i.stack.imgur.com/8oCpF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8oCpF.png" alt="I" /></a></p>
<p>But After deployed it like exactly how they are saying in the documentation.</p>
<p>When I try to load the keyclaok page, I'm getting this,</p>
<p><a href="https://i.stack.imgur.com/LglSn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LglSn.png" alt="enter image description here" /></a></p>
<p>if you can give me a solution or explain why this is happening, Really appreciate it!</p>
<p>My ingress config (keycloak-ingress.yaml) is,</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: keycloak
spec:
  tls:
    - hosts:
      - keycloak.192.168.49.2.nip.io
  rules:
  - host: keycloak.192.168.49.2.nip.io
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: keycloak
            port:
              number: 8080
</code></pre>

<p>Make sure you have updated the ingress file with the proper <strong>IP</strong> of <strong>minikube</strong>.</p>
<p>Also check with <strong>http</strong> instead <strong>https</strong> &amp; <strong>KEYCLOAK_HOSTNAME</strong> value</p>
<p>Try below YAML :</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: keycloak
  labels:
    app: keycloak
spec:
  ports:
  - name: http
    port: 8080
    targetPort: 8080
  selector:
    app: keycloak
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: keycloak
  labels:
    app: keycloak
spec:
  replicas: 1
  selector:
    matchLabels:
      app: keycloak
  template:
    metadata:
      labels:
        app: keycloak
    spec:
      containers:
      - name: keycloak
        image: quay.io/keycloak/keycloak:20.0.3
        args: [&quot;start-dev&quot;]
        env:
        - name: KEYCLOAK_ADMIN
          value: &quot;admin&quot;
        - name: KEYCLOAK_ADMIN_PASSWORD
          value: &quot;admin&quot;
        - name: KC_PROXY
          value: &quot;edge&quot;
        ports:
        - name: http
          containerPort: 8080
        readinessProbe:
          httpGet:
            path: /realms/master
            port: 8080
</code></pre>
<p>it will creat the <strong>LB</strong> service for you so you will be able to access it without <strong>ingress config. Run <code>kubectl get svc -n &lt;namespace-name&gt;</code> and check <strong>External</strong> IP</strong> and try opening that in browser.</p>
<p><strong>Extra :</strong></p>
<p>You can refer to this YAML if the default one is not working. i am using Postgres &amp; Dpeloying the Keycloak with that.</p>
<p>GitHub repo path : <a href="https://github.com/harsh4870/Keycloack-postgres-kubernetes-deployment" rel="nofollow noreferrer">https://github.com/harsh4870/Keycloack-postgres-kubernetes-deployment</a></p>
<p>Ref : <a href="https://faun.pub/keycloak-kubernetes-deployment-409d6ccd8a39" rel="nofollow noreferrer">https://faun.pub/keycloak-kubernetes-deployment-409d6ccd8a39</a></p>
