Skip to content

bug: Fluentd sts does not support multiple forward or http in the globalInputs #1833

@ben-dov

Description

@ben-dov

Describe the issue

The current operator code does not allow setting multiple forward or http inputs inside a single Fluentd sts, since the name conflicts.
Specifically the issue seems to be here:

			ports = append(ports, corev1.ContainerPort{
				Name:          DefaultForwardName,
				ContainerPort: forwardPort,
				Protocol:      corev1.ProtocolTCP,
			})

Since DefaultForwardName is harcoded, the operator has the error "StatefulSet.apps \"fluentd\" is invalid: spec.template.spec.containers[0].ports[2].name: Duplicate value: \"forward\"".

To Reproduce

Set the globalInputs inside the Fluentd like so:

  globalInputs:
  - forward: 
      bind: 0.0.0.0
      port: 24224
      addTagPrefix: alpha
  - forward: 
      bind: 0.0.0.0
      port: 25224
      addTagPrefix: beta

Expected behavior

Its expected that the operator will allow multiple http / forward inputs on different ports.

The simple solution can be adding the port number to the port name as a suffix, for example, forward-25224. (also for the Service created).
This can be a breaking change depending on the user implementation, and might be mitigated by keeping the name the same if http / forward exists only once.

Your Environment

- Fluent Operator version: 3.5.0

Workaround

The workaround is to create a separate Fluentd deployment for the new pipeline, or find another way to differentiate the records other than the input port.

How did you install fluent operator?

helm

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions