matomo

by POCKOST

Helm chartv1.5.1App 5.14.3Verified publisher

This Helm Chart deploys a highly secured Matomo instance, optimized for demanding production environments.

About this chart

Matomo by POCKOST

An another devops company. This Helm Chart deploys a highly secured Matomo instance, optimized for demanding production environments.

NameEmailUrl
POCKOST[email protected]https://pockost.com

Security Philosophy

Unlike standard deployments, this Chart enforces strict security constraints out of the box:

  • Non-Root by Default: The container runs with UID 10001.
  • Read-Only Root Filesystem: Increased protection against container escape and unauthorized modifications.
  • Zero-Trust Networking: Restricted Ingress and Egress traffic via NetworkPolicies.
  • Resource Isolation: Guaranteed CPU/RAM quotas to prevent noisy neighbor issues.

Deployment Architecture

This chart leverages a customized pockost/matomo image built directly on top of the official Matomo distribution. Out of the box, the installation comes pre-packaged with the following integrated features:

  • QueuedTracking plugin: Fully configured to stream tracking data through Redis.
  • RebelOIDC Plugin : Pre-configured to enable seamless OAuth2/OIDC authentication with your identity provider (such as Keycloak).

Persistence/Upgrade:

To ensure that Matomo version upgrades occur automatically via the Docker image, the persistent volume must never overlay the entire /var/www/html directory. The core application code is provided natively by the Docker image. Only instance-specific data should be persisted using separate volume mounts.

Only mount the necessary directories using subPath:

  • /var/www/html/config: To preserve your database credentials and settings.
  • /var/www/html/misc/user: To preserve your custom logos and assets.

Quick Start

Installation Command

helm repo add matomo oci://harbor.pockost.dev/helm-charts
helm install matomo matomo -f values.yaml

Minimal Configuration

By default, the chart automatically installs a MariaDB sub-chart in the same namespace. If you want to adapt some parameters on mariadb, you can check the helm template : https://artifacthub.io/packages/helm/cloudpirates-mariadb/mariadb

# Target Database Configuration
mariadb:
  auth:
    rootPassword: "root_matomo"
    username: "matomo"
    password: "matomo_password"
# Ingress Configuration
ingress:
  enabled: true
  hosts:
    - host: matomo.your-domain.com
      paths:
        - path: /
          pathType: ImplementationSpecific

### HTTPRoute (Gateway API)

httpRoute:
  enabled: true
  hostname: matomo.your-domain.com
  parentRefs:
    name: gateway
    namespace: gateway
    sectionName: http-wildcard

Advanced

Configuration with an External Database

mariadb:
  enabled: false # Disable sub-charts
externalDatabase:
  host: "mariadb.database.svc.cluster.local"
  username: "matomo"
  password: "matomo_password"
  name: "matomo"

Already have secret

mariadb:
  ...
  existingSecret: "mariadb-secret"

externalDatabase:
  ...
  existingSecret: "mysql-secret"

GeoIP

Mounts the entire /misc directory, allowing Matomo to auto-update its GeoIP databases without Kubernetes file-lock permission errors.

geoip:
  enabled: true

Chart Parameters

Values

