Search code examples
kubernetesnetdata

How to set up a MySQL collector plugin for Netdata hosted on Kubernetes?


I recently deployed Netdata on Kubernetes. And I wanted to use Netdata to record the status of Managed MySQL hosted in Linode.
I read the documentation and it said that I could set up a plugin called MySQL Collector. However, the documentation only mentioned how to edit the configuration file directly, not how to configure it for Kubernetes.
It says to edit /etc/netdata/go.d/mysql.conf, but it is in the container. Perhaps you can do it temporarily by editing it from the shell inside the container, but I don't think that's official.
How can I set up a MySQL collector in Netdata on Kubernetes?

I tried creating a folder /etc/netdata/go.d on the Kubernetes node computer anyway just to be sure and created the file there, but still could not do it. I have that folder group in the container, so I think I should be able to set it up there. But if I edit it directly, I think it will be reset after reboot.
So I came up with a way to set up one volume of /etc/netdata in Kubernetes, but I am not sure if this is a good decision. So I am not doing this because it seems dangerous.

That said, I would like to know how to officially set up a MySQL collector plugin to Netdata on Kubernetes.


Solution

  • I think you need to pass the config into the helm chart via whatever values.yaml you are using.

    Here are some of the defaults for example.

    So i think in your case:

        go.d:
          enabled: true
          path: /etc/netdata/go.d.conf
          data: |
            modules:
              pulsar: no
              prometheus: yes
              mysql: yes
    
        mysql:
          enabled: true
          path: /etc/netdata/go.d/mysql.conf
          data: |
            update_every: 1
            autodetection_retry: 0
            jobs:
              - name: some_name1
              - name: some_name1
    

    something like above to pass in the relevant config files (as per docs you read) into k8s via the Netdata helmchart.