要提供可选设置,请使用 --set
参数将其传递给 Helm。 使用以下列出部署类型值设置的文件:
Vanilla Kubernetes: values.yaml
要了解可选的 Kubernetes Operator 安装设置,请参阅Operator Helm 安装设置。
按以下示例运行命令,指定的选项将传递到配置中:
helm upgrade enterprise-operator mongodb/enterprise-operator \ --set registry.pullPolicy='IfNotPresent'
代理
MongoDB 助手映像的名称。此设置将附加到注册表中。代理,并将 MDB_AGENT_IMAGE_REPOSITORY 环境变量设置为完整的 URL ,StatefulSet 从中下载用于数据库部署的MongoDB 助手映像。要学习;了解更多信息,请参阅容器映像。
默认值为mongodb-agent-ubi 。
agent: name: mongodb-agent-ubi
appDb.name
应用程序数据库映像的名称。
默认值为MongoDB Enterprise-appdb 。
appDb: name: mongodb-enterprise-appdb version: 10.2.15.5958-1_4.2.11-ent
appDb.version
包含应用程序数据库使用的 MongoDB Agent 的映像版本。
默认值为 10.2.15.5958-1_4.2.11-ent。
appDb: name: mongodb-enterprise-appdb version: 10.2.15.5958-1_4.2.11-ent
database.name
MongoDB Enterprise 数据库映像的名称。
默认值为MongoDB Enterprise 数据库 。
database: name: mongodb-enterprise-database version: 1.32
database.version
Kubernetes 操作符部署的 MongoDB Enterprise 数据库映像的版本。
database: name: mongodb-enterprise-database version: 1.32
initAppDb.name
包含应用程序数据库启动脚本和就绪探针的initContainer
映像的名称。
默认值为mongodb-enterprise-init-appdb 。
database: name: mongodb-enterprise-init-appdb version: 1.32
initAppDb.version
包含应用程序数据库启动脚本和就绪探针的initContainer
映像版本。
默认值为1.32 。
database: name: mongodb-enterprise-init-appdb version: 1.32
initDatabase.name
包含 MongoDB Agent 启动脚本和就绪探针的initContainer
映像的名称。
默认值为MongoDB Enterprise-init-数据库 。
database: name: mongodb-enterprise-init-database version: 1.32
initDatabase.version
包含 MongoDB Agent 启动脚本和就绪探针的initContainer
映像的版本。
默认值为1.32 。
database: name: mongodb-enterprise-init-database version: 1.32
initOpsManager.name
包含 Ops Manager 启动脚本和就绪探针的initContainer
映像版本。
默认值为MongoDB Enterprise-init-ops-经理 。
database: name: mongodb-enterprise-init-ops-manager version: 1.32
initOpsManager.version
包含 Ops Manager 启动脚本和就绪探针的initContainer
映像版本。
默认值为1.32 。
database: name: mongodb-enterprise-init-ops-manager version: 1.32
ManagedSecurityContext
用于确定 Kubernetes 操作符 是否继承 Kubernetes 集群托管的securityContext设置的标志。
如果您想在 OpenShift 中或限制性环境中运行 Kubernetes 操作符,则该值必须为true 。
默认值为false 。
# Set this to true if your cluster is managing SecurityContext for you. # If running OpenShift (Cloud, Minishift, etc.), set this to true. managedSecurityContext: false
默认值为true 。
# Set this to true if your cluster is managing SecurityContext for you. # If running OpenShift (Cloud, Minishift, etc.), set this to true. managedSecurityContext: true
mongodb.appdbAssumeOldFormat
在Kubernetes Operator1.20 中,应用程序数据库映像的容器注册表已更改,并且映像使用新的标签后缀。升级Kubernetes Operator 时, Kubernetes Operator-ent
会自动将引用新容器注册表的所有映像的早期后缀 更新为-ubi8
或 MDB_IMAGE_TYPE 或 mongodb.imageType 中设立的后缀。
例如,Kubernetes 操作符 将quay.io/mongodb/mongodb-enterprise-server:4.4.5-ent
更改为quay.io/mongodb/mongodb-enterprise-server:4.4.5-ubi8
。
要阻止 Kubernetes Operator 自动更新后缀,请将MDB_APPDB_ASSUME_OLD_FORMAT或mongodb.appdbAssumeOldFormat设置为true
。 例如,如果要从自己的存储库镜像此映像,则可能需要停止自动更改后缀。
默认值为false
,它会自动更新图像后缀。
mongodb: appdbAssumeOldFormat: false
mongodb.imageType
应用程序数据库映像的后缀。
在Kubernetes Operator1.20 中,应用程序数据库映像的容器注册表已更改,并且映像使用新的标签后缀。升级Kubernetes Operator 时, Kubernetes Operator-ent
会自动将引用新容器注册表的所有映像的早期后缀 更新为-ubi8
或 MDB_IMAGE_TYPE 或 mongodb.imageType 中设立的后缀。
例如,Kubernetes 操作符 将quay.io/mongodb/mongodb-enterprise-server:4.4.5-ent
更改为quay.io/mongodb/mongodb-enterprise-server:4.4.5-ubi8
。
要阻止 Kubernetes Operator 自动更新后缀,请将MDB_APPDB_ASSUME_OLD_FORMAT或mongodb.appdbAssumeOldFormat设置为true
。 例如,如果要从自己的存储库镜像此映像,则可能需要停止自动更改后缀。
默认值为ubi8
。 为了保持一致性,我们建议仅使用ubi
图像,但如果需要,可以将此设置更改为ubuntu2204
。
mongodb: imageType: ubi8
multiCluster.clusterClientTimeout
Kubernetes Operator 尝试连接到集群的Kubernetes API服务器端点的时间(以秒为单位)。此超时时间是为多 Kubernetes集群MongoDB部署中的所有Kubernetes集群设立的。如果Kubernetes Operator 在指定时间内没有从Kubernetes API服务器收到响应,则会将集群的状态记录为“unhealthy”(不健康)。要学习;了解更多信息,请参阅Kubernetes集群故障排除。
默认值为10 。
multiCluster: clusterClientTimeout: 10
namespace
要在其中部署Kubernetes Operator 的命名空间。
要使用默认值以外的命名空间,请指定要在其中部署 Kubernetes 操作符的命名空间。
默认值为mongodb 。
# Name of the Namespace to use namespace: mongodb
需要 CA 基础架构
确定Kubernetes是否创建允许Kubernetes Operator 使用certificates.k8 s.io API签署 TLS 证书的 ClusterRole。
needsCAInfrastructure: true
默认值为true 。
Operator.deployment_name
Kubernetes 操作符 container 的名称。
默认值为MongoDB Enterprise操作符 。
operator: deployment_name: mongodb-enterprise-operator
Operator.env
Kubernetes Operator 部署环境的标签。 此值会影响默认超时以及日志记录级别和格式:
如果值为 | 日志级别设置为 | 日志格式设置为 |
---|---|---|
| debug | text |
| 信息 | JSON |
默认值为prod 。
operator: # Execution environment for the operator, dev or prod. # Use dev for more verbose logging env: prod
操作符.maxConcurrentReconciles
Kubernetes Operator 可以执行的最大并发协调数。它会设置 MaxConcurrentReconciles 。要学习;了解更多信息,请参阅Kubernetes Operator 部署多个MongoDB副本集。
例子
operator: # Control how many reconciles can be performed in parallel. # Increasing the number of concurrent reconciliations decreases the time needed to reconcile all watched resources, # but it might result in request load spikes and increased load on the Ops Manager API, and the Kubernetes API server generally. maxConcurrentReconciles: 10
操作符.mdbDefaultArchitecture
确定所有部署使用的容器架构:
在运行时下载 MongoDB 二进制文件的默认非静态容器,或
在运行时不可变的静态容器(公共预览版) 。
默认为 non-static
。
要启用静态容器,请设置为static
。
注意
此设置适用于所有部署,包括现有部署。 要为单个部署启用静态容器,请改用metadata.annotations.mongodb.com/v1.architecture
MongoDB 资源 中的 。
operator.mdbDefaultArchitecture: static
Operator.name
Kubernetes 分配给 Kubernetes 操作符对象的名称,例如 Deployments、ServiceAccounts、角色 和 Pod。
此值还对应于 Kubernetes Operator 所在容器注册表的名称。
默认值为MongoDB Enterprise操作符 。
operator: name: mongodb-enterprise-operator
操作符.telemetry
使Kubernetes Operator 能够收集和发送遥测数据。以下设置的默认值为 true
。
operator: telemetry: # Enables telemetry. Setting this to "false" will stop all telemetry. enabled: true # Adds RBAC clusterRole for kube-system UID detection for the Kubernetes cluster UID. # Adds RBAC clusterRole for RBAC for nodes. We are listing exactly one node to detect the cluster provider (for example, eks). # Adds RBAC clusterRole for /version query for detecting Kubernetes server version. installClusterRole: true collection: # Controls how often the Kubernetes Operator collects and saves the data to the telemetry ConfigMap. It doesn't control whether this data is sent to MongoDB for analysis. # Valid time units for frequency are "m", or "h". Anything less than one minute defaults to 1h. frequency: 1h # Enables the Kubernetes Operator to collect and send cluster-level telemetry. # Note: the cluster UUID is unique but random and MongoDB has no way to map this to a customer. clusters: enabled: true # Enables the Kubernetes Operator to collect and send deployment-level telemetry. deployments: enabled: true # Enables the Kubernetes Operator to collect and send Kubernetes Operator-level telemetry. operators: enabled: true # Enables sending the collected telemetry to MongoDB. send: enabled: true # Controls how often the Kubernetes Operator sends the collected the data to MongoDB for analysis. # Valid time units are "h". Anything less than one hour defaults to 168h, which is one week. frequency: 168h
Operator.vaultSecretBackend.enabled
确定Kubernetes Operator 是否将密钥存储在 HashiCorp Vault 中。要学习;了解更多信息,请参阅设置密钥存储工具。如果将 TLS 与 Vault 结合使用,则还必须指定操作符.vaultSecretBackend.tlsSecretRef。
默认值为false 。
operator: # Set the following setting to "true" so that the MongoDB Kubernetes Operator stores secrets in Vault. vaultSecretBackend: false
Operator.vaultSecretBackend.tlsSecretRef
如果您将TLS与 Vault 结合使用,则为必填项。 在包含ca.crt
条目的保管库配置中使用的 TLS 密钥。 ca.crt
条目的内容必须与用于生成 Vault TLS 证书的CA证书匹配。 Kubernetes Operator 将此 TLS 密钥存储在其密钥存储工具中。 要了解更多信息,请参阅配置密钥存储。 需要将Operator.vaultSecretBackend.enabled设置为true
。
operator: vaultSecretBackend: true tlsSecretRef: "vault-tls-secret"
Operator.version
要部署的 Kubernetes Operator 版本。
默认值为1.32 。
operator: version: 1.32
Operator.watchNamespace
Kubernetes Operator 监视MongoDB
资源更改的命名空间。如果此命名空间与默认空间不同,请确保Kubernetes Operator ServiceAccount 可以访问权限此命名空间。
要监视所有命名空间,请指定 * 并将 ClusterRole
mongodb-enterprise-operator
分配给用于运行Kubernetes Operator 的 ServiceAccount。要监视所有命名空间的子集,请在逗号分隔的列表中指定它们,使用反斜杠转义每个逗号,并用引号将该列表括起来,例如
"operator.watchNamespace=ns1\,ns2"
。
在单个 Kubernetes 操作符实例监视不同集群资源类型的部署中,监视命名空间子集非常有用。例如,您可以将 Kubernetes 操作符 配置为监视一个命名空间子集中的MongoDB
资源,并监视另一命名空间子集中的MongoDBMultiCluster
资源。为了避免在资源协调期间出现竞争条件,对于您希望 Kubernetes 操作符监视的每种自定义资源类型,请确保将范围设置为命名空间的不同子集。
重要
要将Ops Manager和MongoDB
资源部署到部署Kubernetes Operator 以外的一个或多个命名空间,请参阅为MongoDB Enterprise Kubernetes Operator 部署设置范围,了解必须使用的值以及可能需要执行的其他步骤。
默认值为<metadata.namespace> 。
# Watch one namespace helm install enterprise-operator mongodb/enterprise-operator \ --set operator.watchNamespace='namespace-to-watch' <...>
# Watch both namespace-a and namespace-b helm install enterprise-operator mongodb/enterprise-operator \ --set operator.watchNamespace="namespace-a\,namespace-b"
# Operator with name `mongodb-enterprise-operator-qa-envs` will # watch ns-dev, ns-qa and ns-uat namespaces helm install mongodb-enterprise-operator-qa-envs mongodb/enterprise-operator \ --set operator.watchNamespace="ns-dev\,ns-qa\,ns-uat"
# Operator with name `mongodb-enterprise-operator-staging` will # watch ns-staging and ns-pre-prod helm install mongodb-operator helm-chart --set operator.watchNamespace="ns-staging\,ns-pre-prod" mongodb-enterprise-operator-staging
Operator.watchedResources
Kubernetes Operator 监视的自定义资源。
Kubernetes Operator 会为其安装 CustomResourceDefinitions,并仅监控您指定的资源。
Kubernetes Operator 接受以下值:
值 | 说明 |
---|---|
| 安装数据库资源的 CustomResourceDefinitions 并监视这些资源。 |
| 为 MongoDB 用户资源安装 CustomResourceDefinitions 并监视这些资源。 |
| 安装 Ops Manager 的 CustomResourceDefinitions 并监视这些资源。 |
operator: watchedResources: - mongodbusers - mongodb - opsmanagers
opsManager.name
Ops Manager 映像的名称。
默认值为MongoDB Enterprise-ops-经理 。
opsManager: name: mongodb-enterprise-ops-manager
注册表。代理
MongoDB映像的 Quay容器注册表的URL 。附加代理.name 并将 MDB_AGENT_IMAGE_REPOSITORY 环境变量设置为完整URL ,StatefulSet 从该完整 URL 下载用于数据库部署的MongoDB 助手映像。要学习;了解更多信息,请参阅容器映像。
默认值为quay.io/mongodb 。
registry: agent: quay.io/mongodb/
registry.appDb
Kubernetes 操作符从存储库下载应用程序数据库映像的URL。
默认值为quay.io/mongodb 。
registry: appDb: quay.io/mongodb
默认值为registry.connect.redhat.com/mongodb 。
registry: appDb: registry.connect.redhat.com/mongodb
registry.imagePullSecrets
重要
registry: # Specify the secret in the ``imagePullSecrets`` setting. If you # use the MongoDB Kubernetes Operator to deploy MongoDB resources # into multiple namespaces, create the secret only in the namespace # where you installed the Operator. The Operator synchronizes # the secret across all watched namespaces. imagePullSecrets: <openshift-pull-secret>
registry.initAppDb
存储库的URL ,从该存储库下载包含应用程序数据库启动脚本和就绪探针的initContainer
映像。
默认值为quay.io/mongodb 。
registry: initAppDb: quay.io/mongodb
默认值为registry.connect.redhat.com/mongodb 。
registry: initAppDb: registry.connect.redhat.com/mongodb
registry.initOpsManager
存储库的URL ,从该存储库下载包含 Ops Manager 启动脚本和就绪探针的initContainer
映像。
默认值为quay.io/mongodb 。
registry: initOpsManager: quay.io/mongodb
默认值为registry.connect.redhat.com/mongodb 。
registry: initOpsManager: registry.connect.redhat.com/mongodb
registry.operator
从中拉取 Kubernetes Operator 映像的存储库。 如果要从私有存储库拉取 Kubernetes 操作符 映像,请指定此值。
默认值为quay.io/mongodb 。
registry: operator: quay.io/mongodb
默认值为registry.connect.redhat.com/mongodb 。
registry: operator: registry.connect.redhat.com/mongodb
registry.opsManager
URL 的存储库,从该存储库下载Ops Manager 资源的映像。
默认值为quay.io/mongodb 。
registry: opsManager: quay.io/mongodb
默认值为registry.connect.redhat.com/mongodb 。
registry: opsManager: registry.connect.redhat.com/mongodb
操作符.resources.requests
Kubernetes Operator 的 CPU 和内存消耗限制规范。
例子
# operator cpu requests and limits resources: requests: cpu: 500m memory: 200Mi
操作符.resources.limits
Kubernetes Operator 的 CPU 和内存消耗限制规范。
例子
# operator cpu requests and limits resources: limits: cpu: 1100m memory: 1Gi
subresourceEnabled
指示是否可以在Kubernetes Operator CustomResourceDefinition 中定义子资源的标志。
默认值为true 。
subresourceEnabled: true
webhook.installClusterRole
标志允许您为Kubernetes集群角色配置用户验证准入 Webhook。
如果您的部署不允许Kubernetes集群角色,请将此标志设置为false
。
默认值为true 。
webhook: installClusterRole: false