Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: YAML parse error when rendering templates/fluentbit-fluentBit.yaml #457

Closed
rothwerx opened this issue Nov 22, 2022 · 0 comments · Fixed by #458
Closed

bug: YAML parse error when rendering templates/fluentbit-fluentBit.yaml #457

rothwerx opened this issue Nov 22, 2022 · 0 comments · Fixed by #458

Comments

@rothwerx
Copy link
Contributor

Describe the issue

When setting Kubernetes: true and populating a values.yaml for fluentbit with more than one annotation, secret, or a volume or volumeMount, the template gets rendered with an extra indent on the first line, causing a parse error.

Example:

  annotations:
      prometheus.io/path: /api/v1/metrics/prometheus
    prometheus.io/port: "2020"
    prometheus.io/scrape: "true"

To Reproduce

In values.yaml fluentbit section, add more than one annotation, volume or volumeMount:

Kuberntes: true

<snip>

fluentbit:
  image:
    repository: "kubesphere/fluent-bit"
    tag: "v1.9.9"
  resources:
    limits:
      cpu: 500m
      memory: 200Mi
    requests:
      cpu: 10m
      memory: 25Mi
  # Specify custom annotations to be added to each FluentBit pod.
  annotations:
    prometheus.io/scrape: 'true'
    prometheus.io/port: '2020'
    prometheus.io/path: '/api/v1/metrics/prometheus'
  imagePullSecrets: [ ]
  # - name: "image-pull-secret"
  secrets: [ ]
  volumes:
    - name: hostProc
      hostPath:
        path: /proc/
    - name: hostSys
      hostPath:
        path: /sys/
    - name: hostContainers
      hostPath:
        path: /var/lib/docker/containers
    - name: hostPods
      hostPath:
        path: /var/log/pods
  volumesMounts:
    - mountPath: /host/sys
      mountPropagation: HostToContainer
      name: hostSys
      readOnly: true
    - mountPath: /host/proc
      mountPropagation: HostToContainer
      name: hostProc
      readOnly: true
    - mountPath: /var/log/pods
      mountPropagation: HostToContainer
      name: hostPods
      readOnly: true
    - mountPath: /var/lib/docker/containers
      mountPropagation: HostToContainer
      name: hostContainers
      readOnly: true
</snip>

Then try to install with helm:

$ helm install fluent-operator -n fluent --values yaml/values.yaml --version 1.6.1 https://github.com/fluent/fluent-operator/releases/download/v1.6.1/fluent-operator.tgz
Error: INSTALLATION FAILED: YAML parse error on fluent-operator/templates/fluentbit-fluentBit.yaml: error converting YAML to JSON: yaml: line 31: did not find expected '-' indicator

Expected behavior

Template renders correctly and all objects get created with expected values.

Your Environment

- Fluent Operator version: 1.6.1
- Container Runtime: containerd
- Operating system: Ubuntu 20.04.3 LTS
- Kernel version: 5.4.0-97-generic

How did you install fluent operator?

  • Pulumi helm.v3.Release object
  • helm

Additional context

This problem existed as far back as v1.1.0 but at that time the template only supported secrets and annotations.

rothwerx added a commit to rothwerx/fluent-operator that referenced this issue Nov 22, 2022
Signed-off-by: Jeremiah Roth <jeremiah@sundeck.io>
benjaminhuo added a commit that referenced this issue Nov 23, 2022
fix: fluentbit template render error - fixes #457
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant