psmdb-operator

by Percona

Helm chartv1.23.2App 1.23.1

A Helm chart for deploying the Percona Operator for MongoDB

About this chart

Percona Operator for MongoDB

Percona Operator for MongoDB allows users to deploy and manage Percona Server for MongoDB Clusters on Kubernetes. Useful links:

Pre-requisites

  • Kubernetes 1.32+
  • Helm v3

Installation

This chart will deploy the Operator Pod for the further Percona Server for MongoDB creation in Kubernetes.

Installing the chart

There are two ways to install operator: using separate chart with operator Custom Resource Definitions or using CRDs from the crds/ directory.

Using separate chart

Install CRD chart:

helm repo add percona https://percona.github.io/percona-helm-charts/
helm install psmdb-operator-crds percona/psmdb-operator-crds --namespace psmdb --create-namespace

Note: Deleting CRD chart will trigger deletion of all the custom resources created using the CRDs thus deleting all clusters. Uninstalling percona/psmdb-operator-crds chart should be approached with caution.

Install operator chart:

helm install my-operator percona/psmdb-operator --version 1.23.2 --namespace my-namespace

Using the crds/ directory.

helm repo add percona https://percona.github.io/percona-helm-charts/
helm install my-operator percona/psmdb-operator --version 1.23.2 --namespace my-namespace

Upgrading CRDs

By default, Helm installs CRDs from the crds/ directory only during initial installation and does not upgrade them. To upgrade CRDs, you have two options:

Option 1: Use the Separate CRD Chart

Install or upgrade CRDs using the dedicated CRD chart:

helm repo update
helm upgrade --install psmdb-operator-crds percona/psmdb-operator-crds --namespace my-namespace

Note: If you're using Helm 3.17.0 or later, use --take-ownership to take over CRDs that were previously installed via the crds/ directory:

helm upgrade --install psmdb-operator-crds percona/psmdb-operator-crds --namespace my-namespace --take-ownership

For Helm versions older than 3.17.0, manually add ownership labels and annotations before running the upgrade:

CRDS=(perconaservermongodbs.psmdb.percona.com perconaservermongodbbackups.psmdb.percona.com perconaservermongodbclustersyncs.psmdb.percona.com perconaservermongodbrestores.psmdb.percona.com)
kubectl label crds "${CRDS[@]}" app.kubernetes.io/managed-by=Helm --overwrite
kubectl annotate crds "${CRDS[@]}" meta.helm.sh/release-name=psmdb-operator-crds --overwrite
kubectl annotate crds "${CRDS[@]}" meta.helm.sh/release-namespace=my-namespace --overwrite

Option 2: Use kubectl to upgrade the CRDs

kubectl apply --server-side -f https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/v1.23.1/deploy/crd.yaml -n my-namespace

The chart can be customized using the following configurable parameters:

ParameterDescriptionDefault
image.repositoryPSMDB Operator Container image namepercona/percona-server-mongodb-operator
image.tagPSMDB Operator Container image tag1.23.1
image.pullPolicyPSMDB Operator Container pull policyIfNotPresent
imagePullSecretsPSMDB Operator Pod pull secret[]
replicaCountPSMDB Operator Pod quantity1
podDisruptionBudget.enabledCreate a PodDisruptionBudget for the operator Deploymentfalse
podDisruptionBudget.maxUnavailablePDB maxUnavailable1
podDisruptionBudget.minAvailablePDB minAvailable. Do not set together with maxUnavailable
revisionHistoryLimitQuantity of old ReplicaSets to retain for rollback purposes10
tolerationsList of node taints to tolerate[]
annotationsPSMDB Operator Deployment annotations{}
podAnnotationsPSMDB Operator Pod annotations{}
labelsPSMDB Operator Deployment labels{}
podLabelsPSMDB Operator Pod labels{}
resourcesResource requests and limits{}
nodeSelectorLabels for Pod assignment{}
podSecurityContextPod Security Context{}
watchNamespaceSet when a different from default namespace is needed to watch (comma separated if multiple needed)""
certManagerNamespaceNamespace where cert-manager is installed (used only in namespaced/non-cluster-wide mode)cert-manager
createNamespaceSet if you want to create watched namespaces with helmfalse
rbac.createIf false RBAC will not be created. RBAC resources will need to be created manuallytrue
securityContextContainer Security Context{}
serviceAccount.createIf false the ServiceAccounts will not be created. The ServiceAccounts must be created manuallytrue
serviceAccount.annotationsPSMDB Operator ServiceAccount annotations{}
logStructuredForce PSMDB operator to print JSON-wrapped log messagesfalse
logLevelPSMDB Operator logging levelINFO
disableTelemetryDisable sending PSMDB Operator telemetry data to Perconafalse
maxConcurrentReconcilesNumber of concurrent workers that can reconcile resources in Percona Server for MongoDB clusters in parallel1
livenessProbeLiveness probe for the operator container (served on the health port). Set to null to disable{httpGet: {path: /healthz, port: health}}
readinessProbeReadiness probe for the operator container (served on the health port). Set to null to disable{httpGet: {path: /readyz, port: health}}
env.reconcileIntervalPSMDB Operator reconciliation interval5s

Specify parameters using --set key=value[,key=value] argument to helm install

Alternatively a YAML file that specifies the values for the parameters can be provided like this:

helm install psmdb-operator -f values.yaml percona/psmdb-operator

Deploy the database

To deploy Percona Server for MongoDB run the following command:

helm install my-db percona/psmdb-db

See more about Percona Server for MongoDB deployment in its chart here or in the Helm chart installation guide.

Need help?

Commercial SupportCommunity Support
Enterprise-grade assistance for your mission-critical database deployments in containers and Kubernetes. Get expert guidance for complex tasks like multi-cloud replication, database migration and building platforms.Connect with our engineers and fellow users for general questions, troubleshooting, and sharing feedback and ideas.
Get Percona SupportVisit our Forum

Deploy psmdb-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has psmdb-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpsmdb-operator is pinned at v1.23.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply