Hello!
I’m trying to install Keycloak using the Operator locally on minikube and I’ve the problem with it.
What am I doing wrong? Where is the best place to start troubleshooting?
I’m using these guides and doing doing exactly what is written in them:
Step by step
I added this record to hosts:
127.0.0.1 test.keycloak.org
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/20.0.1/kubernetes/keycloaks.k8s.keycloak.org-v1.yml
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/20.0.1/kubernetes/keycloakrealmimports.k8s.keycloak.org-v1.yml
kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/20.0.1/kubernetes/kubernetes.yml
cat <<EOF >> example-postgres.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgresql-db
spec:
serviceName: postgresql-db-service
selector:
matchLabels:
app: postgresql-db
replicas: 1
template:
metadata:
labels:
app: postgresql-db
spec:
containers:
- name: postgresql-db
image: postgres:latest
env:
- name: POSTGRES_PASSWORD
value: testpassword
- name: PGDATA
value: /data/pgdata
- name: POSTGRES_DB
value: keycloak
---
apiVersion: v1
kind: Service
metadata:
name: postgres-db
spec:
selector:
app: postgresql-db
type: LoadBalancer
ports:
- port: 5432
targetPort: 5432
EOF
kubectl apply -f example-postgres.yaml
openssl req -subj '/CN=test.keycloak.org/O=Test Keycloak./C=US' -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
kubectl create secret tls example-tls-secret --cert certificate.pem --key key.pem
kubectl create secret generic keycloak-db-secret --from-literal=username=postgres --from-literal=password=testpassword
cat <<EOF >> example-kc.yaml
apiVersion: k8s.keycloak.org/v2alpha1
kind: Keycloak
metadata:
name: example-kc
spec:
instances: 1
db:
vendor: postgres
host: postgres-db
usernameSecret:
name: keycloak-db-secret
key: username
passwordSecret:
name: keycloak-db-secret
key: password
http:
tlsSecret: example-tls-secret
hostname:
hostname: test.keycloak.org
EOF
kubectl apply -f example-kc.yaml
kubectl port-forward service/example-kc-service 8443:8443
I open a link https://test.keycloak.org:8443
and see the Page “Welcome to Keycloak” with a link to Administration Console https://test.keycloak.org:8443/admin/master/console/
But after clicking to link I see an infinity spinner “Loading the admin console”.
The same with Account Management Console https://test.keycloak.org:8443/realms/master/account/
The minikube dashboard does not show any errors.
What am I doing wrong? Where is the best place to start troubleshooting?