Custom Resource options

The operator is configured via the spec section of the deploy/cr.yaml file. This file contains the following spec sections:

Key Value type Default Description
platform string kubernetes Override/set the Kubernetes platform: kubernetes or openshift. Set openshift on OpenShift 3.11+
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.
crVersion string 1.6.0 Version of the Operator the Custom Resource belongs to
image string percona/percona-server-mongodb:4.4.2-4 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
imagePullSecrets.name string private-registry-credentials The Kubernetes ImagePullSecret to access the custom registry
ClusterServiceDNSSuffix string svc.cluster.local The (non-standard) cluster domain to be used as a suffix of the Service name
runUid int 1001 The (non-standard) user ID
allowUnsafeConfigurations boolean false Prevents users from configuring a cluster with unsafe parameters such as starting the cluster with less than 3 replica set nodes, with odd number of replica set nodes and no arbiter, or without TLS/SSL certificates (if false, unsafe parameters will be automatically changed to safe defaults)
updateStrategy string SmartUpdate A strategy the Operator uses for upgrades. Possible values are SmartUpdate, RollingUpdate and OnDelete.
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 Recommended
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. 4.4.2-4) 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

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 Type 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 Type string
Example my-cluster-name-mongodb-users
Description The secret name for the MongoDB users required to run the operator. This secret is required to run the operator.

Replsets Section

The replsets section controls the MongoDB Replica Set.

Key

replsets.name

Value Type string
Example rs 0
Description The name of the MongoDB Replica Set
 
Key

replsets.size

Value Type int
Example 3
Description The size of the MongoDB Replica Set, must be >= 3 for High-Availability
 
Key

replsets.affinity.antiAffinityTopologyKey

Value Type string
Example kubernetes.io/hostname
Description The Kubernetes topologyKey node affinity constraint for the Replica Set nodes
 
Key

replsets.affinity.advanced

Value Type 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 Type string
Example node.alpha.kubernetes.io/unreachable
Description The Kubernetes Pod tolerations key for the Replica Set nodes
 
Key

replsets.tolerations.operator

Value Type string
Example Exists
Description The Kubernetes Pod tolerations operator for the Replica Set nodes
 
Key

replsets.tolerations.effect

Value Type string
Example NoExecute
Description The Kubernetes Pod tolerations effect for the Replica Set nodes
 
Key

replsets.tolerations.tolerationSeconds

Value Type int
Example 6000
Description The Kubernetes Pod tolerations time limit for the Replica Set nodes
 
Key

replsets.priorityClassName

Value Type string
Example high priority
Description The Kuberentes Pod priority class for the Replica Set nodes
 
Key

replsets.annotations.iam.amazonaws.com/role

Value Type string
Example role-arn
Description The AWS IAM role for the Replica Set nodes
 
Key

replsets.labels

Value Type label
Example rack: rack-22
Description The Kubernetes affinity labels for the Replica Set nodes
 
Key

replsets.nodeSelector

Value Type label
Example disktype: ssd
Description The Kubernetes nodeSelector affinity constraint for the Replica Set nodes
 
Key

replsets.livenessProbe.failureThreshold

Value Type int
Example 4
Description Number of consecutive unsuccessful tries of the liveness probe to be undertaken before giving up.
 
Key

replsets.livenessProbe.initialDelaySeconds

Value Type int
Example 60
Description Number of seconds to wait after the container start before initiating the liveness probe.
 
Key

replsets.livenessProbe.periodSeconds

Value Type int
Example 30
Description How often to perform a liveness probe (in seconds).
 
Key

replsets.livenessProbe.successThreshold

Value Type int
Example 1
Description Minimum consecutive successes for the liveness probe to be considered successful after having failed.
 
Key

replsets.livenessProbe.timeoutSeconds

Value Type int
Example 5
Description Number of seconds after which the liveness probe times out.
 
Key

replsets.livenessProbe.startupDelaySeconds

Value Type 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.podDisruptionBudget.maxUnavailable

Value Type int
Example 1
Description The Kubernetes Pod distribution budget limit specifying the maximum value for unavailable Pods
 
Key

replsets.podDisruptionBudget.minAvailable

Value Type int
Example 1
Description The Kubernetes Pod distribution budget limit specifying the minimum value for available Pods
 
