此内容没有您所选择的语言版本。

Appendix A. Configuring OpenShift service serving certificates to generate TLS certificates for Keycloak


OpenShift’s service serving certificate can automate the generation and management of Transport Layer Security (TLS) certificates for use by Keycloak. Infrastructure components, such as the Ingress Controller, within an OpenShift cluster will trust these TLS certificates.

Prerequisites

  • Red Hat OpenShift Container Platform version 4.13 or later.
  • Installation of the RHBK operator.
  • Access to the OpenShift web console with the cluster-admin role.

Procedure

  1. In OpenShift web console, from the Administrator perspective, expand Home from the navigation menu, and click Projects.
  2. Search for keycloak, and select the keycloak-system namespace.
  3. Create a new service.

    1. Click the + icon.
    2. In the Import YAML text box, copy the example, and paste it into the text box.

      Example

      apiVersion: v1
      kind: Service
      metadata:
        annotations:
          service.beta.openshift.io/serving-cert-secret-name: keycloak-tls
        labels:
          app: keycloak
          app.kubernetes.io/instance: keycloak
        name: keycloak-service-trusted
        namespace: keycloak-system
      spec:
        internalTrafficPolicy: Cluster
        ipFamilies:
        - IPv4
        ipFamilyPolicy: SingleStack
        ports:
        - name: https
          port: 8443
        selector:
          app: keycloak
          app.kubernetes.io/instance: keycloak

    3. Click the Create button.
  4. Expand Operators from the navigation menu, click Installed Operators, and click Keycloak Operator.
  5. In the YAML view of the Keycloak resource, under the spec section, add the ingress property:

    Example

    spec:
    ...
      ingress:
        annotations:
          route.openshift.io/destination-ca-certificate-secret: keycloak-tls
          route.openshift.io/termination: reencrypt
    ...

    By default, the Keycloak operator creates Ingress resources instead of routes. OpenShift automatically creates a route based on the Ingress definition.

  6. Specify the name of the secret containing the TLS certificate, under the spec section:

    Example

    spec:
    ...
      http:
        tlsSecret: keycloak-tls
    ...

    Once Keycloak starts, OpenShift’s service serving certificate starts generating TLS certificates for Keycloak.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部