netdata/helmchart

helm chart fails using argocd

MansM opened this issue · 3 comments

MansM commented
KIND                NAMESPACE NAME                                           STATUS.      MESSAGE
v1/ConfigMap netdata.          netdata-child-sd-config-map.  SyncFailed. error validating data: ValidationError(ConfigMap): unknown field "---apiVersion" in io.k8s.api.core.v1.ConfigMap

my guestimate is that some if the "-" are rendered instead of being part of the logic...
https://github.com/netdata/helmchart/blob/master/templates/configmap.yaml

There were no changes for a while in that file, it works

helm template -s templates/configmap.yaml .

---
# Source: netdata/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: netdata-conf-parent
  labels:
    app: netdata
    chart: netdata-2.0.8
    release: RELEASE-NAME
    heritage: Helm
data:
  health:     |
      SEND_EMAIL="NO"
      SEND_SLACK="YES"
      SLACK_WEBHOOK_URL=""
      DEFAULT_RECIPIENT_SLACK=""
      role_recipients_slack[sysadmin]="${DEFAULT_RECIPIENT_SLACK}"
      role_recipients_slack[domainadmin]="${DEFAULT_RECIPIENT_SLACK}"
      role_recipients_slack[dba]="${DEFAULT_RECIPIENT_SLACK}"
      role_recipients_slack[webmaster]="${DEFAULT_RECIPIENT_SLACK}"
      role_recipients_slack[proxyadmin]="${DEFAULT_RECIPIENT_SLACK}"
      role_recipients_slack[sitemgr]="${DEFAULT_RECIPIENT_SLACK}"
  netdata:     |
      [global]
        memory mode = save
        bind to = 0.0.0.0:19999
      [plugins]
        cgroups = no
        tc = no
        enable running new plugins = no
        check for new plugins every = 72000
        python.d = no
        charts.d = no
        go.d = no
        node.d = no
        apps = no
        proc = no
        idlejitter = no
        diskspace = no
  stream:     |
      [11111111-2222-3333-4444-555555555555]
        enabled = yes
        history = 3600
        default memory mode = save
        health enabled by default = auto
        allow from = *
---
# Source: netdata/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: netdata-conf-child
  labels:
    app: netdata
    chart: netdata-2.0.8
    release: RELEASE-NAME
    heritage: Helm
data:
  go.d:     |
      modules:
        apache: yes
        bind: yes
        freeradius: yes
        lighttpd: yes
        mysql: yes
        nginx: yes
        openvpn: yes
        phpfpm: yes
        rabbitmq: yes
  kubelet:     |
      update_every: 1
      autodetection_retry: 0
      jobs:
        - url: http://127.0.0.1:10255/metrics
        - url: https://localhost:10250/metrics
          tls_skip_verify: yes
  kubeproxy:     |
      update_every: 1
      autodetection_retry: 0
      jobs:
        - url: http://127.0.0.1:10249/metrics
  netdata:     |
      [global]
        memory mode = none
      [health]
        enabled = no
  stream:     |
      [stream]
        enabled = yes
        destination = netdata:19999
        api key = 11111111-2222-3333-4444-555555555555
        timeout seconds = 60
        buffer size bytes = 1048576
        reconnect delay seconds = 5
        initial clock resync iterations = 60
---
# Source: netdata/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: netdata-child-sd-config-map
  labels:
    app: netdata
    chart: netdata-2.0.8
    release: RELEASE-NAME
    heritage: Helm