Key

replsets.expose.enabled

Value Type boolean
Example false
Description Enable or disable exposing MongoDB Replica Set nodes with dedicated IP addresses
 
Key

replsets.expose.exposeType

Value Type string
Example ClusterIP
Description The IP address type to be exposed
 
Key

replsets.arbiter.enabled

Value Type boolean
Example false
Description Enable or disable creation of Replica Set Arbiter nodes within the cluster
 
Key

replsets.arbiter.size

Value Type int
Example 1
Description The number of Replica Set Arbiter instances within the cluster
 
Key

replsets.arbiter.afinity.antiAffinityTopologyKey

Value Type string
Example kubernetes.io/hostname
Description The Kubernetes topologyKey node affinity constraint for the Arbiter
 
Key

replsets.arbiter.affinity.advanced

Value Type 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 Type string
Example node.alpha.kubernetes.io/unreachable
Description The Kubernetes Pod tolerations key for the Arbiter nodes
 
Key

replsets.arbiter.tolerations.operator

Value Type string
Example Exists
Description The Kubernetes Pod tolerations operator for the Arbiter nodes
 
Key

replsets.arbiter.tolerations.effect

Value Type string
Example NoExecute
Description The Kubernetes Pod tolerations effect for the Arbiter nodes
 
Key

replsets.arbiter.tolerations.tolerationSeconds

Value Type int
Example 6000
Description The Kubernetes Pod tolerations time limit for the Arbiter nodes
 
Key

replsets.arbiter.priorityClassName

Value Type string
Example high priority
Description The Kuberentes Pod priority class for the Arbiter nodes
 
Key

replsets.arbiter.annotations.iam.amazonaws.com/role

Value Type string
Example role-arn
Description The AWS IAM role for the Arbiter nodes
 
Key

replsets.arbiter.labels

Value Type label
Example rack: rack-22
Description The Kubernetes affinity labels for the Arbiter nodes
 
Key

replsets.arbiter.nodeSelector

Value Type label
Example disktype: ssd
Description The Kubernetes nodeSelector affinity constraint for the Arbiter nodes
 
Key

replsets.schedulerName

Value Type string
Example default
Description The Kubernetes Scheduler
 
Key

replsets.resources.limits.cpu

Value Type string
Example 300m
Description Kubernetes CPU limit for MongoDB container
 
Key

replsets.resources.limits.memory

Value Type string
Example 0.5G
Description Kubernetes Memory limit for MongoDB container
 
Key

replsets.resources.requests.cpu

Value Type string
Example  
Description The Kubernetes CPU requests for MongoDB container
 
Key

replsets.resources.requests.memory

Value Type string
Example  
Description The Kubernetes Memory requests for MongoDB container
 
Key

replsets.volumeSpec.emptyDir

Value Type 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 Type 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 Type string
Example Directory
Description The Kubernetes hostPath volume type
 
Key

replsets.volumeSpec.persistentVolumeClaim.storageClassName

Value Type 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
 
Key

replsets.volumeSpec.persistentVolumeClaim.accessModes

Value Type array
Example [ "ReadWriteOnce" ]
Description The Kubernetes Persistent Volume access modes for the MongoDB container
 
Key

replsets.volumeSpec.persistentVolumeClaim.resources.requests.storage

Value Type 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 Type boolean
Example false
Description Enables or disables monitoring Percona Server for MongoDB with PMM
 
Key

pmm.image

Value Type string
Example percona/pmm-client:2.12.0
Description PMM Client docker image to use
 
Key

pmm.serverHost

Value Type string
Example monitoring-service
Description Address of the PMM Server to collect data from the Cluster
 
Key

pmm.mongodParams

Value Type 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 Type 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 Type boolean
Example true
Description Enables or disables Percona Server for MondoDB sharding
 
Key

sharding.configsvrReplSet.size

Value Type int
Example 3
Description The number of Config Server instances within the cluster
 
Key

sharding.configsvrReplSet.volumeSpec.emptyDir

Value Type 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 Type 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 Type string
Example Directory
Description The Kubernetes hostPath volume type
 
Key

sharding.configsvrReplSet.volumeSpec.persistentVolumeClaim.storageClassName

