Page MenuHomePhabricator

Matomo K8s migration: Create Helm chart
Open, MediumPublic

Description

Per IRC conversation with Service Ops,

inflatador: you're going to want to use more or less a similar setup to mediawiki, so in deployment-charts you'd use create_new_service.sh and choose lamp, and build your matomo image on top of a php-fpm image

Matomo has its own example helm chart here .

Creating this ticket to:

  • Write a net-new Helm chart for running Matomo on the dse-k8s eqiad cluster
  • Ensure the AIAgents core plugin is enabled (ref T438862)
  • Verify operation

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Fix path for MarketingCampaignsReporting pluginrepos/data-engineering/matomo/oci-image!10bkingplugin_pathmain
add `EnvironmentVariables` pluginrepos/data-engineering/matomo/oci-image!9bkingenvvarsmain
Customize query in GitLab

Event Timeline

Matomo has a plugin that supports some configuration via environment variables , we will using those first rather than trying to inject a templated php.ini file. But that means we'll need to build that in to the Matomo image itself.

Non-comprehensive list of values we'll need to implement via envvars:

[database]
host = "localhost"
username = "piwik"
password = "[REDACTED]"
dbname = "piwik"
tables_prefix = "piwik_"
adapter = "MYSQLI"

[mail]
username = "example_user"
password = "[REDACTED]"


[General]
salt = [32-character string]
trusted_hosts[] = "piwik.wikimedia.org"
trusted_hosts[] = "wikimediafoundation.org"

This exposes another problem: Matomo needs to write to its config.ini.php to make changes (such as if a user installs a plugin). But these changes would be lost on pod restart. We could use CephFS to persist the config, but then how do we keep track of the running state, roll back from bad config, etc? We could potentially schedule periodic backups of the CephFS share. I don't want to overengineer this, as it's a very stable and low-traffic website, but I wanted to record these thoughts in case we need refactor or document later.

Per conversation with @BTullis , there are existing integrations for the GeoIP databases, we will need a validating admission policy to handle them.

Mentioned in SAL (#wikimedia-operations) [2026-09-29T16:35:21Z] <inflatador> bking@cephosd1001 sudo radosgw-admin user create --uid=matomo --display-name="Matomo on K8s" T436186

bking triaged this task as Medium priority.Tue, Oct 6, 3:35 PM