psmdb-operator
by Percona
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-ownershipto take over CRDs that were previously installed via thecrds/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:
| Parameter | Description | Default |
|---|---|---|
image.repository | PSMDB Operator Container image name | percona/percona-server-mongodb-operator |
image.tag | PSMDB Operator Container image tag | 1.23.1 |
image.pullPolicy | PSMDB Operator Container pull policy | IfNotPresent |
imagePullSecrets | PSMDB Operator Pod pull secret | [] |
replicaCount | PSMDB Operator Pod quantity | 1 |
podDisruptionBudget.enabled | Create a PodDisruptionBudget for the operator Deployment | false |
podDisruptionBudget.maxUnavailable | PDB maxUnavailable | 1 |
podDisruptionBudget.minAvailable | PDB minAvailable. Do not set together with maxUnavailable | |
revisionHistoryLimit | Quantity of old ReplicaSets to retain for rollback purposes | 10 |
tolerations | List of node taints to tolerate | [] |
annotations | PSMDB Operator Deployment annotations | {} |
podAnnotations | PSMDB Operator Pod annotations | {} |
labels | PSMDB Operator Deployment labels | {} |
podLabels | PSMDB Operator Pod labels | {} |
resources | Resource requests and limits | {} |
nodeSelector | Labels for Pod assignment | {} |
podSecurityContext | Pod Security Context | {} |
watchNamespace | Set when a different from default namespace is needed to watch (comma separated if multiple needed) | "" |
certManagerNamespace | Namespace where cert-manager is installed (used only in namespaced/non-cluster-wide mode) | cert-manager |
createNamespace | Set if you want to create watched namespaces with helm | false |
rbac.create | If false RBAC will not be created. RBAC resources will need to be created manually | true |
securityContext | Container Security Context | {} |
serviceAccount.create | If false the ServiceAccounts will not be created. The ServiceAccounts must be created manually | true |
serviceAccount.annotations | PSMDB Operator ServiceAccount annotations | {} |
logStructured | Force PSMDB operator to print JSON-wrapped log messages | false |
logLevel | PSMDB Operator logging level | INFO |
disableTelemetry | Disable sending PSMDB Operator telemetry data to Percona | false |
maxConcurrentReconciles | Number of concurrent workers that can reconcile resources in Percona Server for MongoDB clusters in parallel | 1 |
livenessProbe | Liveness probe for the operator container (served on the health port). Set to null to disable | {httpGet: {path: /healthz, port: health}} |
readinessProbe | Readiness probe for the operator container (served on the health port). Set to null to disable | {httpGet: {path: /readyz, port: health}} |
env.reconcileInterval | PSMDB Operator reconciliation interval | 5s |
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 Support | Community 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 Support | Visit 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpsmdb-operator is pinned at v1.23.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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