I am trying to install keycloak 24.02 on Openshift 4.14 with oracle 19.3, I was able to build custom keyclock 24.02 image with this.I am able to get the login UI but getting below error in the pod logs after the login page in admin console
2024-06-12 10:01:10,186 WARN [org.keycloak.events] (executor-thread-32) type=”LOGIN_ERROR”, realmId=”2280ecdf-46b0-4b7a-825c-7fad173b74c5″, clientId=”null”, userId=”null”, ipAddress=”10.255.28.2″, error=”cookie_not_found”
I tried to login with admin user . i need to login without error .i will paste Dockerfile used to create custome image .
Docekrfile
FROM quay.io/keycloak/keycloak:24.0.2
ADD --chown=keycloak:keycloak --chmod=644 https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc11/23.3.0.23.09/ojdbc11-23.3.0.23.09.jar /opt/keycloak/providers/ojdbc11.jar
ADD --chown=keycloak:keycloak --chmod=644 https://repo1.maven.org/maven2/com/oracle/database/nls/orai18n/23.3.0.23.09/orai18n-23.3.0.23.09.jar /opt/keycloak/providers/orai18n.jar
# Setting the build parameter for the database:
ENV KC_DB=oracle
# Add all other build parameters needed, for example enable health and metrics:
ENV KC_HEALTH_ENABLED=true
ENV KC_METRICS_ENABLED=true
ENV KC_DB_URL=jdbc:oracle:thin:@xxxx.tre.xxx-rdnet.net:1521:cdb1
ENV KC_DB_USERNAME=Usxxxxx
ENV KC_DB_PASSWORD=Paszxxx
ENV KEYCLOAK_ADMIN=admin
ENV KEYCLOAK_ADMIN_PASSWORD=adminpass
# To be able to use the image with the Red Hat build of Keycloak Operator, it needs to be optimized, which requires Red Hat build of Keycloak's build step:
RUN /opt/keycloak/bin/kc.sh build
ENTRYPOINT ["/opt/keycloak/bin/kc.sh", "start-dev"]
# keycloak-statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: keycloak-chatgpt
namespace: keycloak-new-ns
spec:
serviceName: "keycloak"
replicas: 1
selector:
matchLabels:
app: keycloak
template:
metadata:
labels:
app: keycloak
spec:
containers:
- name: keycloak
image: harbor-core-doc-common-svc.apps.xxxx.tre.xxx-rdnet.net/library/keycloak:24.0.2_test15
ports:
- containerPort: 8080
env:
- name: DB_VENDOR
value: oracle
- name: DB_ADDR
value: xxxxnode01.tre.xxx-rdnet.net
- name: DB_PORT
value: "1521"
- name: DB_DATABASE
value: cdb1
- name: DB_USER
value: User090
- name: DB_PASSWORD
value: Pass090
- name: KEYCLOAK_ADMIN
value: admin
- name: KEYCLOAK_ADMIN_PASSWORD
value: adminpass
- name: KEYCLOAK_PASSWORD
valueFrom:
secretKeyRef:
name: keycloak-secret
key: admin-password
volumeMounts:
- name: keycloak-data
mountPath: /opt/jboss/keycloak/standalone/data
volumeClaimTemplates:
- metadata:
name: keycloak-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
keycloak-service.yaml
apiVersion: v1
kind: Service
metadata:
name: keycloak
namespace: keycloak-new-ns
spec:
ports:
- port: 8080
targetPort: 8080
protocol: TCP
type: ClusterIP
selector:
app: keycloak
route.yaml
kind: Route
metadata:
annotations:
route.openshift.io/termination: edge
openshift.io/host.generated: "true"
router.openshift.io/cookie_name: keycloak
creationTimestamp: "2024-06-11T16:59:42Z"
name: keycloak
namespace: keycloak-new-ns
resourceVersion: "178305302"
uid: e205fa8c-f4d9-4ed8-9865-eac9ab4af936
spec:
host: keyclock-keyclock-new-ns.apps.xxxx.tre.xxx-rdnet.net
port:
targetPort: 8080
to:
kind: Service
name: keycloak
weight: 100
wildcardPolicy: None
status:
ingress:
- conditions:
- lastTransitionTime: "2024-06-11T16:59:42Z"
status: "True"
type: Admitted
host: keyclock-keyclock-new-ns.apps.xxxx.tre.xxx-rdnet.net
routerCanonicalHostname: router-default.apps.xxxx.tre.xxx-rdnet.net
routerName: default
wildcardPolicy: None