celestiaorg / helm-charts

Celestia Helm Charts
https://celestiaorg.github.io/helm-charts/
Apache License 2.0
5 stars 5 forks source link

Could not override the `node.otelAgent.config` property, the default value is always rendered #34

Closed danijelTxFusion closed 1 month ago

danijelTxFusion commented 1 month ago

I want to provision the light node with the following values:

celestia.yaml

node:
  settings:
    nodeType: light
    home: "/home/celestia"
    secret:
      name: celestia-node-key
    ws:
      tls:
        enabled: false
      secret:
        name: celestia-node-tls
  replicaCount: 1
  containerPorts:
    p2p: 2121
    ws: 2122
    rest: 26659
    rpc: 26658
    profiling: 6060
    prometheus: 8890
  resources:
    requests:
      cpu: 2
      memory: 8Gi
    limits:
      cpu: 2
      memory: 8Gi
  command:
    - celestia
  extraArgs:
    - --metrics
    - --metrics.tls=false
    - --p2p.metrics
    - --core.ip=validator-1.celestia-arabica-11.com
    - --p2p.network=arabica
  otelAgent:
    enabled: true
    grafanaOtelSecret:
      name: celestia-otel-grafana
    config:
      receivers:
        otlp:
          protocols:
            grpc:
              endpoint: "localhost:4317"
            http:
              endpoint: "localhost:4318"
      exporters:
        prometheus:
          endpoint: "localhost:8889"
      service:
        pipelines:
          metrics:
            receivers: [ otlp ]
            exporters: [ prometheus ]
        telemetry:
          metrics:
            address: "localhost:8888"
            level: basic
          logs:
            level: INFO

service:
  internal:
    type: ClusterIP
    ports:
      p2p: 2121
      ws: 2122
      rest: 26659
      rpc: 26658
      profiling: 6060
      prometheus: 8890
    clusterIP: "None"
    annotations: {}
    sessionAffinity: None
    sessionAffinityConfig: {}
  external:
    enabled: false
    type: ClusterIP
    ports:
      p2p: 2121
      ws: 2122
      rest: 26659
      rpc: 26658
    nodePorts:
      p2p: ""
      rest: ""
      rpc: ""
      profiling: ""
      prometheus: ""
    loadBalancerIP: ""
    clusterIP: "None"
    loadBalancerSourceRanges: []
    externalTrafficPolicy: Cluster
    annotations: {}
    extraPorts: []
    sessionAffinity: None
    sessionAffinityConfig: {}

persistence:
  enabled: true
  # -- EXPERIMENTAL -- enable bmulti-volume persistence, false by default
  enabledMultiVolume: false
  dataBlocks:
    storageClass: ""
    size: 100Gi
    dataSource: {}
    selector: {}
  dataOthers:
    storageClass: ""
    size: 100Gi
    dataSource: {}
    selector: {}
  size: 100Gi

metrics:
  enabled: true
  serviceMonitor:
    enabled: true

The problem is that ConfigMap for otel is always rendered with default values defined in node.otelAgent.config. Run the following command in order to reproduce the error:

helm template -n celestia  celestia-light-node celestiaorg/celestia-node  --values celestia.yaml

The content of the ConfigMap resource for otel:

apiVersion: v1
kind: ConfigMap
metadata:
  name: celestia-light-node-celestia-node-otel-agent
  namespace: "celestia"
  labels:
    app.kubernetes.io/instance: celestia-light-node
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: celestia-node
    app.kubernetes.io/version: v0.15.0
    helm.sh/chart: celestia-node-0.2.5
    app.kubernetes.io/component: otel-agent
data:
  config.yaml: |
    exporters:
      otlphttp:
        auth:
          authenticator: basicauth/otlp
        endpoint: https://otlp-gateway-prod-us-central-0.grafana.net/otlp
      prometheus:
        endpoint: localhost:8889
    extensions:
      basicauth/otlp:
        client_auth:
          password: ${GRAFANA_OTEL_TOKEN}
          username: ${GRAFANA_OTEL_USERNAME}
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: localhost:4317
          http:
            endpoint: localhost:4318
      prometheus:
        config:
          scrape_configs:
          - job_name: ${JOB_NAME}
            scrape_interval: 10s
            static_configs:
            - targets:
              - localhost:8890
    service:
      extensions:
      - basicauth/otlp
      pipelines:
        metrics:
          exporters:
          - prometheus
          receivers:
          - otlp
      telemetry:
        logs:
          level: INFO
        metrics:
          address: localhost:8888
          level: basic

The expected output:

apiVersion: v1
kind: ConfigMap
metadata:
  name: celestia-light-node-celestia-node-otel-agent
  namespace: "celestia"
  labels:
    app.kubernetes.io/instance: celestia-light-node
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: celestia-node
    app.kubernetes.io/version: v0.15.0
    helm.sh/chart: celestia-node-0.2.5
    app.kubernetes.io/component: otel-agent
data:
  config.yaml: |
    exporters:
      prometheus:
        endpoint: localhost:8889
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: localhost:4317
          http:
            endpoint: localhost:4318
    service:
      pipelines:
        metrics:
          exporters:
          - prometheus
          receivers:
          - otlp
      telemetry:
        logs:
          level: INFO
        metrics:
          address: localhost:8888
          level: basic

Helm version:

version.BuildInfo{Version:"v3.15.2", GitCommit:"1a500d5625419a524fdae4b33de351cc4f58ec35", GitTreeState:"clean", GoVersion:"go1.22.4"}
tty47 commented 1 month ago

hey @danijelTxFusion thanks for reporting it! we're gonna check it out

smuu commented 1 month ago

Sorry for the delay, @danijelTxFusion. I'm looking into this now.

smuu commented 1 month ago

Hello @danijelTxFusion,

I found the issue and created releases with the fix:

Please note: When deploying to mocha or celestia network, please override the image to v0.16.0 and set node.settings.network to custom until the networks receive an upgrade.