pmm

by Percona

Helm chartv1.11.1App 3.11.0

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

NameDescriptionValue
image.repositoryPMM image repositorypercona/pmm-server
image.pullPolicyPMM image pull policyIfNotPresent
image.tagPMM image tag (immutable tags are recommended)3.11.0
image.imagePullSecretsGlobal Docker registry secret names as an array[]
pmmEnv.PMM_ENABLE_UPDATESEnables 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
pmmResourcesoptional Resources requested for PMM container{}
readyProbeConf.initialDelaySecondsNumber of seconds after the container has started before readiness probes is initiated1
readyProbeConf.periodSecondsHow often (in seconds) to perform the probe5
readyProbeConf.failureThresholdWhen a probe fails, Kubernetes will try failureThreshold times before giving up6

PMM secrets

NameDescriptionValue
secret.nameDefines the name of the k8s secret that holds passwords and other secretspmm-secret
secret.annotationsDefines the annotations of the k8s secret that holds passwords and other secrets{}
secret.createIf 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_passwordInitial 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.""
certsOptional 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
NameDescriptionValue
encryptionKey.backupToSecretKeep 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.secretNameName of the secret holding the copy of the encryption key. Defaults to <fullname>-encryption-key.""
encryptionKey.image.repositoryRepository for the image used to reconcile the key secretalpine/kubectl
encryptionKey.image.tagTag for the image used to reconcile the key secret1.34.1
encryptionKey.image.pullPolicyPull policy for the image used to reconcile the key secretIfNotPresent
encryptionKey.resourcesOptional resources requested for the encryption key init containers{}

PMM network configuration

NameDescriptionValue
service.nameService 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.typeKubernetes Service typeNodePort
service.ports[0].porthttps port number443
service.ports[0].targetPorttarget port to map for statefulset and ingresshttps
service.ports[0].protocolprotocol for httpsTCP
service.ports[0].nameport namehttps
service.ports[1].porthttp port number80
service.ports[1].targetPorttarget port to map for statefulset and ingresshttp
service.ports[1].protocolprotocol for httpTCP
service.ports[1].nameport namehttp
ingress.enabled-- Enable ingress controller resourcefalse
ingress.nginxInc-- Using ingress controller from NGINX Incfalse
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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpmm is pinned at v1.11.1 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