vectordotdev / helm-charts

Helm charts for Vector.
https://vector.dev
Mozilla Public License 2.0
103 stars 89 forks source link

Chart v0.22.0 is broken due to minReadySeconds value #306

Closed skygrammas closed 1 year ago

skygrammas commented 1 year ago

Issue

PR #291 introduced the minReadySeconds value. In the Vector Helm chart, that variable is scoped within the updateStrategy map in the Daemonset's template, but defined in the root context of values for the chart. This is breaking Chart version 0.22.0 with the following error:

Error: template: vector/templates/daemonset.yaml:15:29: executing "vector/templates/daemonset.yaml" at <.Values.minReadySeconds>: nil pointer evaluating interface {}.minReadySeconds

Configuration

role: Agent
podLabels:
  kubernetes.io/cluster-service: "true"
podAnnotations:
  prometheus.io/path: /metrics
  prometheus.io/port: "9598"
  prometheus.io/scrape: "true"
args:
  - --log-format
  - json
  - --config
  - /etc/vector/*.yaml
  - --watch-config
env:
  - name: NODE_NAME
    valueFrom:
      fieldRef:
        apiVersion: v1
        fieldPath: spec.nodeName
  - name: LOG
    value: info
  - name: HUMIO_INGEST_TOKEN
    valueFrom:
      secretKeyRef:
        key: humio-ingest-token
        name: vector-agent
  - name: HUMIO_INGEST_ENDPOINT
    valueFrom:
      secretKeyRef:
        key: humio-ingest-endpoint
        name: vector-agent
resources:
  limits:
    cpu: "8"
  requests:
    cpu: 400m
    memory: 512Mi
containerPorts:
  - containerPort: 9598
    name: http
    protocol: TCP
podPriorityClassName: cluster-addon-critical
terminationGracePeriodSeconds: 10
tolerations:
  - operator: Exists
updateStrategy:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 0
    maxSurge: 1

# Vector configuration file (within Configmap)
customConfig:
  data_dir: /vector-data-dir
  api:
    enabled: true
    address: 0.0.0.0:8686
  log_schema:
    host_key: host
    message_key: message
    source_type_key: source_type
    timestamp_key: timestamp
  sources:
    kubernetes_logs:
      type: kubernetes_logs
      self_node_name: ${NODE_NAME}
      glob_minimum_cooldown_ms: 2000
      max_line_bytes: 262144
      max_read_bytes: 10485760
    internal_logs:
      type: internal_logs
    vector_metrics:
      type: internal_metrics
  sinks:
    humio:
      type: humio_logs
      inputs:
        - kubernetes_logs
      token: "${HUMIO_INGEST_TOKEN}"
      endpoint: "${HUMIO_INGEST_ENDPOINT}"
      request:
        concurrency: adaptive
      compression: gzip
      encoding:
        codec: json
    prometheus_exporter:
      type: prometheus_exporter
      address: 0.0.0.0:9598
      default_namespace: vector
      inputs:
        - vector_metrics

Version

Chart version: 0.22.0 App version: 0.29.1

skygrammas commented 1 year ago

This seems like this issue could be easily fixed by moving the minReadySeconds value in the Daemonset specification file one line up above the {{- with .Values.updateStrategy }} block in line 14. Or alternatively, just referencing the value itself at line 15 at the root context, rather than its current scope within the updateStrategy object.

neuronull commented 1 year ago

Reproduced locally 👍 thanks for the report.

skygrammas commented 1 year ago

hey @neuronull, after posting this issue i realized that there's a PR, #305, that attempts to address this bug. would you be able to review that contribution for a potential fix?

neuronull commented 1 year ago

Ah, thanks for pointing that out. I properly linked these up now. Yep we'll get that one reviewed 👍

skygrammas commented 1 year ago

@spencergilbert do you have an idea of when version 0.22.1 of the chart will be released?

spencergilbert commented 1 year ago

Early next week, I expect.