Skip to content

Invalid nodeSelector #97

Description

@karrth

Summary

The node selector rendering for the graylog and datanode StatefulSets are broken

Details

Values provided for the nodeSelector render as a map, not as yaml

Impact

A kustomize patch is needed for node selector, or affinity needs to be used instead

How to Reproduce?

Given a test values file of:

graylog:
  nodeSelector:
    my-key: my-value
datanode:
  nodeSelector:
    other-key: other-value

Then:

helm template graylog graylog/graylog --version 1.0.0 -f test.values.yml | yq 'select(.kind == "StatefulSet" and .metadata.name == "graylog")' | grep -B2 -A5 'nodeSelector'
    spec:
      dnsPolicy: ClusterFirst
      nodeSelector: map[my-key:my-value]
      serviceAccountName: graylog-sa
      securityContext:
        runAsUser: 1100
        runAsGroup: 1100
        fsGroup: 1100
helm template graylog graylog/graylog --version 1.0.0 -f test.values.yml | yq 'select(.kind == "StatefulSet" and .metadata.name == "graylog-datanode")' | grep -B2 -A5 'nodeSelector'
    spec:
      dnsPolicy: ClusterFirst
      nodeSelector: map[other-key:other-value]
      serviceAccountName: graylog-sa
      containers:
        - name: graylog-datanode
          image: graylog/graylog-datanode:7.0
          imagePullPolicy: IfNotPresent

Environment

  • Helm chart version: 1.0.0
  • Graylog version:
  • Kubernetes version:
  • Cloud provider / platform:

Pre-flight checks

  • helm lint ./graylog passes
  • Checked existing issues for duplicates

Steps to reproduce the issue:

  1. See "how to reproduce"

Expected behavior
Yaml rendering with something like:

  nodeSelector:
    {{- toYaml .Values.graylog.nodeSelector | nindent 8 }}

Instead of

nodeSelector: {{ .Values.graylog.nodeSelector }}

Notes for maintainers

Any additional context, logs, or screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions