3.4. 可用的集群自定义

大多数集群配置和自定义在 OpenShift Container Platform 集群部署后完成。有若干配置资源可用。

您可以修改配置资源来配置集群的主要功能,如镜像 registry、网络配置、镜像构建操作以及用户身份供应商。

如需设置这些资源的当前信息,请使用 oc explain 命令,如 oc explain builds --api-version=config.openshift.io/v1

3.4.1. 集群配置资源

所有集群配置资源都作用于全局范围(而非命名空间),且命名为 cluster

资源名称描述

apiserver.config.openshift.io

提供 api-server 配置,如证书和证书颁发机构

authentication.config.openshift.io

控制集群的用户身份供应商和验证配置。

build.config.openshift.io

控制集群中所有构建的默认和强制配置

console.config.openshift.io

配置 Web 控制台界面的行为,包括注销行为

featuregate.config.openshift.io

启用 FeatureGates,以便您能使用技术预览功能。

image.config.openshift.io

配置应如何对待特定的镜像 registry(允许、禁用、不安全、CA 详情)。

ingress.config.openshift.io

路由相关的配置详情,如路由的默认域。

oauth.config.openshift.io

配置用户身份供应商,以及与内部 OAuth 服务器流程相关的其他行为。

project.config.openshift.io

配置项目的创建方式,包括项目模板。

proxy.config.openshift.io

定义需要外部网络访问的组件要使用的代理。注意:目前不是所有组件都会消耗这个值。

scheduler.config.openshift.io

配置调度程序行为,如策略和默认节点选择器。

3.4.2. Operator 配置资源

这些配置资源是集群范围的实例,即 cluster,控制归特定 Operator 所有的特定组件的行为。

资源名称描述

console.operator.openshift.io

控制控制台外观,如品牌定制

config.imageregistry.operator.openshift.io

配置内部镜像 registry 设置,如公共路由、日志级别、代理设置、资源约束、副本数和存储类型。

config.samples.operator.openshift.io

配置 Samples Operator,以控制在集群上安装哪些镜像流和模板示例。

3.4.3. 其他配置资源

这些配置资源代表一个特定组件的单一实例。在有些情况下,您可以通过创建多个资源实例来请求多个实例。在其他情况下,Operator 只消耗指定命名空间中的特定资源实例名称。如需有关如何和何时创建其他资源实例的详情,请参考具体组件的文档。

资源名称实例名称命名空间描述

alertmanager.monitoring.coreos.com

main

openshift-monitoring

控制 alertmanager 部署参数。

ingresscontroller.operator.openshift.io

default

openshift-ingress-operator

配置 Ingress Operator 行为,如域、副本数、证书和控制器放置。

3.4.4. 信息资源

可以使用这些资源检索集群信息。请不要直接编辑这些资源。

资源名称实例名称描述

clusterversion.config.openshift.io

version

在 OpenShift Container Platform 4.3 中,不得自定义生产集群的 ClusterVersion 资源,而应遵循相关流程来更新集群

dns.config.openshift.io

cluster

无法修改集群的 DNS 设置。您可以查看 DNS Operator 状态

infrastructure.config.openshift.io

cluster

允许集群与其云供应商交互的配置详情。

network.config.openshift.io

cluster

无法在安装后修改集群网络。要自定义您的网络,请遵循相关的流程在安装过程中自定义联网