As a user, I need to have the possibility of using an official and fully supported PMM 2 client docker image without any custom modifications.
As a cloud developer, I need to use the official PMM 2 client docker image to avoid customising it every release and support all these changes. It complicates development and release processes.
We need to add the possibility of setting up PMM 2 client using the environment variables.
In order to set up pmm-agent PMM_AGENT_SETUP variable should be used. If PMM_AGENT_SETUP is true pmm-agent setup is called before pmm-agent run. The pmm-agent can be set up using two approaches: all needed information for the configuration can be provided by flags or via the environment variables. In our case the second approach should be used.
How to use PMM_AGENT_SETUP variable to set up pmm-agent:
We need to declare all needed environment variables:
|PMM_AGENT_CONFIG_FILE||configuration file path|
|PMM_AGENT_LISTEN_PORT||agent local API port|
|PMM_AGENT_SERVER_ADDRESS||PMM Server address|
|PMM_AGENT_SERVER_USERNAME||username to connect to PMM server|
|PMM_AGENT_SERVER_PASSWORD||password to connect to PMM server|
|PMM_AGENT_SERVER_INSECURE_TLS||skip PMM server TLS certificate validation|
|PMM_AGENT_PORTS_MIN||minimal allowed port number for listening sockets|
|PMM_AGENT_PORTS_MAX||maximal allowed port number for listening sockets|
|PMM_AGENT_SETUP_FORCE||remove Node with that name with all dependent services and agents if one exists|
Pay attention to the fact that the value of the PMM_AGENT_SETUP_NODE_NAME variable should consist of POD_NAMESPACE+POD_NAME. The following default values for env variables should be the following:
As soon as pmm-agent is set up we need to add needed service for PMM 2. In case of PXC it is mysql and proxysql (if proxysql is used as a proxy for PXC). For this need we should use PMM_AGENT_PRERUN_SCRIPT env variable . If variable is non-empty, entrypoint runs given shell script content with pmm-agent run running in the background. The value of this var should be the following:
We can use only PMM 2 client image , so we will officially support only PMM2 for PXCO.
- Improve PXCO to have possibility of using official PMM 2 docker client.
- Improve e2e monitoring-2-0 test.
- Update PMM 2 server k8s helm chart to the latest version.
- Test the possibility of using a PMM 2 server from another cluster.
- Check the update of the PMM 2 client.