搜索

5.6. 从 OpenShift 集群外部配置到 Apicurio Registry 的 HTTPS 连接

download PDF

以下流程演示了如何配置 Apicurio Registry 部署,以便为来自 OpenShift 集群外部的连接公开 HTTPS 边缘终止路由。

先决条件

流程

  1. 除了 Apicurio Registry Operator 创建的 HTTP 路由外,添加第二个路由。例如:

    kind: Route
    apiVersion: route.openshift.io/v1
    metadata:
      [...]
      labels:
        app: example-apicurioregistry
        [...]
    spec:
      host: example-apicurioregistry-default.apps.example.com
      to:
        kind: Service
        name: example-apicurioregistry-service-9whd7
        weight: 100
      port:
        targetPort: 8080
      tls:
        termination: edge
        insecureEdgeTerminationPolicy: Redirect
      wildcardPolicy: None
    注意

    确保设置了 insecureEdgeTerminationPolicy: Redirect 配置属性。

    如果没有指定证书,OpenShift 将使用默认证书。另外,您可以使用以下命令生成自定义自签名证书:

    openssl genrsa 2048 > tls.key &&
    openssl req -new -x509 -nodes -sha256 -days 365 -key tls.key -out tls.crt

    然后,使用 OpenShift CLI 创建路由:

    oc create route edge \
      --service=example-apicurioregistry-service-9whd7 \
      --cert=tls.crt --key=tls.key \
      --hostname=example-apicurioregistry-default.apps.example.com \
      --insecure-policy=Redirect \
      -n default
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.