Value Type 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 Type array
Example [ "ReadWriteOnce" ]
Description The Kubernetes Persistent Volume access modes for the Config Server container
 
Key

sharding.configsvrReplSet.volumeSpec.persistentVolumeClaim.resources.requests.storage

Value Type string
Example 3Gi
Description The Kubernetes Persistent Volume size for the Config Server container
 
Key

sharding.mongos.size

Value Type int
Example 3
Description The number of mongos instances within the cluster
 
Key

sharding.mongos.afinity.antiAffinityTopologyKey

Value Type string
Example kubernetes.io/hostname
Description The Kubernetes topologyKey node affinity constraint for mongos
 
Key

sharding.mongos.affinity.advanced

Value Type 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 Type string
Example node.alpha.kubernetes.io/unreachable
Description The Kubernetes Pod tolerations key for mongos instances
 
Key

sharding.mongos.tolerations.operator

Value Type string
Example Exists
Description The Kubernetes Pod tolerations operator for mongos instances
 
Key

sharding.mongos.tolerations.effect

Value Type string
Example NoExecute
Description The Kubernetes Pod tolerations effect for mongos instances
 
Key

sharding.mongos.tolerations.tolerationSeconds

Value Type int
Example 6000
Description The Kubernetes Pod tolerations time limit for mongos instances
 
Key

sharding.mongos.priorityClassName

Value Type string
Example high priority
Description The Kuberentes Pod priority class for mongos instances
 
Key

sharding.mongos.annotations.iam.amazonaws.com/role

Value Type string
Example role-arn
Description The AWS IAM role for mongos instances
 
Key

sharding.mongos.labels

Value Type label
Example rack: rack-22
Description The Kubernetes affinity labels for mongos instances
 
Key

sharding.mongos.nodeSelector

Value Type label
Example disktype: ssd
Description The Kubernetes nodeSelector affinity constraint for mongos instances
 
Key

sharding.mongos.limits.cpu

Value Type string
Example 300m
Description Kubernetes CPU limit for mongos container
 
Key

sharding.mongos.limits.memory

Value Type string
Example 0.5G
Description Kubernetes Memory limit for mongos container
 
Key

sharding.mongos.resources.requests.cpu

Value Type string
Example 300m
Description The Kubernetes CPU requests for mongos container
 
Key

sharding.mongos.requests.memory

Value Type string
Example 0.5G
Description The Kubernetes Memory requests for mongos container
 
Key

sharding.mongos.expose.enabled

Value Type boolean
Example false
Description Enable or disable exposing MongoDB mongos daemons with dedicated IP addresses
 
Key

sharding.mongos.expose.exposeType

Value Type string
Example ClusterIP
Description The IP address type to be exposed
 
Key

sharding.mongos.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.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.auditLog.destination

Value Type string
Example  
Description Sets the auditLog.destination option for the MongoDB mongos daemon
 
Key

sharding.mongos.auditLog.format

Value Type string
Example BSON
Description Sets the auditLog.format option for the MongoDB mongos daemon
 
Key

sharding.mongos.auditLog.filter

Value Type string
Example {}
Description Sets the auditLog.filter option for the MongoDB mongos daemon

Mongod Section

This section contains the Mongod configuration options.

Key

mongod.net.port

Value Type int
Example 27017
Description Sets the MongoDB net.port option
 
Key

mongod.net.hostport

Value Type int
Example 0
Description Sets the Kubernetes hostPort option
 
Key

mongod.security.redactClientLogData

Value Type bool
Example false
Description Enables/disables Percona Server for MongoDB Log Redaction
 
Key

mongod.security.enableEncryption

Value Type bool
Example true
Description Enables/disables Percona Server for MongoDB data at rest encryption
 
Key

mongod.security.encryptionKeySecret

Value Type string
Example my-cluster-name-mongodb-encryption-key
Description Specifies a secret object with the encryption key
 
Key

mongod.security.encryptionCipherMode

Value Type string
Example AES256-CBC
Description Sets Percona Server for MongoDB encryption cipher mode
 
Key

mongod.setParameter.ttlMonitorSleepSecs

Value Type int
Example 60
Description Sets the Percona Server for MongoDB ttlMonitorSleepSecs option
 
Key

