Reputation: 21
I am using this link to have a Keycloak setup on my K8s cluster in Azure cloud. https://www.keycloak.org/getting-started/getting-started-kube
Even after following all the steps successfully, unable to get the Keycloak Admin console or Keycloak account on my browser. I have minicube on my machine, also enabled the ingress addon.
Deployed Keycloak deployment and service and also ingress.
I do the echo : KEYCLOAK_URL=https://keycloak.$(minikube ip).nip.io &&
echo "Keycloak: $KEYCLOAK_URL" &&
echo "Keycloak Admin Console: $KEYCLOAK_URL/admin" &&
echo "Keycloak Account Console: $KEYCLOAK_URL/realms/myrealm/account" &&
echo ""
and get the successful output without errors:
Keycloak: https://keycloak.<IP>.nip.io
Keycloak Admin Console: https://keycloak.<IP>.nip.io:8443/admin
Keycloak Account Console: https://keycloak.<IP>.nip.io/realms/myrealm/account
But when I try opening the Admin console link or Keycloak link, in my browser it does not open.
Not sure as what am I missing and what else is supposed to be done?
Upvotes: 1
Views: 5071
Reputation: 30113
You can check out my YAML files to deploy the Keycloak on Kubernetes.
apiVersion: v1
kind: Service
metadata:
name: keycloak
labels:
app: keycloak
spec:
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app: keycloak
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: keycloak
namespace: default
labels:
app: keycloak
spec:
replicas: 1
selector:
matchLabels:
app: keycloak
template:
metadata:
labels:
app: keycloak
spec:
containers:
- name: keycloak
image: quay.io/keycloak/keycloak:10.0.0
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.harshmanvar.tk #replace with ingress URL
ports:
- name: http
containerPort: 8080
- name: https
containerPort: 8443
readinessProbe:
httpGet:
path: /auth/realms/master
port: 8080
https://github.com/harsh4870/Keycloack-postgres-kubernetes-deployment
Feel free to refer this article for more : https://faun.pub/keycloak-kubernetes-deployment-409d6ccd8a39
Upvotes: 1