netdata/helmchart

[Docs] Example showing how to add plugin

jonasN5 opened this issue · 9 comments

Having installed netdata on my k8s cluster with the helm chat, I'm looking to connect my remote database to it (and my uwsgi/asgi app), but I couldn't find a comprehensive example showing how to configure the default override.yaml to add such a service. I think that would be very helpful (I for one would need it).

Hi @themadmrj

Can you elaborate a bit? What plugin do you want to add? Why do you need to connect to your remote database? What database is that?

Thanks for the reply @ilyam8
I want to add the python/postgres plugin to monitor my remote postgresql database. I would like to check requests/sec or /min or memory usage.

Does remote mean external to the Kubernetes cluster?

Yes

@fzyzcjy could you help here? Looks like the same problem you solved in #189 (comment)

@ilyam8 sure. here is my config:

# NOTE put it in PARENT, NOT CHILD!!! because only 1 mysql instance. if you put on child, EACH machine will try to get the data once
parent:
  configs:
    mysql:
      enabled: true
      # NOTE use the go.d one, NOT THE python.d one
      path: /etc/netdata/go.d/mysql.conf
      data: |
        jobs:
          - name: external-mysql
            # feel free to put whatever you want, i personally prefer some templates
            dsn: '{{ .Values.mysql.username }}:{{ .Values.mysql.password }}@tcp(external-mysql:{{ .Values.mysql.port }})/'

where my mysql host is a service like mentioned by ilyam8, as follows.

apiVersion: v1
kind: Service
metadata:
  name: {{ include "external-mysql.fullname" . }} # say it is called "external-mysql"
  labels:
    {{- include "external-mysql.labels" . | nindent 4 }}
spec:
  type: ExternalName
  externalName: {{ .Values.service.externalName }} # say it is some url provided by AWS
  ports:
    - port: {{ .Values.service.port }}

in short: my actual mysql is hosted on cloud (e.g. AWS mysql instance), and i use a k8s Service to expose it as an internal service called external-mysql. then i use the config mentioned above to allow netdata parent to get it.

@themadmrj we are working on adding this case to the documentation in a best way possible. Do you still have a problem with plugin?

I did of lot of trial and error and figured it out, thanks. However I believe new users in the future would still be glad to find said documentation :)

Yes I passed this to out learn platform team :)