mongod.setParameter.wiredTigerConcurrentReadTransactions

Value Type int
Example 128
Description Sets the wiredTigerConcurrentReadTransactions option
 
Key

mongod.setParameter.wiredTigerConcurrentWriteTransactions

Value Type int
Example 128
Description Sets the wiredTigerConcurrentWriteTransactions option
 
Key

mongod.storage.engine

Value Type string
Example wiredTiger
Description Sets the storage.engine option
 
Key

mongod.storage.inMemory.engineConfig.inMemorySizeRatio

Value Type float
Example 0.9
Description The ratio used to compute the storage.engine.inMemory.inMemorySizeGb option
 
Key

mongod.storage.mmapv1.nsSize

Value Type int
Example 16
Description Sets the storage.mmapv1.nsSize option
 
Key

mongod.storage.mmapv1.smallfiles

Value Type bool
Example false
Description Sets the storage.mmapv1.smallfiles option
 
Key

mongod.storage.wiredTiger.engineConfig.cacheSizeRatio

Value Type float
Example 0.5
Description The ratio used to compute the storage.wiredTiger.engineConfig.cacheSizeGB option
 
Key

mongod.storage.wiredTiger.engineConfig.directoryForIndexes

Value Type bool
Example false
Description Sets the storage.wiredTiger.engineConfig.directoryForIndexes option
 
Key

mongod.storage.wiredTiger.engineConfig.journalCompressor

Value Type string
Example snappy
Description Sets the storage.wiredTiger.engineConfig.journalCompressor option
 
Key

mongod.storage.wiredTiger.collectionConfig.blockCompressor

Value Type string
Example snappy
Description Sets the storage.wiredTiger.collectionConfig.blockCompressor option
 
Key

mongod.storage.wiredTiger.indexConfig.prefixCompression

Value Type bool
Example true
Description Sets the storage.wiredTiger.indexConfig.prefixCompression option
 
Key

mongod.operationProfiling.mode

Value Type string
Example slowOp
Description Sets the operationProfiling.mode option
 
Key

mongod.operationProfiling.slowOpThresholdMs

Value Type int
Example 100
Description Sets the operationProfiling.slowOpThresholdMs option
 
Key

mongod.operationProfiling.rateLimit

Value Type int
Example 1
Description Sets the operationProfiling.rateLimit option
 
Key

mongod.auditLog.destination

Value Type string
Example  
Description Sets the auditLog.destination option
 
Key

mongod.auditLog.format

Value Type string
Example BSON
Description Sets the auditLog.format option
 
Key

mongod.auditLog.filter

Value Type string
Example {}
Description Sets the auditLog.filter option

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 Type boolean
Example true
Description Enables or disables making backups
 
Key

backup.debug

Value Type boolean
Example true
Description Enables or disables debug mode for backups
 
Key

backup.restartOnFailure

Value Type boolean
Example true
Description Enables or disables restarting the previously failed backup process
 
Key

backup.image

Value Type string
Example percona/percona-server-mongodb-operator:1.6.0-backup
Description The Percona Server for MongoDB Docker image to use for the backup
 
Key

backup.serviceAccountName

Value Type string
Example percona-server-mongodb-operator
Description Nname of the separate privileged service account used by the Operator
 
Key

backup.resources.limits.cpu

Value Type string
Example 100m
Description Kubernetes CPU limit for backups
 
Key

backup.resources.limits.memory

Value Type string
Example 0.2G
Description Kubernetes Memory limit for backups
 
Key

backup.resources.requests.cpu

Value Type string
Example 100m
Description The Kubernetes CPU requests for backups
 
Key

backup.resources.requests.memory

Value Type 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.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.s3.<storage-name>.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.s3.<storage-name>.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.tasks.name

Value Type string
Example  
Description The name of the backup
 
Key

backup.tasks.enabled

Value Type boolean
Example true
Description Enables or disables this exact backup
 
Key

backup.tasks.schedule

Value Type int
Example 0 0 * * 6
Description The scheduled time to make a backup, specified in the crontab format
 
Key

backup.tasks.storageName

Value Type 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 Type string
Example gzip
Description The backup compression format

Table Of Contents

Previous topic

Debug

Next topic

Percona certified images

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 professional services, contact Percona Sales.