data:
  config.yml: |
    name: kubernetes
    discovery:
      k8s:
        - tags: unknown
          role: pod
          local_mode: true
    tag:
      - selector: unknown
        tags: -unknown go.d
        match:
          - tags: activemq
            expr: '{{ and (eq .Port "8161") (glob .Image "**/activemq*") }}'
          - tags: apache
            expr: '{{ and (eq .Port "80" "8080") (glob .Image "httpd*" "**/httpd*") }}'
          - tags: bind
            expr: '{{ and (eq .Port "8653") (glob .Image "**/bind*") }}'
          - tags: cockroachdb
            expr: '{{ and (eq .Port "8080") (glob .Image "**/cockroach*") }}'
          - tags: consul
            expr: '{{ and (eq .Port "8500") (glob .Image "consul*" "**/consul*") }}'
          - tags: coredns
            expr: '{{ and (eq .Port "9153") (glob .Image "**/coredns*") }}'
          - tags: fluentd
            expr: '{{ and (eq .Port "24220") (glob .Image "fluentd*" "**/fluentd*") }}'
          - tags: freeradius
            expr: '{{ and (eq .Port "18121") (glob .Image "**/freeradius*") }}'
          - tags: hdfs
            expr: '{{ and (eq .Port "50070") (glob .Image "**/hdfs*") }}'
          - tags: lighttpd
            expr: '{{ and (eq .Port "80" "8080") (glob .Image "**/lighttpd*") }}'
          - tags: lighttpd2
            expr: '{{ and (eq .Port "80" "8080") (glob .Image "**/lighttpd2*") }}'
          - tags: logstash
            expr: '{{ and (eq .Port "9600") (glob .Image "logstash*" "**/logstash*") }}'
          - tags: mysql
            expr: '{{ and (eq .Port "3306") (glob .Image "mysql*" "**/mysql*" "mariadb*" "**/mariadb*") }}'
          - tags: nginx
            expr: '{{ and (eq .Port "80" "8080") (glob .Image "nginx*" "**/nginx*") }}'
          - tags: openvpn
            expr: '{{ and (eq .Port "7505") (glob .Image "**/openvpn") }}'
          - tags: phpfpm
            expr: '{{ and (eq .Port "80" "8080") (glob .Image "**/phpfpm*" "**/php-fpm*") }}'
          - tags: rabbitmq
            expr: '{{ and (eq .Port "15672") (glob .Image "rabbitmq*" "**/rabbitmq*") }}'
          - tags: solr
            expr: '{{ and (eq .Port "8983") (glob .Image "solr*" "**/solr*") }}'
          - tags: tengine
            expr: '{{ and (eq .Port "80" "8080") (glob .Image "**/tengine*") }}'
          - tags: unbound
            expr: '{{ and (eq .Port "8953") (glob .Image "**/unbound*") }}'
          - tags: vernemq
            expr: '{{ and (eq .Port "8888") (glob .Image "**/vernemq*") }}'
          - tags: zookeeper
            expr: '{{ and (eq .Port "2181") (glob .Image "zookeeper*" "**/zookeeper*") }}'
    build:
      - selector: "!unknown go.d"
        tags: file go.d
        apply:
          - selector: activemq
            template: |
              - module: activemq
                name: activemq-{{.TUID}}
                url: http://{{.Address}}
          - selector: apache
            template: |
              - module: apache
                name: apache-{{.TUID}}
                url: http://{{.Address}}/server-status?auto
          - selector: bind
            template: |
              - module: bind
                name: bind-{{.TUID}}
                url: http://{{.Address}}/json/v1
          - selector: cockroachdb
            template: |
              - module: cockroachdb
                name: cockroachdb-{{.TUID}}
                url: http://{{.Address}}/_status/vars
          - selector: consul
            template: |
              - module: consul
                name: consul-{{.TUID}}
                url: http://{{.Address}}
          - selector: coredns
            template: |
              - module: coredns
                name: coredns-{{.TUID}}
                url: http://{{.Address}}/metrics
          - selector: fluentd
            template: |
              - module: fluentd
                name: fluentd-{{.TUID}}
                url: http://{{.Address}}
          - selector: freeradius
            template: |
              - module: freeradius
                name: freeradius-{{.TUID}}
                address: {{.PodIP}}
                port: {{.Port}}
          - selector: hdfs
            template: |
              - module: hdfs
                name: hdfs-{{.TUID}}
                url: http://{{.Address}}/jmx
          - selector: lighttpd
            template: |
              - module: lighttpd
                name: lighttpd-{{.TUID}}
                url: http://{{.Address}}/server-status?auto
          - selector: lighttpd2
            template: |
              - module: lighttpd2
                name: lighttpd2-{{.TUID}}
                url: http://{{.Address}}/server-status?format=plain
          - selector: logstash
            template: |
              - module: logstash
                name: logstash-{{.TUID}}
                url: http://{{.Address}}
          - selector: mysql
            template: |
              - module: mysql
                name: mysql-{{.TUID}}
                dsn: 'netdata@tcp({{.Address}})/'
          - selector: nginx
            template: |
              - module: nginx
                name: nginx-{{.TUID}}
                url: http://{{.Address}}/stub_status
          - selector: openvpn
            template: |
              - module: openvpn
                name: openvpn-{{.TUID}}
                address: {{.Address}}
          - selector: phpfpm
            template: |
              - module: phpfpm
                name: phpfpm-{{.TUID}}
                url: http://{{.Address}}/status?full&json
          - selector: rabbitmq
            template: |
              - module: rabbitmq
                name: rabbitmq-{{.TUID}}
                url: http://{{.Address}}
          - selector: solr
            template: |
              - module: solr
                name: solr-{{.TUID}}
                url: http://{{.Address}}
          - selector: tengine
            template: |
              - module: tengine
                name: tengine-{{.TUID}}
                url: http://{{.Address}}/us
          - selector: unbound
            template: |
              - module: unbound
                name: unbound-{{.TUID}}
                address: {{.Address}}
                use_tls: false
          - selector: vernemq
            template: |
              - module: vernemq
                name: vernemq-{{.TUID}}
                url: http://{{.Address}}/metrics
          - selector: zookeeper
            template: |
              - module: zookeeper
                name: zookeeper-{{.TUID}}
                address: {{.Address}}
    export:
      file:
        - selector: file go.d
          filename: "/export/go.d.yml"

unknown field "---apiVersion"

Where does it come from? Generate configmap.yaml using your values, lets see

MansM commented

found the issue, argocd renders v1 charts with helm2 ( https://github.com/netdata/helmchart/blob/master/Chart.yaml#L1 )
which results in:

        buffer size bytes = 1048576
        reconnect delay seconds = 5
        initial clock resync iterations = 60


---apiVersion: v1
kind: ConfigMap
metadata:
  name: netdata-child-sd-config-map
  labels:
    app: netdata

for helm3 apiVersion: v2 should be used

Helm2 will be unsupported after November anyway.