Skip to content

keycloak operator: add support for different port and name for the kubernetes service definition in the keycloak CRD #46633

@dev-wealthpilot

Description

@dev-wealthpilot

Description

Currently the value of http.httpsPort is used for the service definition and for the port that is used in the pods.

If for example 8443 is used as the port number, then the service definition looks like this:

apiVersion: v1
kind: Service
metadata:
  name: keycloak-service
...
spec:
...
  ports:
  - name: https
    port: 8443
    protocol: TCP
    targetPort: 8443
...

and connections to the keycloak pods via the service now also must contain the 8443 port (e.g. https://keycloak-service.keycloak.svc:8443).

If there was a separate port number could be configured for the service, then it would be possible to use 443 for the service and thus simplify the URL to be https://keycloak-service.keycloak.svc

It would also be great if the name of the service was configurable (e.g. to avoid the -service suffix)

with configurable name and port the service definition could look like this:

apiVersion: v1
kind: Service
metadata:
  name: keycloak
...
spec:
...
  ports:
  - name: https
    port: 443
    protocol: TCP
    targetPort: 8443
...

so that the URL becomes: https://keycloak.keycloak.svc

Value Proposition

more flexibility for setting up keycloak via the keycloak operator.
Would also be useful in migration scenarios (e.g. migrating from bitnami keycloak helm chart to keycloak operator) where the service name should remain stable.

Goals

configurable kubernetes service name and port

Non-Goals

Discussion

No response

Notes

No response

Metadata

Metadata

Labels

No fields configured for feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions