Navigation

MongoDB Enterprise Kubernetes Operator kubectl and oc Installation Settings

To provide optional settings, edit the YAML file that corresponds to your deployment type in the directory where you cloned the Kubernetes Operator repository:

  • Vanilla Kubernetes using kubectl: mongodb-enterprise.yaml
  • OpenShift using oc: mongodb-enterprise-openshift.yaml

If the setting that you want to add doesn’t exist in the YAML file, add it as a new array of key-value pair mappings in the spec.template.spec.containers.name.env. collection:

  • Set the value of the spec.template.spec.containers.name.env.name key to the setting’s name.
  • Set the value of the spec.template.spec.containers.name.env.value key to the setting’s value.

To fill in values for container images, see Container Images.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: INIT_APPDB_IMAGE_REPOSITORY
              value: quay.io/mongodb/mongodb-enterprise-init-appdb-ubi

APPDB_AGENT_VERSION

Version of the image that contains the MongoDB Agent that the Application Database uses.

The default value is 10.2.15.5958-1_4.2.11-ent.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: APPDB_AGENT_VERSION
              value: 10.2.15.5958-1_4.2.11-ent

APPDB_IMAGE_REPOSITORY

URL of the repository from which the Kubernetes Operator downloads the Application Database image.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
     spec:
      serviceAccountName: mongodb-enterprise-operator
        containers:
          - name: mongodb-enterprise-operator
            image: <operatorVersionUrl>
            imagePullPolicy: <policyChoice>
            env:
             - name: APPDB_IMAGE_REPOSITORY
               value: quay.io/mongodb/mongodb-enterprise-appdb-ubi

CLUSTER_CLIENT_TIMEOUT

Time, in seconds, the Kubernetes Operator attempts to connect to a cluster’s Kubernetes API server endpoint. This timeout is set for all Kubernetes clusters in multi-Kubernetes-cluster deployments. If the Kubernetes Operator doesn’t get a response from the Kubernetes API server within the specified time, it logs the cluster’s status as “unhealthy”. To learn more, see Troubleshooting Kubernetes Clusters.

The default value is 10.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: CLUSTER_CLIENT_TIMEOUT
              value: 10

DATABASE_VERSION

Version of the MongoDB Enterprise Database image that the Kubernetes Operator deploys.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: DATABASE_VERSION
              value: 2.0.0

IMAGE_PULL_POLICY

Pull policy for the MongoDB Enterprise database image the Kubernetes Operator deploys.

The Kubernetes Operator accepts the following values: Always, IfNotPresent, Never.

The default value is Always.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: IMAGE_PULL_POLICY
              value: Always

INIT_APPDB_IMAGE_REPOSITORY

URL of the repository from which the initContainer image that contains the Application Database start-up scripts and the readiness probe is downloaded.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
     spec:
       serviceAccountName: mongodb-enterprise-operator
         containers:
           - name: mongodb-enterprise-operator
             image: <operatorVersionUrl>
             imagePullPolicy: <policyChoice>
             env:
               - name: INIT_APPDB_IMAGE_REPOSITORY
                 value: quay.io/mongodb/mongodb-enterprise-init-appdb-ubi

INIT_APPDB_VERSION

Version of the initContainer image that contains the Application Database start-up scripts and the readiness probe.

The default value is 1.0.6.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: INIT_APPDB_VERSION
              value: 1.0.6

INIT_DATABASE_IMAGE_REPOSITORY

URL of the repository from which the initContainer image that contains the MongoDB Agent start-up scripts and the readiness probe is downloaded.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: INIT_DATABASE_IMAGE_REPOSITORY
              value: quay.io/mongodb/mongodb-enterprise-init-database-ubi

INIT_DATABASE_VERSION

Version of the initContainer image that contains the MongoDB Agent start-up scripts and the readiness probe.

The default value is 1.0.2.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: INIT_DATABASE_VERSION
              value: 1.0.2

INIT_OPS_MANAGER_IMAGE_REPOSITORY

URL of the repository from which the initContainer image that contains the Ops Manager start-up scripts and the readiness probe is downloaded.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
           - name: INIT_OPS_MANAGER_IMAGE_REPOSITORY
             value: quay.io/mongodb/mongodb-enterprise-init-ops-manager-ubi

INIT_OPS_MANAGER_VERSION

Version of the initContainer image that contains the Ops Manager start-up scripts and the readiness probe.

The default value is 1.0.3.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
        serviceAccountName: mongodb-enterprise-operator
        containers:
          - name: mongodb-enterprise-operator
            image: <operatorVersionUrl>
            imagePullPolicy: <policyChoice>
            env:
              - name: INIT_OPS_MANAGER_VERSION
                value: 1.0.3

MANAGED_SECURITY_CONTEXT

Flag that determines whether or not the Kubernetes Operator inherits the securityContext settings that your Kubernetes cluster manages.

