pmm
by Percona
A Helm chart for Percona Monitoring and Management (PMM)
About this chart
Percona Monitoring and Management (PMM)
Introduction
PMM is an open source database monitoring, observability and management tool.
Check more info here: https://docs.percona.com/percona-monitoring-and-management/3/
Prerequisites
- Kubernetes 1.22+
- Helm 3.2.0+
- PV provisioner support in the underlying infrastructure
Installing the Chart
To install the chart with the release name pmm:
helm repo add percona https://percona.github.io/percona-helm-charts/
helm install pmm percona/pmm
The command deploys PMM on the Kubernetes cluster in the default configuration. The Parameters section lists the parameters that can be configured during installation.
Tip: List all releases using
helm list
Uninstalling the Chart
To uninstall pmm deployment:
helm uninstall pmm
This command takes a release name and uninstalls the release.
It removes all of the resources associated with the last release of the chart as well as the release history.
Parameters
Percona Monitoring and Management (PMM) parameters
| Name | Description | Value |
|---|---|---|
image.repository | PMM image repository | percona/pmm-server |
image.pullPolicy | PMM image pull policy | IfNotPresent |
image.tag | PMM image tag (immutable tags are recommended) | 3.11.0 |
image.imagePullSecrets | Global Docker registry secret names as an array | [] |
pmmEnv.PMM_ENABLE_UPDATES | Enables a periodic check for new PMM versions as well as the ability to apply upgrades using the UI (needs to be disabled in k8s environment as updates are rolled out with 'helm update') | 0 |
pmmResources | optional Resources requested for PMM container | {} |
readyProbeConf.initialDelaySeconds | Number of seconds after the container has started before readiness probes is initiated | 1 |
readyProbeConf.periodSeconds | How often (in seconds) to perform the probe | 5 |
readyProbeConf.failureThreshold | When a probe fails, Kubernetes will try failureThreshold times before giving up | 6 |
PMM secrets
| Name | Description | Value |
|---|---|---|
secret.name | Defines the name of the k8s secret that holds passwords and other secrets | pmm-secret |
secret.annotations | Defines the annotations of the k8s secret that holds passwords and other secrets | {} |
secret.create | If true then secret will be generated by Helm chart. Otherwise it is expected to be created by user and all of its keys will be mounted as env vars. | true |
secret.pmm_password | Initial PMM password - it changes only on the first deployment, ignored if PMM was already provisioned and just restarted. If PMM admin password is not set, it will be generated. | "" |
certs | Optional certificates, if not provided PMM would use generated self-signed certificates, | {} |
PMM encryption key
PMM encrypts the credentials of monitored services with a key stored at /srv/pmm-encryption.key on the PMM data volume, or at PMM_ENCRYPTION_KEY_PATH when pmmEnv overrides it. By default the chart also keeps a copy of that key in a Kubernetes secret, so the credentials stay readable if the data volume is lost while the database survives, which is possible when PMM is pointed at an external PostgreSQL.
The key on the data volume is the one PMM encrypted with, and it always takes precedence: the secret is only read to restore a key when the volume has none, so restarts, upgrades and reinstalls over retained data keep working. The copy is brought in line with the volume when the pod starts, so restart the pod after rotating the key.
The secret is named <fullname>-encryption-key unless encryptionKey.secretName overrides it. It is not owned by the Helm release, so it outlives helm uninstall. Back up the key it holds together with the rest of your PMM configuration:
kubectl get secret <fullname>-encryption-key -o jsonpath='{.data.key}' | base64 -d > pmm-encryption.key
To supply your own key, or to restore a backed-up one, create the secret from the key file before installing the chart:
kubectl create secret generic <fullname>-encryption-key --from-file=key=pmm-encryption.key
The key must be a base64-encoded Tink keyset. Generate a new one with pmm-encryption-rotation, which ships in the PMM Server image; see PMM data encryption:
docker run --rm --entrypoint /usr/sbin/pmm-encryption-rotation percona/pmm-server:3 --generate-key > pmm-encryption.key
| Name | Description | Value |
|---|---|---|
encryptionKey.backupToSecret | Keep a copy of the PMM encryption key in a Kubernetes secret. Grants the PMM pod's service account create on secrets in the release namespace, plus get and update on the key secret itself; since serviceAccount.create is false by default that is the namespace's default service account, so every pod in the namespace running as it gets the same rights: install PMM in a namespace of its own. Token automount is turned off for the PMM pod and only the init container that manages the secret gets a token; mount one through extraVolumes and extraVolumeMounts if something in the PMM container needs the Kubernetes API. The key has to be on the data volume, so rendering fails when pmmEnv.PMM_ENCRYPTION_KEY_PATH or extraVolumeMounts put it anywhere else. | true |
encryptionKey.secretName | Name of the secret holding the copy of the encryption key. Defaults to <fullname>-encryption-key. | "" |
encryptionKey.image.repository | Repository for the image used to reconcile the key secret | alpine/kubectl |
encryptionKey.image.tag | Tag for the image used to reconcile the key secret | 1.34.1 |
encryptionKey.image.pullPolicy | Pull policy for the image used to reconcile the key secret | IfNotPresent |
encryptionKey.resources | Optional resources requested for the encryption key init containers | {} |
PMM network configuration
| Name | Description | Value |
|---|---|---|
service.name | Service name that is dns name monitoring services would send data to. monitoring-service used by default by pmm-client in Percona operators. | monitoring-service |
service.type | Kubernetes Service type | NodePort |
service.ports[0].port | https port number | 443 |
service.ports[0].targetPort | target port to map for statefulset and ingress | https |
service.ports[0].protocol | protocol for https | TCP |
service.ports[0].name | port name | https |
service.ports[1].port | http port number | 80 |
service.ports[1].targetPort | target port to map for statefulset and ingress | http |
service.ports[1].protocol | protocol for http | TCP |
service.ports[1].name | port name | http |
ingress.enabled | -- Enable ingress controller resource | false |
ingress.nginxInc | -- Using ingress controller from NGINX Inc | false |
ingress.annotations | -- Ingress annotations configuration | {} |
Deploy pmm with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pmm 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 chartpmm is pinned at v1.11.1 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