Skip to content
logo
Percona Operator for MongoDB
Custom Resource options
Initializing search
    percona/k8spsmdb-docs
    percona/k8spsmdb-docs
    • Welcome
      • System requirements
      • Design and architecture
      • Comparison with other solutions
      • Install with Helm
      • Install with kubectl
      • Install on Minikube
      • Install on Google Kubernetes Engine (GKE)
      • Install on Amazon Elastic Kubernetes Service (AWS EKS)
      • Install on Microsoft Azure Kubernetes Service (AKS)
      • Generic Kubernetes installation
      • Install on OpenShift
      • Application and system users
      • Changing MongoDB options
      • Anti-affinity and tolerations
      • Labels and annotations
      • Exposing the cluster
      • Local storage support
      • Arbiter and non-voting nodes
      • MongoDB sharding
      • Transport encryption (TLS/SSL)
      • Data at rest encryption
      • Telemetry
        • About backups
        • Configure storage for backups
        • Making scheduled backups
        • Making on-demand backup
        • Storing operations logs for point-in-time recovery
        • Restore from a previously saved backup
        • Delete the unneeded backup
      • Upgrade MongoDB and the Operator
      • Horizontal and vertical scaling
      • Multi-cluster and multi-region deployment
      • Monitor with Percona Monitoring and Management (PMM)
      • Add sidecar containers
      • Restart or pause the cluster
      • Debug and troubleshoot
      • OpenLDAP integration
      • How to use private registry
      • Creating a private S3-compatible cloud for backups
      • Restore backup to a new Kubernetes-based environment
      • How to use backups to move the external database to Kubernetes
      • Install Percona Server for MongoDB in multi-namespace (cluster-wide) mode
      • Upgrading Percona Server for MongoDB manually
      • Custom Resource options
        • Upgrade Options Section
        • Secrets section
        • Replsets Section
        • PMM Section
        • Sharding Section
        • Mongod Section
        • Backup Section
      • Percona certified images
      • Operator API
      • Frequently asked questions
      • Old releases (documentation archive)
      • Release notes index
      • Percona Operator for MongoDB 1.14.0 (2023-03-13)
      • Percona Operator for MongoDB 1.13.0 (2022-09-15)
      • Percona Operator for MongoDB 1.12.0 (2022-05-05)
      • Percona Distribution for MongoDB Operator 1.11.0 (2021-12-21)
      • Percona Distribution for MongoDB Operator 1.10.0 (2021-09-30)
      • Percona Distribution for MongoDB Operator 1.9.0 (2021-07-29)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.8.0 (2021-05-06)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.7.0 (2021-03-08)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.6.0 (2020-12-22)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.5.0 (2020-09-07)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.4.0 (2020-03-31)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.3.0 (2019-12-11)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.2.0 (2019-09-20)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.1.0 (2019-07-15)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.0.0 (2019-05-29)

    • Upgrade Options Section
    • Secrets section
    • Replsets Section
    • PMM Section
    • Sharding Section
    • Mongod Section
    • Backup Section

    Custom Resource options¶

    The operator is configured via the spec section of the deploy/cr.yaml file.

    The metadata part of this file contains the following keys:

    • name (my-cluster-name by default) sets the name of your Percona Server for MongoDB Cluster; it should include only URL-compatible characters, not exceed 22 characters, start with an alphabetic character, and end with an alphanumeric character
    • finalizers.delete-psmdb-pods-in-order if present, activates the Finalizer which controls the proper Pods deletion order in case of the cluster deletion event (on by default)
    • finalizers.delete-psmdb-pvc if present, activates the Finalizer which deletes appropriate Persistent Volume Claims after the cluster deletion event (off by default)

    The spec part of the deploy/cr.yaml file contains the following sections:

    Key Value type Default Description
    platform string kubernetes Override/set the Kubernetes platform: kubernetes or openshift
    pause boolean false Pause/resume: setting it to true gracefully stops the cluster, and setting it to false after shut down starts the cluster back.
    unmanaged boolean false Unmanaged site in cross-site replication: setting it to true forces the Operator to run the cluster in unmanaged state - nodes do not form replica sets, operator does not control TLS certificates
    crVersion string 1.14.0 Version of the Operator the Custom Resource belongs to
    image string percona/percona-server-mongodb:6.0.4-3 The Docker image of Percona Server for MongoDB to deploy (actual image names can be found in the list of certified images)
    imagePullPolicy string Always The policy used to update images
    tls.certValidityDuration string 2160h The validity duration of the external certificate for cert manager (90 days by default). This value is used only at cluster creation time and can’t be changed for existing clusters
    imagePullSecrets.name string private-registry-credentials The Kubernetes ImagePullSecret to access the custom registry
    initImage string percona/percona-server-mongodb-operator:1.14.0 An alternative image for the initial Operator installation
    initContainerSecurityContext subdoc {} A custom Kubernetes Security Context for a Container for the initImage (image, which can be used instead of the default one while the initial Operator installation)
    ClusterServiceDNSSuffix string svc.cluster.local The (non-standard) cluster domain to be used as a suffix of the Service name
    clusterServiceDNSMode string Internal Can be internal (local fully-qualified domain names will be used in replset configuration even if the replset is exposed - the default value), external (exposed MongoDB instances will use ClusterIP addresses), or ServiceMesh (turned on for the exposed Services). Being set, ServiceMesh value suprecedes multiCluster settings, and therefore these two modes cannot be combined together.
    allowUnsafeConfigurations boolean false Prevents users from configuring a cluster with unsafe parameters: starting it with less than 3 replica set instances, with an even number of replica set instances without additional arbiter, or without TLS/SSL certificates, or running a sharded cluster with less than 3 config server Pods or less than 2 mongos Pods (if false, the Operator will automatically change unsafe parameters to safe defaults). After switching to unsafe configurations permissive mode you will not be able to switch the cluster back by setting spec.allowUnsafeConfigurations key to false, the flag will be ignored
    updateStrategy string SmartUpdate A strategy the Operator uses for upgrades. Possible values are SmartUpdate, RollingUpdate and OnDelete
    ignoreAnnotations subdoc service.beta.kubernetes.io/aws-load-balancer-backend-protocol The list of annotations to be ignored by the Operator
    ignoreLabels subdoc rack The list of labels to be ignored by the Operator
    multiCluster.enabled boolean false Multi-cluster Services (MCS): setting it to true enables MCS cluster mode
    multiCluster.DNSSuffix string svc.clusterset.local The cluster domain to be used as a suffix for multi-cluster Services used by Kubernetes (svc.clusterset.local by default)
    upgradeOptions subdoc Upgrade configuration section
    secrets subdoc Operator secrets section
    replsets subdoc Operator MongoDB Replica Set section
    pmm subdoc Percona Monitoring and Management section
    sharding subdoc MongoDB sharding configuration section
    mongod subdoc Operator MongoDB Mongod configuration section
    backup subdoc Percona Server for MongoDB backups section

    Upgrade Options Section¶

    The upgradeOptions section in the deploy/cr.yaml file contains various configuration options to control Percona Server for MongoDB upgrades.

    Key upgradeOptions.versionServiceEndpoint
    Value string
    Example https://check.percona.com
    Description The Version Service URL used to check versions compatibility for upgrade
    Key upgradeOptions.apply
    Value string
    Example disabled
    Description Specifies how updates are processed by the Operator. Never or Disabled will completely disable automatic upgrades, otherwise it can be set to Latest or Recommended or to a specific version string of Percona Server for MongoDB (e.g. 6.0.4-3) that is wished to be version-locked (so that the user can control the version running, but use automatic upgrades to move between them)
    Key upgradeOptions.schedule
    Value string
    Example 0 2 \* \* \*
    Description Scheduled time to check for updates, specified in the crontab format
    Key upgradeOptions.setFCV
    Value boolean
    Example false
    Description If enabled, FeatureCompatibilityVersion (FCV) will be set to match the version during major version upgrade

    Secrets section¶

    Each spec in its turn may contain some key-value pairs. The secrets one has only two of them:

    Key secrets.key
    Value string
    Example my-cluster-name-mongodb-key
    Description The secret name for the MongoDB Internal Auth Key. This secret is auto-created by the operator if it doesn’t exist.
    Key secrets.users
    Value string
    Example my-cluster-name-mongodb-users
    Description The name of the Secrets object for the MongoDB users required to run the operator.
    Key secrets.ssl
    Value string
    Example my-custom-ssl
    Description A secret with TLS certificate generated for external communications, see Transport Layer Security (TLS) for details
    Key secrets.sslInternal
    Value string
    Example my-custom-ssl-internal
    Description A secret with TLS certificate generated for internal communications, see Transport Layer Security (TLS) for details
    Key secrets.encryptionKey
    Value string
    Example my-cluster-name-mongodb-encryption-key
    Description Specifies a secret object with the encryption key
    Key secrets.vault
    Value string
    Example my-cluster-name-vault
    Description Specifies a secret object to provide integration with HashiCorp Vault

    Replsets Section¶

    The replsets section controls the MongoDB Replica Set.

    Key replsets.name
    Value string
    Example rs 0
    Description The name of the MongoDB Replica Set
    Key replsets.size
    Value int
    Example 3
    Description The size of the MongoDB Replica Set, must be >= 3 for High-Availability
    Key replsets.configuration
    Value string
    Example
    |
    net:
    tls:
    mode: preferTLS
    operationProfiling:
    mode: slowOp
    systemLog:
    verbosity: 1
    storage:
    engine: wiredTiger
    wiredTiger:
    engineConfig:
    directoryForIndexes: false
    journalCompressor: snappy
    collectionConfig:
    blockCompressor: snappy
    indexConfig:
    prefixCompression: true
    Description Custom configuration options for mongod. Please refer to the official manual for the full list of options, and specific Percona Server for MongoDB docs.
    Key replsets.affinity.antiAffinityTopologyKey
    Value string
    Example kubernetes.io/hostname
    Description The Kubernetes topologyKey node affinity constraint for the Replica Set nodes
    Key replsets.affinity.advanced
    Value subdoc
    Example
    Description In cases where the pods require complex tuning the advanced option turns off the topologykey effect. This setting allows the standard Kubernetes affinity constraints of any complexity to be used
    Key replsets.tolerations.key
    Value string
    Example node.alpha.kubernetes.io/unreachable
    Description The Kubernetes Pod tolerations key for the Replica Set nodes
    Key replsets.tolerations.operator
    Value string
    Example Exists
    Description The Kubernetes Pod tolerations operator for the Replica Set nodes
    Key replsets.tolerations.effect
    Value string
    Example NoExecute
    Description The Kubernetes Pod tolerations effect for the Replica Set nodes
    Key replsets.tolerations.tolerationSeconds
    Value int
    Example 6000
    Description The Kubernetes Pod tolerations time limit for the Replica Set nodes
    Key replsets.priorityClassName
    Value string
    Example high priority
    Description The Kuberentes Pod priority class for the Replica Set nodes
    Key replsets.annotations
    Value string
    Example iam.amazonaws.com/role: role-arn
    Description The Kubernetes annotations metadata for the Replica Set nodes
    Key replsets.labels
    Value label
    Example rack: rack-22
    Description The Kubernetes affinity labels for the Replica Set nodes
    Key replsets.nodeSelector
    Value label
    Example disktype: ssd
    Description The Kubernetes nodeSelector affinity constraint for the Replica Set nodes
    Key replsets.storage.engine
    Value string
    Example wiredTiger
    Description Sets the storage.engine option https://docs.mongodb.com/manual/reference/configuration-options/#storage.engine`_ for the Replica Set nodes
    Key replsets.storage.wiredTiger.engineConfig.cacheSizeRatio
    Value float
    Example 0.5
    Description The ratio used to compute the storage.wiredTiger.engineConfig.cacheSizeGB option for the Replica Set nodes
    Key replsets.storage.wiredTiger.engineConfig.directoryForIndexes
    Value bool
    Example false
    Description Sets the storage.wiredTiger.engineConfig.directoryForIndexes option for the Replica Set nodes
    Key replsets.storage.wiredTiger.engineConfig.journalCompressor
    Value string
    Example snappy
    Description Sets the storage.wiredTiger.engineConfig.journalCompressor option for the Replica Set nodes
    Key replsets.storage.wiredTiger.collectionConfig.blockCompressor
    Value string
    Example snappy
    Description Sets the storage.wiredTiger.collectionConfig.blockCompressor option for the Replica Set nodes
    Key replsets.storage.wiredTiger.indexConfig.prefixCompression
    Value bool
    Example true
    Description Sets the storage.wiredTiger.indexConfig.prefixCompression option for the Replica Set nodes
    Key replsets.storage.inMemory.engineConfig.inMemorySizeRatio
    Value float
    Example 0.9
    Description The ratio used to compute the storage.engine.inMemory.inMemorySizeGb option for the Replica Set nodes
    Key replsets.livenessProbe.failureThreshold
    Value int
    Example 4
    Description Number of consecutive unsuccessful tries of the liveness probe to be undertaken before giving up
    Key replsets.livenessProbe.initialDelaySeconds
    Value int
    Example 60
    Description Number of seconds to wait after the container start before initiating the liveness probe.
    Key replsets.livenessProbe.periodSeconds
    Value int
    Example 30
    Description How often to perform a liveness probe (in seconds)
    Key replsets.livenessProbe.timeoutSeconds
    Value int
    Example 10
    Description Number of seconds after which the liveness probe times out
    Key replsets.livenessProbe.startupDelaySeconds
    Value int
    Example 7200
    Description Time after which the liveness probe is failed if the MongoDB instance didn’t finish its full startup yet
    Key replsets.readinessProbe.failureThreshold
    Value int
    Example 8
    Description Number of consecutive unsuccessful tries of the readiness probe to be undertaken before giving up
    Key replsets.readinessProbe.initialDelaySeconds
    Value int
    Example 10
    Description Number of seconds to wait after the container start before initiating the readiness probe
    Key replsets.readinessProbe.periodSeconds
    Value int
    Example 3
    Description How often to perform a readiness probe (in seconds)
    Key replsets.readinessProbe.successThreshold
    Value int
    Example 1
    Description Minimum consecutive successes for the readiness probe to be considered successful after having failed
    Key replsets.readinessProbe.timeoutSeconds
    Value int
    Example 2
    Description Number of seconds after which the readiness probe times out
    Key replsets.runtimeClassName
    Value string
    Example image-rc
    Description Name of the Kubernetes Runtime Class for Replica Set Pods
    Key replsets.sidecars.image
    Value string
    Example busybox
    Description Image for the custom sidecar container for Replica Set Pods
    Key replsets.sidecars.command
    Value array
    Example ["/bin/sh"]
    Description Command for the custom sidecar container for Replica Set Pods
    Key replsets.sidecars.args
    Value array
    Example ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
    Description Command arguments for the custom sidecar container for Replica Set Pods
    Key replsets.sidecars.name
    Value string
    Example rs-sidecar-1
    Description Name of the custom sidecar container for Replica Set Pods
    Key replsets.sidecars.volumeMounts.mountPath
    Value string
    Example /volume1
    Description Mount path of the custom sidecar container volume for Replica Set Pods
    Key replsets.sidecars.volumeMounts.name
    Value string
    Example sidecar-volume-claim
    Description Name of the custom sidecar container volume for Replica Set Pods
    Key replsets.sidecarVolumes.name
    Value string
    Example sidecar-config
    Description Name of the custom sidecar container volume for Replica Set Pods
    Key replsets.sidecarVolumes.configMap.name
    Value string
    Example myconfigmap
    Description Name of the ConfigMap for a custom sidecar container volume for Replica Set Pods
    Key replsets.sidecarVolumes.secret.secretName
    Value string
    Example sidecar-secret
    Description Name of the Secret for a custom sidecar container volume for Replica Set Pods
    Key replsets.sidecarPVCs
    Value subdoc
    Example
    Description Persistent Volume Claim for the custom sidecar container volume for Replica Set Pods
    Key replsets.podDisruptionBudget.maxUnavailable
    Value int
    Example 1
    Description The Kubernetes Pod distribution budget limit specifying the maximum value for unavailable Pods
    Key replsets.podDisruptionBudget.minAvailable
    Value int
    Example 1
    Description The Kubernetes Pod distribution budget limit specifying the minimum value for available Pods
    Key replsets.expose.enabled
    Value boolean
    Example false
    Description Enable or disable exposing MongoDB Replica Set nodes with dedicated IP addresses
    Key replsets.expose.exposeType
    Value string
    Example ClusterIP
    Description The IP address type to be exposed
    Key replsets.expose.loadBalancerSourceRanges
    Value string
    Example 10.0.0.0/8
    Description The range of client IP addresses from which the load balancer should be reachable (if not set, there is no limitations)
    Key replsets.expose.serviceAnnotations
    Value string
    Example service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
    Description The Kubernetes annotations metadata for the MongoDB mongod daemon
    Key replsets.expose.serviceLabels
    Value string
    Example rack: rack-22
    Description The Kubernetes labels for the MongoDB Replica Set Service
    Key replsets.nonvoting.enabled
    Value boolean
    Example false
    Description Enable or disable creation of Replica Set non-voting instances within the cluster
    Key replsets.nonvoting.size
    Value int
    Example 1
    Description The number of Replica Set non-voting instances within the cluster
    Key replsets.nonvoting.afinity.antiAffinityTopologyKey
    Value string
    Example kubernetes.io/hostname
    Description The Kubernetes topologyKey node affinity constraint for the non-voting nodes
    Key replsets.nonvoting.affinity.advanced
    Value subdoc
    Example
    Description In cases where the pods require complex tuning the advanced option turns off the topologykey effect. This setting allows the standard Kubernetes affinity constraints of any complexity to be used
    Key replsets.nonvoting.tolerations.key
    Value string
    Example node.alpha.kubernetes.io/unreachable
    Description The Kubernetes Pod tolerations key for the non-voting nodes
    Key replsets.nonvoting.tolerations.operator
    Value string
    Example Exists
    Description The Kubernetes Pod tolerations operator for the non-voting nodes
    Key replsets.nonvoting.tolerations.effect
    Value string
    Example NoExecute
    Description The Kubernetes Pod tolerations effect for the non-voting nodes
    Key replsets.nonvoting.tolerations.tolerationSeconds
    Value int
    Example 6000
    Description The Kubernetes Pod tolerations time limit for the non-voting nodes
    Key replsets.nonvoting.priorityClassName
    Value string
    Example high priority
    Description The Kuberentes Pod priority class for the non-voting nodes
    Key replsets.nonvoting.annotations
    Value string
    Example iam.amazonaws.com/role: role-arn
    Description The Kubernetes annotations metadata for the non-voting nodes
    Key replsets.nonvoting.labels
    Value label
    Example rack: rack-22
    Description The Kubernetes affinity labels for the non-voting nodes
    Key replsets.nonvoting.nodeSelector
    Value label
    Example disktype: ssd
    Description The Kubernetes nodeSelector affinity constraint for the non-voting nodes
    Key replsets.nonvoting.podDisruptionBudget.maxUnavailable
    Value int
    Example 1
    Description The Kubernetes Pod distribution budget limit specifying the maximum value for unavailable Pods among non-voting nodes
    Key replsets.nonvoting.podDisruptionBudget.minAvailable
    Value int
    Example 1
    Description The Kubernetes Pod distribution budget limit specifying the minimum value for available Pods among non-voting nodes
    Key replsets.nonvoting.resources.limits.cpu
    Value string
    Example 300m
    Description Kubernetes CPU limit for MongoDB container
    Key replsets.nonvoting.resources.limits.memory
    Value string
    Example 0.5G
    Description Kubernetes Memory limit for MongoDB container
    Key replsets.nonvoting.resources.requests.cpu
    Value string
    Example 300m
    Description The Kubernetes CPU requests for MongoDB container
    Key replsets.nonvoting.resources.requests.memory
    Value string
    Example 0.5G
    Description The Kubernetes Memory requests for MongoDB container
    Key replsets.nonvoting.volumeSpec.emptyDir
    Value string
    Example {}
    Description The Kubernetes emptyDir volume, i.e. the directory which will be created on a node, and will be accessible to the MongoDB Pod containers
    Key replsets.nonvoting.volumeSpec.hostPath.path
    Value string
    Example /data
    Description Kubernetes hostPath volume, i.e. the file or directory of a node that will be accessible to the MongoDB Pod containers
    Key replsets.nonvoting.volumeSpec.hostPath.type
    Value string
    Example Directory
    Description The Kubernetes hostPath volume type
    Key replsets.nonvoting.volumeSpec.persistentVolumeClaim.annotations
    Value string
    Example service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
    Description The Kubernetes annotations metadata for Persistent Volume Claim
    Key replsets.nonvoting.volumeSpec.persistentVolumeClaim.labels
    Value string
    Example rack: rack-22
    Description The Kubernetes labels metadata for Persistent Volume Claim
    Key replsets.nonvoting.volumeSpec.persistentVolumeClaim.storageClassName
    Value string
    Example standard
    Description The Kubernetes Storage Class to use with the MongoDB container Persistent Volume Claim for the non-voting nodes. Use Storage Class with XFS as the default filesystem if possible, [for better MongoDB performance](https://dba.stackexchange.com/questions/190578/is-xfs-still-the-best-choice-for-mongodb
    Key replsets.nonvoting.volumeSpec.persistentVolumeClaim.accessModes
    Value array
    Example [ "ReadWriteOnce" ]
    Description The Kubernetes Persistent Volume access modes for the MongoDB container for the non-voting nodes
    Key replsets.nonvoting.volumeSpec.persistentVolumeClaim.resources.requests.storage
    Value string
    Example 3Gi
    Description The Kubernetes Persistent Volume size for the MongoDB container for the non-voting nodes
    Key replsets.arbiter.enabled
    Value boolean
    Example false
    Description Enable or disable creation of Replica Set Arbiter nodes within the cluster
    Key replsets.arbiter.size
    Value int
    Example 1
    Description The number of Replica Set Arbiter instances within the cluster
    Key replsets.arbiter.afinity.antiAffinityTopologyKey
    Value string
    Example kubernetes.io/hostname
    Description The Kubernetes topologyKey node affinity constraint for the Arbiter
    Key replsets.arbiter.affinity.advanced
    Value subdoc
    Example
    Description In cases where the pods require complex tuning the advanced option turns off the topologykey effect. This setting allows the standard Kubernetes affinity constraints of any complexity to be used
    Key replsets.arbiter.tolerations.key
    Value string
    Example node.alpha.kubernetes.io/unreachable
    Description The Kubernetes Pod tolerations key for the Arbiter nodes
    Key replsets.arbiter.tolerations.operator
    Value string
    Example Exists
    Description The Kubernetes Pod tolerations operator for the Arbiter nodes
    Key replsets.arbiter.tolerations.effect
    Value string
    Example NoExecute
    Description The Kubernetes Pod tolerations effect for the Arbiter nodes
    Key replsets.arbiter.tolerations.tolerationSeconds
    Value int
    Example 6000
    Description The Kubernetes Pod tolerations time limit for the Arbiter nodes
    Key replsets.arbiter.priorityClassName
    Value string
    Example high priority
    Description The Kuberentes Pod priority class for the Arbiter nodes
    Key replsets.arbiter.annotations
    Value string
    Example iam.amazonaws.com/role: role-arn
    Description The Kubernetes annotations metadata for the Arbiter nodes
    Key replsets.arbiter.labels
    Value label
    Example rack: rack-22
    Description The Kubernetes affinity labels for the Arbiter nodes
    Key replsets.arbiter.nodeSelector
    Value label
    Example disktype: ssd
    Description The Kubernetes nodeSelector affinity constraint for the Arbiter nodes
    Key replsets.resources.limits.cpu
    Value string
    Example 300m
    Description Kubernetes CPU limit for MongoDB container
    Key replsets.resources.limits.memory
    Value string
    Example 0.5G
    Description Kubernetes Memory limit for MongoDB container
    Key replsets.resources.requests.cpu
    Value string
    Example 300m
    Description The Kubernetes CPU requests for MongoDB container
    Key replsets.resources.requests.memory
    Value string
    Example 0.5G
    Description The Kubernetes Memory requests for MongoDB container
    Key replsets.volumeSpec.emptyDir
    Value string
    Example {}
    Description The Kubernetes emptyDir volume, i.e. the directory which will be created on a node, and will be accessible to the MongoDB Pod containers
    Key replsets.volumeSpec.hostPath.path
    Value string
    Example /data
    Description Kubernetes hostPath volume, i.e. the file or directory of a node that will be accessible to the MongoDB Pod containers
    Key replsets.volumeSpec.hostPath.type
    Value string
    Example Directory
    Description The Kubernetes hostPath volume type
    Key replsets.volumeSpec.persistentVolumeClaim.annotations
    Value string
    Example service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
    Description The Kubernetes annotations metadata for Persistent Volume Claim
    Key replsets.volumeSpec.persistentVolumeClaim.labels
    Value string
    Example rack: rack-22
    Description The Kubernetes labels metadata for Persistent Volume Claim
    Key replsets.volumeSpec.persistentVolumeClaim.storageClassName
    Value string
    Example standard
    Description The Kubernetes Storage Class to use with the MongoDB container Persistent Volume Claim. Use Storage Class with XFS as the default filesystem if possible, [for better MongoDB performance](https://dba.stackexchange.com/questions/190578/is-xfs-still-the-best-choice-for-mongodb
    Key replsets.volumeSpec.persistentVolumeClaim.accessModes
    Value array
    Example [ "ReadWriteOnce" ]
    Description The Kubernetes Persistent Volume access modes for the MongoDB container
    Key replsets.volumeSpec.persistentVolumeClaim.resources.requests.storage
    Value string
    Example 3Gi
    Description The Kubernetes Persistent Volume size for the MongoDB container

    PMM Section¶

    The pmm section in the deploy/cr.yaml file contains configuration options for Percona Monitoring and Management.

    Key pmm.enabled
    Value boolean
    Example false
    Description Enables or disables monitoring Percona Server for MongoDB with PMM
    Key pmm.image
    Value string
    Example percona/pmm-client:2.35.0
    Description PMM Client docker image to use
    Key pmm.serverHost
    Value string
    Example monitoring-service
    Description Address of the PMM Server to collect data from the Cluster
    Key pmm.mongodParams
    Value string
    Example --environment=DEV-ENV --custom-labels=DEV-ENV
    Description Additional parameters which will be passed to the pmm-admin add mongodb command for mongod Pods
    Key pmm.mongosParams
    Value string
    Example --environment=DEV-ENV --custom-labels=DEV-ENV
    Description Additional parameters which will be passed to the pmm-admin add mongodb command for mongos Pods

    Sharding Section¶

    The sharding section in the deploy/cr.yaml file contains configuration options for Percona Server for MondoDB sharding.

    Key sharding.enabled
    Value boolean
    Example true
    Description Enables or disables Percona Server for MondoDB sharding
    Key sharding.configsvrReplSet.size
    Value int
    Example 3
    Description The number of Config Server instances within the cluster
    Key sharding.configsvrReplSet.configuration
    Value string
    Example
    |
    operationProfiling:
    mode: slowOp
    systemLog:
    verbosity: 1
    Description Custom configuration options for Config Servers. Please refer to the official manual for the full list of options
    Key sharding.configsvrReplSet.livenessProbe.failureThreshold
    Value int
    Example 4
    Description Number of consecutive unsuccessful tries of the liveness probe to be undertaken before giving up
    Key sharding.configsvrReplSet.livenessProbe.initialDelaySeconds
    Value int
    Example 60
    Description Number of seconds to wait after the container start before initiating the liveness probe
    Key sharding.configsvrReplSet.livenessProbe.periodSeconds
    Value int
    Example 30
    Description How often to perform a liveness probe (in seconds)
    Key sharding.configsvrReplSet.livenessProbe.timeoutSeconds
    Value int
    Example 10
    Description Number of seconds after which the liveness probe times out
    Key sharding.configsvrReplSet.livenessProbe.startupDelaySeconds
    Value int
    Example 7200
    Description Time after which the liveness probe is failed if the MongoDB instance didn’t finish its full startup yet
    Key sharding.configsvrReplSet.readinessProbe.failureThreshold
    Value int
    Example 3
    Description Number of consecutive unsuccessful tries of the readiness probe to be undertaken before giving up
    Key sharding.configsvrReplSet.readinessProbe.initialDelaySeconds
    Value int
    Example 10
    Description Number of seconds to wait after the container start before initiating the readiness probe
    Key sharding.configsvrReplSet.readinessProbe.periodSeconds
    Value int
    Example 3
    Description How often to perform a readiness probe (in seconds)
    Key sharding.configsvrReplSet.readinessProbe.successThreshold
    Value int
    Example 1
    Description Minimum consecutive successes for the readiness probe to be considered successful after having failed
    Key sharding.configsvrReplSet.readinessProbe.timeoutSeconds
    Value int
    Example 2
    Description Number of seconds after which the readiness probe times out
    Key sharding.configsvrReplSet.runtimeClassName
    Value string
    Example image-rc
    Description Name of the Kubernetes Runtime Class for Config Server Pods
    Key sharding.configsvrReplSet.sidecars.image
    Value string
    Example busybox
    Description Image for the custom sidecar container for Config Server Pods
    Key sharding.configsvrReplSet.sidecars.command
    Value array
    Example ["/bin/sh"]
    Description Command for the custom sidecar container for Config Server Pods
    Key sharding.configsvrReplSet.sidecars.args
    Value array
    Example ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
    Description Command arguments for the custom sidecar container for Config Server Pods
    Key sharding.configsvrReplSet.sidecars.name
    Value string
    Example rs-sidecar-1
    Description Name of the custom sidecar container for Config Server Pods
    Key sharding.configsvrReplSet.limits.cpu
    Value string
    Example 300m
    Description Kubernetes CPU limit for Config Server container
    Key sharding.configsvrReplSet.limits.memory
    Value string
    Example 0.5G
    Description Kubernetes Memory limit for Config Server container
    Key sharding.configsvrReplSet.resources.requests.cpu
    Value string
    Example 300m
    Description The Kubernetes CPU requests for Config Server container
    Key sharding.configsvrReplSet.requests.memory
    Value string
    Example 0.5G
    Description The Kubernetes Memory requests for Config Server container
    Key sharding.configsvrReplSet.expose.enabled
    Value boolean
    Example false
    Description Enable or disable exposing Config Server nodes with dedicated IP addresses
    Key sharding.configsvrReplSet.expose.exposeType
    Value string
    Example ClusterIP
    Description The IP address type to be exposed
    Key sharding.configsvrReplSet.expose.loadBalancerSourceRanges
    Value string
    Example 10.0.0.0/8
    Description The range of client IP addresses from which the load balancer should be reachable (if not set, there is no limitations)
    Key sharding.configsvrReplSet.expose.serviceAnnotations
    Value string
    Example service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
    Description The Kubernetes annotations metadata for the Config Server daemon
    Key sharding.configsvrReplSet.expose.serviceLabels
    Value string
    Example rack: rack-22
    Description The Kubernetes labels for the Config Server Service
    Key sharding.configsvrReplSet.volumeSpec.emptyDir
    Value string
    Example {}
    Description The Kubernetes emptyDir volume, i.e. the directory which will be created on a node, and will be accessible to the Config Server Pod containers
    Key sharding.configsvrReplSet.volumeSpec.hostPath.path
    Value string
    Example /data
    Description Kubernetes hostPath volume, i.e. the file or directory of a node that will be accessible to the Config Server Pod containers
    Key sharding.configsvrReplSet.volumeSpec.hostPath.type
    Value string
    Example Directory
    Description The Kubernetes hostPath volume type
    Key sharding.configsvrReplSet.volumeSpec.persistentVolumeClaim.annotations
    Value string
    Example service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
    Description The Kubernetes annotations metadata for Persistent Volume Claim
    Key sharding.configsvrReplSet.volumeSpec.persistentVolumeClaim.labels
    Value string
    Example rack: rack-22
    Description The Kubernetes labels metadata for Persistent Volume Claim
    Key sharding.configsvrReplSet.volumeSpec.persistentVolumeClaim.storageClassName
    Value string
    Example standard
    Description The Kubernetes Storage Class to use with the Config Server container Persistent Volume Claim. Use Storage Class with XFS as the default filesystem if possible, for better MongoDB performance
    Key sharding.configsvrReplSet.volumeSpec.persistentVolumeClaim.accessModes
    Value array
    Example [ "ReadWriteOnce" ]
    Description The Kubernetes Persistent Volume access modes for the Config Server container
    Key sharding.configsvrReplSet.volumeSpec.persistentVolumeClaim.resources.requests.storage
    Value string
    Example 3Gi
    Description The Kubernetes Persistent Volume size for the Config Server container
    Key sharding.mongos.size
    Value int
    Example 3
    Description The number of mongos instances within the cluster
    Key sharding.mongos.configuration
    Value string
    Example
    |
    systemLog:
    verbosity: 1
    Description Custom configuration options for mongos. Please refer to the official manual for the full list of options
    Key sharding.mongos.afinity.antiAffinityTopologyKey
    Value string
    Example kubernetes.io/hostname
    Description The Kubernetes topologyKey node affinity constraint for mongos
    Key sharding.mongos.affinity.advanced
    Value subdoc
    Example
    Description In cases where the Pods require complex tuning the advanced option turns off the topologykey effect. This setting allows the standard Kubernetes affinity constraints of any complexity to be used
    Key sharding.mongos.tolerations.key
    Value string
    Example node.alpha.kubernetes.io/unreachable
    Description The Kubernetes Pod tolerations key for mongos instances
    Key sharding.mongos.tolerations.operator
    Value string
    Example Exists
    Description The Kubernetes Pod tolerations operator for mongos instances
    Key sharding.mongos.tolerations.effect
    Value string
    Example NoExecute
    Description The Kubernetes Pod tolerations effect for mongos instances
    Key sharding.mongos.tolerations.tolerationSeconds
    Value int
    Example 6000
    Description The Kubernetes Pod tolerations time limit for mongos instances
    Key sharding.mongos.priorityClassName
    Value string
    Example high priority
    Description The Kuberentes Pod priority class for mongos instances
    Key sharding.mongos.annotations
    Value string
    Example iam.amazonaws.com/role: role-arn
    Description The Kubernetes annotations metadata for the mongos instances
    Key sharding.mongos.labels
    Value label
    Example rack: rack-22
    Description The Kubernetes affinity labels for mongos instances
    Key sharding.mongos.nodeSelector
    Value label
    Example disktype: ssd
    Description The Kubernetes nodeSelector affinity constraint for mongos instances
    Key sharding.mongos.livenessProbe.failureThreshold
    Value int
    Example 4
    Description Number of consecutive unsuccessful tries of the liveness probe to be undertaken before giving up
    Key sharding.mongos.livenessProbe.initialDelaySeconds
    Value int
    Example 60
    Description Number of seconds to wait after the container start before initiating the liveness probe
    Key sharding.mongos.livenessProbe.periodSeconds
    Value int
    Example 30
    Description How often to perform a liveness probe (in seconds)
    Key sharding.mongos.livenessProbe.timeoutSeconds
    Value int
    Example 10
    Description Number of seconds after which the liveness probe times out
    Key sharding.mongos.livenessProbe.startupDelaySeconds
    Value int
    Example 7200
    Description Time after which the liveness probe is failed if the MongoDB instance didn’t finish its full startup yet
    Key sharding.mongos.readinessProbe.failureThreshold
    Value int
    Example 3
    Description Number of consecutive unsuccessful tries of the readiness probe to be undertaken before giving up
    Key sharding.mongos.readinessProbe.initialDelaySeconds
    Value int
    Example 10
    Description Number of seconds to wait after the container start before initiating the readiness probe
    Key sharding.mongos.readinessProbe.periodSeconds
    Value int
    Example 3
    Description How often to perform a readiness probe (in seconds)
    Key sharding.mongos.readinessProbe.successThreshold
    Value int
    Example 1
    Description Minimum consecutive successes for the readiness probe to be considered successful after having failed
    Key sharding.mongos.readinessProbe.timeoutSeconds
    Value int
    Example 2
    Description Number of seconds after which the readiness probe times out
    Key sharding.mongos.runtimeClassName
    Value string
    Example image-rc
    Description Name of the Kubernetes Runtime Class for mongos Pods
    Key sharding.mongos.sidecars.image
    Value string
    Example busybox
    Description Image for the custom sidecar container for mongos Pods
    Key sharding.mongos.sidecars.command
    Value array
    Example ["/bin/sh"]
    Description Command for the custom sidecar container for mongos Pods
    Key sharding.mongos.sidecars.args
    Value array
    Example ["-c", "while true; do echo echo $(date -u) 'test' >> /dev/null; sleep 5;done"]
    Description Command arguments for the custom sidecar container for mongos Pods
    Key sharding.mongos.sidecars.name
    Value string
    Example rs-sidecar-1
    Description Name of the custom sidecar container for mongos Pods
    Key sharding.mongos.limits.cpu
    Value string
    Example 300m
    Description Kubernetes CPU limit for mongos container
    Key sharding.mongos.limits.memory
    Value string
    Example 0.5G
    Description Kubernetes Memory limit for mongos container
    Key sharding.mongos.resources.requests.cpu
    Value string
    Example 300m
    Description The Kubernetes CPU requests for mongos container
    Key sharding.mongos.requests.memory
    Value string
    Example 0.5G
    Description The Kubernetes Memory requests for mongos container
    Key sharding.mongos.expose.exposeType
    Value string
    Example ClusterIP
    Description The IP address type to be exposed
    Key sharding.mongos.expose.servicePerPod
    Value boolean
    Example true
    Description If set to true, a separate ClusterIP Service is created for each mongos instance
    Key sharding.mongos.expose.loadBalancerSourceRanges
    Value string
    Example 10.0.0.0/8
    Description The range of client IP addresses from which the load balancer should be reachable (if not set, there is no limitations)
    Key sharding.mongos.expose.serviceAnnotations
    Value string
    Example service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
    Description The Kubernetes annotations metadata for the MongoDB mongos daemon
    Key sharding.mongos.expose.serviceLabels
    Value string
    Example rack: rack-22
    Description The Kubernetes labels for the MongoDB mongos Service

    Mongod Section¶

    This section contains the Mongod configuration options. This section is deprecated in Percona Operator for MongoDB v1.12.0+, and will be unavailable in v1.14.0+. Options were moved to replsets.configuration.

    Key mongod.security.encryptionKeySecret
    Value string
    Example my-cluster-name-mongodb-encryption-key
    Description Specifies a secret object with the encryption key Please note that this option is deprecated; use spec.secrets.encryptionKey instead

    Backup Section¶

    The backup section in the deploy/cr.yaml file contains the following configuration options for the regular Percona Server for MongoDB backups.

    Key backup.enabled
    Value boolean
    Example true
    Description Enables or disables making backups
    Key backup.image
    Value string
    Example percona/percona-server-mongodb-operator:1.14.0-backup
    Description The Percona Server for MongoDB Docker image to use for the backup
    Key backup.serviceAccountName
    Value string
    Example percona-server-mongodb-operator
    Description Name of the separate privileged service account used by the Operator
    Key backup.annotations
    Value string
    Example sidecar.istio.io/inject: "false"
    Description The Kubernetes annotations metadata for the backup job
    Key backup.resources.limits.cpu
    Value string
    Example 100m
    Description Kubernetes CPU limit for backups
    Key backup.resources.limits.memory
    Value string
    Example 0.2G
    Description Kubernetes Memory limit for backups
    Key backup.resources.requests.cpu
    Value string
    Example 100m
    Description The Kubernetes CPU requests for backups
    Key backup.resources.requests.memory
    Value string
    Example 0.1G
    Description The Kubernetes Memory requests for backups
    Key backup.storages.<storage-name>.type
    Value string
    Example s3
    Description The cloud storage type used for backups. Only s3 type is currently supported
    Key backup.storages.<storage-name>.s3.insecureSkipTLSVerify
    Value boolean
    Example true
    Description Enable or disable verification of the storage server TLS certificate. Disabling it may be useful e.g. to skip TLS verification for private S3-compatible storage with a self-issued certificate
    Key backup.storages.<storage-name>.s3.credentialsSecret
    Value string
    Example my-cluster-name-backup-s3
    Description The Kubernetes secret for backups. It should contain AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY keys.
    Key backup.storages.<storage-name>.s3.bucket
    Value string
    Example
    Description The Amazon S3 bucket name for backups
    Key backup.storages.<storage-name>.s3.prefix
    Value string
    Example ""
    Description The path (sub-folder) to the backups inside the bucket
    Key backup.storages.<storage-name>.s3.uploadPartSize
    Value int
    Example 10485760
    Description The size of data chunks in bytes to be uploaded to the storage bucket (10 MiB by default)
    Key backup.storages.<storage-name>.s3.maxUploadParts
    Value int
    Example 10000
    Description The maximum number of data chunks to be uploaded to the storage bucket (10000 by default)
    Key backup.storages.<storage-name>.s3.storageClass
    Value string
    Example STANDARD
    Description The storage class name of the S3 storage
    Key backup.storages.<storage-name>.s3.region
    Value string
    Example us-east-1
    Description The AWS region to use. Please note this option is mandatory for Amazon and all S3-compatible storages
    Key backup.storages.<storage-name>.s3.endpointUrl
    Value string
    Example
    Description The endpoint URL of the S3-compatible storage to be used (not needed for the original Amazon S3 cloud)
    Key backup.storages.<storage-name>.azure.credentialsSecret
    Value string
    Example my-cluster-azure-secret
    Description The Kubernetes secret for backups. It should contain AZURE_STORAGE_ACCOUNT_NAME and AZURE_STORAGE_ACCOUNT_KEY
    Key backup.storages.<storage-name>.azure.container
    Value string
    Example my-container
    Description Name of the container for backups
    Key backup.storages.<storage-name>.azure.prefix
    Value string
    Example ""
    Description The path (sub-folder) to the backups inside the container
    Key backup.pitr.enabled
    Value boolean
    Example false
    Description Enables or disables point-in-time-recovery functionality
    Key backup.pitr.oplogSpanMin
    Value int
    Example 10
    Description Number of minutes between the uploads of oplogs
    Key backup.pitr.compressionType
    Value string
    Example gzip
    Description The point-in-time-recovery chunks compression format, can be gzip, snappy, lz4, pgzip, zstd, s2, or none
    Key backup.pitr.compressionLevel
    Value int
    Example 6
    Description The point-in-time-recovery chunks compression level (higher values result in better but slower compression)
    Key backup.tasks.name
    Value string
    Example
    Description The name of the backup
    Key backup.tasks.enabled
    Value boolean
    Example true
    Description Enables or disables this exact backup
    Key backup.tasks.schedule
    Value string
    Example 0 0 \* \* 6
    Description The scheduled time to make a backup, specified in the crontab format
    Key backup.tasks.keep
    Value int
    Example 3
    Description The amount of most recent backups to store. Older backups are automatically deleted. Set keep to zero or completely remove it to disable automatic deletion of backups
    Key backup.tasks.storageName
    Value string
    Example st-us-west
    Description The name of the S3-compatible storage for backups, configured in the storages subsection
    Key backup.tasks.compressionType
    Value string
    Example gzip
    Description The backup compression format, can be gzip, snappy, lz4, pgzip, zstd, s2, or none
    Key backup.tasks.compressionLevel
    Value int
    Example 6
    Description The backup compression level (higher values result in better but slower compression)
    Key backup.tasks.type
    Value string
    Example physical
    Description The backup type: (can be either logical (default) or physical; see the Operator backups official documentation for details

    Contact Us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: 2023-03-14
    Percona LLC and/or its affiliates, © 2009 - 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.