How to install pmm-agent into docker container.

Hello, I’m trying to implement Percona Monitoring and Management system into my current Percona MySQL servers.
There is a docker image for pmm-server but there isn’t one for pmm-agent. I’ve tried pmm agent by installing on ubuntu virtual machine and it works great! Now I’m wondering how can I do the same for docker. All of my Perconal Servers are running on kubernetes. So I can either install pmm-agent right into percona server dockerfile or I can use sidecar container for pmm-agent.
But it’s not clear for me to how can I do this with dockerfile. All steps should be noninteractive, however right now I have to exec into container and run the initial configs. Any ideas?

Oh well, I just know I can’t even install pmm-server on docker. If I bind /var/lib/mysql to host path it doesn’t work. Which means I can’t use it on Kubernetes cluster.
Only working solution is use no volumes at all or use it on docker volumes. I guess this software developers doesn’t heard of docker or kubernetes.

Hi rnmkr

Thank you for your feedback on PMM, and we’re also happy to hear about your usage of Percona Server on Kuberntetes! Are you using an Operator, if so which? I’d be interested to know

Regarding pmm-agent, are you referring to the command line tool pmm-admin ? We have a docker container for this: [url]Docker Hub

Regarding PMM Server we recently produced a build that ought ot work with OpenShift [url]Docker Hub

I’m not sure though that it will help you with the volumes mapping issue. What do you suggest we do in this case?

I’ve also asked an Engineer to review this case and provide an opinion. Thanks !

I’m not using any operator, what operator are you assuming of by the way?

Oh thanks for the docker hub link. Yes that’s the pmm-client https://www.percona.com/doc/percona-…pmm-admin.html right? Any documentation on how to use that? At least supported environment variables?

I’m not sure openshift will work for me, haven’t tried yet.

This issue is not related to kubernetes directly. This bug is reproducable without kubernetes.
Steps:

  1. pull percona/pmm-server image.
  2. run this command
    docker run -d \ -p 80:80 \ -v /my/sql/data:/var/lib/mysql \ -v /my/consul/data:/opt/consul-data \ -v /my/prometheus/data:/opt/prometheus/data \ -v /my/grafana/data:/var/lib/grafana \ –name pmm-server \ –restart always \ percona/pmm-server:latest assuming pmm-server’s data will be saved at host machine’s following locations. /my/sql/data, /my/consul/data, /my/prometheus/data, /my/grafana/data
    But it won’t work. Check pmm-server log.

Edit: Sorry my post format is broken when I save. Hope you will get my commands.

Hi rnmkr,

if you need to run pmm-server in kubernetes, please use our helm chart - [url]https://github.com/Percona-Lab/percona-openshift/tree/master/helm/helm-pmm-server[/url]
keep in mind, pmm-server will run on 8443 port (not 80, not 433)

if you want to run pmm-client in docker you can use [url]Docker Hub image
variables are
​​​​​​​ - PMM_SERVER=pmm-server-service

  • PMM_USER=pmm
  • PMM_PASSWORD=pmm
  • DB_TYPE=mysql
  • DB_HOST=ps
  • DB_PORT=3306
  • DB_USER=root
  • DB_PASSWORD=secret

you can find more examples of here - ​​​​​​​[url]https://gist.github.com/delgod/f8d071d47dbaa57e7cad49bdb219b7d8[/url]

Mykola Thanks for reply. I will definitely try out these docker images soon. Quick question, how do I use the helm charts? I mean what is the helm repo URL?
Example, If I were to install prometheus operator I’d do something like this:

Install helm [url]https://docs.helm.sh/using_helm/[/url] then run: helm repo add coreos [url]https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/[/url] helm install coreos/prometheus-operator --name prometheus-operator --namespace monitoring helm install coreos/kube-prometheus --name kube-prometheus --namespace monitoring I couldn’t find related information on the linked github.

please use commands below

git clone https://github.com/Percona-Lab/percona-openshift.git
cd percona-openshift/helm/helm-pmm-server/
helm install --name monitoring --set platform=kubernetes .

Mykola I have followed by Your instruction (openshift 3.11). It looks fine until container start. Do You have any idea what can be wrong?

helm install --name monitoring --namespace=alsz-test . -f values.yaml

PV&PVC look fine.
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
pmmdata-monitoring-0 Bound test-pv 20Gi RWO test-nfs 10m

Pod in Crash Loop Back-off

Logs:

  • [[ 1000700000 != 1000 ]]
  • sed -e ‘s^x:1000:^x:1000700000:^’ /etc/passwd
  • cat /tmp/passwd
    bash: line 6: /etc/passwd: Permission denied