8.8. 创建自定义 Ingress Controller


作为集群管理员,您可以创建新的自定义 Ingress Controller。因为默认 Ingress Controller 在 OpenShift Container Platform 更新过程中可能会改变,所以创建自定义 Ingress Controller 以在集群更新中手动保留配置会很有用。

这个示例为自定义 Ingress Controller 提供最小规格。要进一步定制您的自定义 Ingress Controller,请参阅"配置 Ingress Controller"。

先决条件

  • 安装 OpenShift CLI(oc)。
  • 以具有 cluster-admin 特权的用户身份登录。

流程

  1. 创建定义自定义 IngressController 对象的 YAML 文件:

    custom-ingress-controller.yaml 文件示例

    apiVersion: operator.openshift.io/v1
    kind: IngressController
    metadata:
        name: <custom_name> 
    1
    
        namespace: openshift-ingress-operator
    spec:
        defaultCertificate:
            name: <custom-ingress-custom-certs> 
    2
    
        replicas: 1 
    3
    
        domain: <custom_domain> 
    4
    Copy to Clipboard Toggle word wrap

    1
    IngressController 对象指定自定义名称
    2
    使用自定义通配符证书指定 secret 名称。
    3
    最小副本需要是 ONE
    4
    指定您的域名的域。IngressController 对象中指定的域以及用于证书的域必须匹配。例如,如果 domain 值为 "custom_domain.mycompany.com",则证书必须具有 SAN *.custom_domain.mycompany.com(在域中添加了 *.)。
  2. 运行以下命令来创建对象:

    $ oc create -f custom-ingress-controller.yaml
    Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat