PMM Client docker image doesn't honor the argument paths-base

Hello,
I’m attempting to deploy pmm-client as a sidecar in K8s. Since I lack access to the root environment, I’m utilizing the --paths-base flag with a custom directory (refer to pmm-agent - PMM Client agent - Percona Monitoring and Management).

However, upon inspecting the logs of the pmm-client container, I notice the following error:

Process: failed to start: fork/exec /mnt/exporters/vmagent: no such file or directory.

When I execute into the pod and examine the default location /usr/local/percona/pmm2, I can confirm that the exporters are present there.

I’m utilizing the docker image available at Docker.

As a result, pmm-admin status shows all the agents to be in Waiting state.

Could you share what do you pass to --paths-base value?

Hi Nurlan,

We are using below config map:
PMM_AGENT_PATHS_BASE: “/mnt/pmm2”
PMM_AGENT_PATHS_EXPORTERS_BASE: “/mnt/exporters”

@nurlan we are deploying pmm-client as a sidecar in k8s

- name: pmm-client
        image: percona/pmm-client:2.39.0
        securityContext:
          runAsUser: 999
        volumeMounts:
        - name: pmm-base-path
          mountPath: /mnt/pmm2
        - name: pmm-base-path-exporters
          mountPath: /mnt/exporters
        envFrom:
        - configMapRef:
            name: pmm-conf
        ports:
        - name: vm-agent
          containerPort: 8428

The volumes

volumes:
      - name: conf
        emptyDir: {}
      - name: pmm-base-path
        emptyDir: {}
      - name: pmm-base-path-exporters

The config map contains the environment variables required to run the pmm-agent in the setup mode.

apiVersion: v1
kind: ConfigMap
metadata:
  name: pmm-conf
  labels:
    app: pmm
data:
  PMM_AGENT_SERVER_PASSWORD: admin
  PMM_AGENT_SERVER_USERNAME: admin
  PMM_AGENT_SERVER_ADDRESS: <host of the server>
  PMM_AGENT_SETUP: "1"
  PMM_AGENT_PATHS_BASE: "/mnt/pmm2"
  PMM_AGENT_PATHS_EXPORTERS_BASE: "/mnt/exporters"

I successfully determined how to execute the container without requiring root permissions. Upon inspecting the Dockerfile (https://github.com/percona/pmm/blob/main/build/docker/client/Dockerfile#L5 ), I discovered the creation of a user with the ID 1002, granting it permissions on the /usr/local/percona/pmm2 directory, where the binaries are stored. I utilized this specific user when launching the container, specifying it in the container configuration as shown below

securityContext:
  runAsUser: 1002

Though the objective has been met, the issue still persists that the pmm-client container doesn’t honor the paths-base argument.

PMM_AGENT_PATHS_EXPORTERS_BASE has higher priority then PMM_AGENT_PATHS_BASE. that’s why it’s overridding this value for exporters.
if you put your exporters into /mnt/pmm2/exporters/ then please remove PMM_AGENT_PATHS_EXPORTERS_BASE otherwise please provide proper path to exporters.