要提供可选设置,请使用--set参数将其传递给 Helm。 使用以下列出部署类型值设置的文件:
Vanilla Kubernetes: values.yaml
OpenShift:values-openshift.yaml
要了解可选的 Kubernetes Operator 安装设置,请参阅Operator Helm 安装设置。
按以下示例运行命令,指定的选项将传递到配置中:
helm upgrade mongodb-kubernetes-operator mongodb/mongodb-kubernetes \ --set registry.pullPolicy='IfNotPresent'
代理
MongoDB 助手映像的名称。 此设置将附加到注册表代理,并将MDB_AGENT_IMAGE_REPOSITORY环境变量设置为完整URL,StatefulSet从中下载用于数据库部署的MongoDB助手映像。要学习;了解更多信息,请参阅容器映像。
默认值为mongodb-agent-ubi 。
agent: name: mongodb-agent-ubi
appDb.name
应用程序数据库映像的名称。
默认值为 mongodb-kubernetes-appdb 。
appDb: name: mongodb-kubernetes-appdb version: 10.2.15.5958-1_4.2.11
appDb.version
包含应用程序数据库使用的 MongoDB Agent 的映像版本。
默认值为 10.2.15.5958-1_4.2.11。
appDb: name: mongodb-kubernetes-appdb version: 10.2.15.5958-1_4.2.11
database.name
MongoDB Enterprise 数据库映像的名称。
默认值为MongoDB Enterprise 数据库 。
database: name: mongodb-enterprise-database version: 1.2.0
database.version
Kubernetes 操作符部署的 MongoDB Enterprise 数据库映像的版本。
database: name: mongodb-enterprise-database version: 1.2.0
initAppDb.name
包含应用程序数据库启动脚本和就绪探针的initContainer映像的名称。
默认值为 mongodb-kubernetes-init-appdb 。
database: name: mongodb-kubernetes-init-appdb version: 1.2.0
initAppDb.version
包含应用程序数据库启动脚本和就绪探针的initContainer映像版本。
默认值为 1.2.0 。
database: name: mongodb-kubernetes-init-appdb version: 1.2.0
initDatabase.name
包含 MongoDB Agent 启动脚本和就绪探针的initContainer映像的名称。
默认值为 mongodb-kubernetes-init-database 。
database: name: mongodb-kubernetes-init-database version: 1.2.0
initDatabase.version
包含 MongoDB Agent 启动脚本和就绪探针的initContainer映像的版本。
默认值为 1.2.0 。
database: name: mongodb-kubernetes-init-database version: 1.2.0
initOpsManager.name
包含 Ops Manager 启动脚本和就绪探针的initContainer映像版本。
默认值为 mongodb-kubernetes-init-ops-manager 。
database: name: mongodb-kubernetes-init-ops-manager version: 1.2.0
initOpsManager.version
包含 Ops Manager 启动脚本和就绪探针的initContainer映像版本。
默认值为 1.2.0 。
database: name: mongodb-kubernetes-init-ops-manager version: 1.2.0
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
默认值为false ,它会自动更新图像后缀。
mongodb: appdbAssumeOldFormat: false
mongodb.imageType
应用程序数据库映像的后缀。
默认值为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.k8s.io API签署 TLS 证书的 ClusterRole。
needsCAInfrastructure: true
默认值为true 。
Operator.deployment_name
Kubernetes 操作符 container 的名称。
默认值为 mongodb-kubernetes-operator 。
operator: deployment_name: mongodb-kubernetes-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-kubernetes-operator 。
operator: name: mongodb-kubernetes-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
Required if you are using TLS with Vault. The TLS secret used in your Vault configuration that contains a ca.crt entry. The content of the ca.crt entry must match the certificate of the CA used to generate the Vault TLS certificates. The Kubernetes Operator stores this TLS secret in its secret storage tool. To learn more, see Configure Secret Storage. Requires that operator.vaultSecretBackend.enabled is set to true.
operator: vaultSecretBackend: true tlsSecretRef: "vault-tls-secret"
Operator.version
要部署的 Kubernetes Operator 版本。
默认值为 1.2.0 。
operator: version: 1.2.0
Operator.watchNamespace
Kubernetes Operator 监视MongoDB资源更改的命名空间。 如果此 命名空间 与默认值不同,请确保 Kubernetes Operator ServiceAccount 可以访问 此命名空间。
To watch all namespaces, specify * and assign the ClusterRole to the
mongodb-kubernetes-operatorServiceAccount that you use to run the Kubernetes Operator.要监视所有命名空间的子集,请在逗号分隔的列表中指定它们,使用反斜杠转义每个逗号,并用引号将该列表括起来,例如
"operator.watchNamespace=ns1\,ns2"。
在单个 Kubernetes 操作符实例监视不同集群资源类型的部署中,监视命名空间子集非常有用。例如,您可以将 Kubernetes 操作符 配置为监视一个命名空间子集中的MongoDB资源,并监视另一命名空间子集中的MongoDBMultiCluster资源。为了避免在资源协调期间出现竞争条件,对于您希望 Kubernetes 操作符监视的每种自定义资源类型,请确保将范围设置为命名空间的不同子集。
重要
要将MongoDB Ops Manager和 MongoDB 资源部署到部署Kubernetes Operator 以外的一个或多个命名空间,请参阅为Kubernetes Operator 设置部署范围,了解必须使用的值以及可能需要执行的其他步骤。
默认值为<metadata.namespace> 。
# Watch one namespace helm install mongodb-kubernetes-operator mongodb/mongodb-kubernetes \ --set operator.watchNamespace='namespace-to-watch' <...>
# Watch both namespace-a and namespace-b helm install mongodb-kubernetes-operator mongodb/mongodb-kubernetes \ --set operator.watchNamespace="namespace-a\,namespace-b"
# Operator with name `mongodb-kubernetes-operator-qa-envs` will # watch ns-dev, ns-qa and ns-uat namespaces helm install mongodb-kubernetes-operator-qa-envs mongodb/mongodb-kubernetes \ --set operator.watchNamespace="ns-dev\,ns-qa\,ns-uat"
# Operator with name `mongodb-kubernetes-operator-staging` will # watch ns-staging and ns-pre-prod helm install mongodb-kubernetes-operator-staging mongodb/mongodb-kubernetes --set operator.watchNamespace="ns-staging\,ns-pre-prod"
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
注册表。代理
URL for the Quay container registry for MongoDB images. The agent.name gets appended and sets the MDB_AGENT_IMAGE_REPOSITORY environment variable to the full URL from which the StatefulSet downloads the MongoDB Agent image for database deployments. To learn more, see Container Images.
默认值为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
密钥,其中包含从存储库中提取映像所需的凭证。
重要
OpenShift 需要此设置。 在此文件的imagePullSecrets设置中定义,或在使用 Helm 安装 Kubernetes 操作符时传递。如果您使用 Kubernetes Operator 将 MongoDB 资源部署到多个命名空间或在集群范围内部署 MongoDB 资源,请仅在安装 Kubernetes Operator 的命名空间中创建密钥。Kubernetes 操作符在所有受监视的命名空间之间同步密钥。
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 of the repository from which the initContainer image that contains the Application Database start-up scripts and the readiness probe is downloaded.
默认值为quay.io/mongodb 。
registry: initAppDb: quay.io/mongodb
默认值为registry.connect.redhat.com/mongodb 。
registry: initAppDb: registry.connect.redhat.com/mongodb
registry.initOpsManager
URL of the repository from which the initContainer image that contains the Ops Manager start-up scripts and the readiness probe is downloaded.
默认值为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
webhook.installClusterRole
Flag allows you to configure user validating admission webhooks for Kubernetes cluster roles .
如果您的部署不允许Kubernetes集群角色,请将此标志设置为false 。
默认值为true 。
webhook: installClusterRole: false