KeyTypeDefaultDescription
affinityobject{}Affinity rules for pod assignment
autoscaling.enabledboolfalseEnable Horizontal Pod Autoscaler
autoscaling.maxReplicasint100
autoscaling.minReplicasint1
autoscaling.targetCPUUtilizationPercentageint80
cronJobs.archive.args[0]string"php"
cronJobs.archive.args[1]string"/var/www/html/console"
cronJobs.archive.args[2]string"core:archive"
cronJobs.archive.enabledbooltrue
cronJobs.archive.schedulestring"5 * * * *"
cronJobs.process-queued.args[0]string"php"
cronJobs.process-queued.args[1]string"/var/www/html/console"
cronJobs.process-queued.args[2]string"queuedtracking:process"
cronJobs.process-queued.enabledbooltrue
cronJobs.process-queued.schedulestring"*/1 * * * *"
externalDatabaseobject{"adapter":"mariadb","existingSecret":"","host":"mariadb.database.svc.cluster.local","name":"matomo","network":{"ipBlock":"","namespace":"mariadb","podLabels":{"app.kubernetes.io/name":"mariadb"}},"password":"change_me","tablePrefix":"matomo_","username":"matomo"}External database configuration (used only if mariadb.enabled is false)
externalDatabase.hoststring"mariadb.database.svc.cluster.local"Hostname or IP address
externalDatabase.namestring"matomo"Name of the external database
externalDatabase.network.ipBlockstring""CIDR block (IP range) if the database is located outside the cluster
externalDatabase.network.namespacestring"mariadb"Namespace where the database resides if it is inside the cluster
externalDatabase.network.podLabelsobject{"app.kubernetes.io/name":"mariadb"}Pod labels used to target the database pods for Egress rules
externalDatabase.passwordstring"change_me"Password for the external database connection (ignored if existingSecret is set)
externalDatabase.tablePrefixstring"matomo_"Prefix for Matomo database tables to avoid conflicts
extraEnvsobject{"PHP_MEMORY_LIMIT":"512M"}Extra environment variables to pass directly to the Matomo container
extraVolumeMountslist[]Extra volume mounts for the container
extraVolumeslist[]Extra volumes for the pod
fullnameOverridestring""String to fully override fullname template
geoipobject{"enabled":false}Add volumeMounts on misc/ to have compatibility with geoIP
httpRoute.annotationsobject{}HTTPRoute annotations.
httpRoute.enabledboolfalseHTTPRoute enabled.
httpRoute.hostnamestring"chart-example.local"Target hostname for the application
httpRoute.parentRefsobject{"name":"gateway","namespace":"gateway","sectionName":"http-wildcard"}Gateway target configuration
httpRoute.parentRefs.namestring"gateway"Name of the target Gateway global resource
httpRoute.parentRefs.namespacestring"gateway"Namespace where the target Gateway is deployed
httpRoute.parentRefs.sectionNamestring"http-wildcard"Specific listener section name to attach
image.pullPolicystring"Always"Image pull policy
image.repositorystring"docker.io/pockost/matomo"Image repository for phpMyAdmin
image.tagstring""Image tag (overrides the chart's appVersion)
imagePullSecretslist[]Secrets for pulling images from private registries
ingress.annotationsobject{}Ingress annotations
ingress.classNamestring""Ingress Class Name
ingress.enabledboolfalseEnable Ingress controller resource
ingress.hostslist[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}]Ingress host configurations
ingress.tlslist[]Ingress TLS configuration
listenerSet.annotationsobject{}Additional annotations for the ListenerSet resource
listenerSet.enabledboolfalseEnable Gateway API ListenerSet resource and link it to the HTTPRoute
listenerSet.listenerslist[]Custom listeners (defaults to HTTPS:443 with -tls if empty)
listenerSet.parentRefobject{"name":"","namespace":""}Reference to the parent Gateway
listenerSet.sectionNamestring""Optional listener name in the ListenerSet that the HTTPRoute should target
livenessProbe.enabledbooltrueLiveness probe configuration
livenessProbe.failureThresholdint3
livenessProbe.httpGet.pathstring"/"
livenessProbe.httpGet.portstring"http"
livenessProbe.initialDelaySecondsint90
livenessProbe.periodSecondsint15
livenessProbe.timeoutSecondsint15
mariadbobject{"auth":{"database":"matomo","existingSecret":"","password":"change_me","rootPassword":"root_change_me","username":"matomo"},"containerSecurityContext":{"enabled":true,"readOnlyRootFilesystem":true,"runAsGroup":10001,"runAsUser":10001},"enabled":true,"networkPolicy":{"enabled":true},"podSecurityContext":{"enabled":true,"fsGroup":10001},"resources":{"limits":{"cpu":"500m","ephemeral-storage":"1Gi","memory":"512Mi"},"requests":{"cpu":"250m","ephemeral-storage":"50Mi","memory":"256Mi"}},"service":{"clusterIP":"None","type":"ClusterIP"}}External chart mariabd : oci://registry-1.docker.io/cloudpirates/mariadb
mariadb.serviceobject{"clusterIP":"None","type":"ClusterIP"}PRODUCTION & SECURITY DEFAULTS (Required by Kube-Score)
nameOverridestring""String to partially override fullname template
networkPolicy.egressRulesobject{"allowDns":true,"allowInternet":true,"extraEgress":[]}Egress rules (Allow traffic to DNS and MySQL)
networkPolicy.enabledbooltrueEnable NetworkPolicy for phpMyAdmin pods
networkPolicy.ingressRulesobject{"allowFromGatewayNamespace":false,"allowFromIngressNamespace":true,"allowInternal":true,"extraIngress":[],"gatewayNamespaceLabels":{"kubernetes.io/metadata.name":"envoy"},"ingressControllerNamespaceLabels":{"kubernetes.io/metadata.name":"kube-system"}}Ingress rules (Allow traffic on HTTP port)
nodeSelectorobject{}Node labels for pod assignment
persistence.accessModestring"ReadWriteOnce"Access mode for the persistent volume
persistence.annotationsobject{}Annotations for the persistent volume claim
persistence.enabledbooltrueEnable persistent volume for matomo-data
persistence.sizestring"2Gi"Size of the persistent volume
persistence.storageClassNamestring"default"Storage class for the persistent volume
podAnnotationsobject{}Annotations for the pods
podDisruptionBudget.enabledbooltrueEnable PodDisruptionBudget for high availability during maintenance
podSecurityContext.fsGroupint10001Group ID for volumes
podSecurityContext.runAsGroupint10001Group ID for the pod processes
podSecurityContext.runAsNonRootbooltrueEnable privilege separation (non-root)
podSecurityContext.runAsUserint10001User ID for the pod processes
readinessProbe.enabledbooltrueReadiness probe configuration
readinessProbe.failureThresholdint3
readinessProbe.httpGet.pathstring"/matomo.php"
readinessProbe.httpGet.portstring"http"
readinessProbe.initialDelaySecondsint45
readinessProbe.periodSecondsint15
readinessProbe.timeoutSecondsint15
redisobject{"architecture":"standalone","containerSecurityContext":{"enabled":true,"readOnlyRootFilesystem":true,"runAsGroup":10001,"runAsUser":10001},"enabled":true,"networkPolicy":{"enabled":true},"podSecurityContext":{"enabled":true,"fsGroup":10001},"resources":{"limits":{"cpu":"100m","ephemeral-storage":"100Mi","memory":"128Mi"},"requests":{"cpu":"50m","ephemeral-storage":"50Mi","memory":"128Mi"}}}External chart redis : oci://registry-1.docker.io/cloudpirates/redis
replicaCountint1Number of desired pods
resources.limitsobject{"cpu":"1000m","ephemeral-storage":"1Gi","memory":"1Gi"}Resource limits (CPU, Memory, Ephemeral Storage)
resources.requestsobject{"cpu":"500m","ephemeral-storage":"1Gi","memory":"512Mi"}Resource requests (CPU, Memory, Ephemeral Storage)
securityContext.allowPrivilegeEscalationboolfalseDisallow privilege escalation for the container
securityContext.capabilitiesobject{"drop":["ALL"]}Capabilities to drop for security hardening
securityContext.readOnlyRootFilesystembooltrueMount the container's root filesystem as read-only
service.portint80Service port
service.targetPortint9000Target port
service.typestring"ClusterIP"Kubernetes Service type
serviceAccount.annotationsobject{}Annotations to add to the ServiceAccount
serviceAccount.createbooltrueSpecifies whether a ServiceAccount should be created
serviceAccount.namestring""The name of the ServiceAccount to use (generated if not set)
test.enabledbooltrue
test.imageobject{"repository":"docker.io/library/busybox","tag":"1.36.1"}Image for chart testing pods
test.livenessProbeobject{}Liveness probe for the test pod
test.readinessProbeobject{}Readiness probe for the test pod
test.securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":10001,"runAsNonRoot":true,"runAsUser":10001}Security context for the test pod
tolerationslist[]Tolerations for pod assignment

Deploy matomo with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has matomo 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 chartmatomo is pinned at v1.5.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