This value must be true if you want to run the Kubernetes Operator in OpenShift or in a restrictive environment.

The default value is false.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: MANAGED_SECURITY_CONTEXT
              value: false

The default value is true.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: MANAGED_SECURITY_CONTEXT
              value: true

MDB_APPDB_ASSUME_OLD_FORMAT

In Kubernetes Operator 1.20, the container registry changed for the application database image and the images use a new tag suffix. When you upgrade the Kubernetes Operator, the Kubernetes Operator automatically updates the earlier suffix, -ent, for all images that reference the new container registry to -ubi8 or the suffix set in MDB_IMAGE_TYPE or mongodb.imageType.

For example, the Kubernetes Operator changes quay.io/mongodb/mongodb-enterprise-server:4.4.5-ent to quay.io/mongodb/mongodb-enterprise-server:4.4.5-ubi8.

To stop the Kubernetes Operator from automatically updating the suffix, set MDB_APPDB_ASSUME_OLD_FORMAT or mongodb.appdbAssumeOldFormat to true. For example, you might want to stop the automatic suffix change if you’re mirroring this image from your own repository.

The default value is false, which automatically updates the image suffix.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: MDB_APPDB_ASSUME_OLD_FORMAT
              value: false

MDB_IMAGE_TYPE

The suffix of the application database image.

In Kubernetes Operator 1.20, the container registry changed for the application database image and the images use a new tag suffix. When you upgrade the Kubernetes Operator, the Kubernetes Operator automatically updates the earlier suffix, -ent, for all images that reference the new container registry to -ubi8 or the suffix set in MDB_IMAGE_TYPE or mongodb.imageType.

For example, the Kubernetes Operator changes quay.io/mongodb/mongodb-enterprise-server:4.4.5-ent to quay.io/mongodb/mongodb-enterprise-server:4.4.5-ubi8.

To stop the Kubernetes Operator from automatically updating the suffix, set MDB_APPDB_ASSUME_OLD_FORMAT or mongodb.appdbAssumeOldFormat to true. For example, you might want to stop the automatic suffix change if you’re mirroring this image from your own repository.

The default is -ubi8.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: MDB_IMAGE_TYPE
              value: ubi8

MONGODB_ENTERPRISE_DATABASE_IMAGE

URL of the MongoDB Enterprise Database image that the Kubernetes Operator deploys.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
     spec:
        serviceAccountName: mongodb-enterprise-operator
        containers:
          - name: mongodb-enterprise-operator
            image: <operatorVersionUrl>
            imagePullPolicy: <policyChoice>
            env:
             - name: MONGODB_ENTERPRISE_DATABASE_IMAGE
               value: quay.io/mongodb/mongodb-enterprise-database-ubi

OPERATOR_ENV

Label for the Kubernetes Operators deployment environment. This value affects the default timeouts and the logging level and format:

If the value is Log Level is set to Log Format is set to
dev debug text
prod info json

The default value is prod.

Example

spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: OPERATOR_ENV
              value: prod

OPS_MANAGER_IMAGE_PULL_POLICY

Pull policy for the Ops Manager images the Kubernetes Operator deploys.

The Kubernetes Operator accepts the following values: Always, IfNotPresent, and Never.

The default value is Always.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: OPS_MANAGER_IMAGE_PULL_POLICY
              value: Always

OPS_MANAGER_IMAGE_REPOSITORY

URL of the repository from which the image for an Ops Manager resource is downloaded.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
           - name: OPS_MANAGER_IMAGE_REPOSITORY
             value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi

WATCH_NAMESPACE

Namespaces that the Kubernetes Operator watches for MongoDB Kubernetes resource changes. If this namespace differs from the default, ensure that the Kubernetes Operator ServiceAccount can access this namespace.

  • To watch all namespaces, specify * and assign the ClusterRole to the mongodb-enterprise-operator ServiceAccount that you use to run the Kubernetes Operator.
  • To watch a subset of all namespaces, specify them in a comma-separated list, escape each comma with a backslash, and surround the list in quotes, such as "operator.watchNamespace=ns1\,ns2".

Watching a subset of namespaces is useful in deployments with multiple Kubernetes Operator instances, where each Kubernetes Operator instance watches a different subset of namespaces in your cluster.

Important

To deploy Ops Manager and MongoDB Kubernetes resources to one or more namespaces other than the one where you deploy the Kubernetes Operator, see Set Scope for MongoDB Enterprise Kubernetes Operator Deployment for values you must use and additional steps you might have to perform.

The default value is <metadata.namespace>.

Example

spec:
  template:
    spec:
      serviceAccountName: mongodb-enterprise-operator
      containers:
        - name: mongodb-enterprise-operator
          image: <operatorVersionUrl>
          imagePullPolicy: <policyChoice>
          env:
            - name: WATCH_NAMESPACE
              value: <testNamespace>