vectordotdev / helm-charts

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

CustomConfig: Sink should not expose port #292

Closed jkapusi closed 1 year ago

jkapusi commented 1 year ago

I have a deployment that collects logs from another vector instance, does some transformation using remap, then sends them to another vector instance.

My values look like this:

customConfig:
  sources:
    vector:
      type: vector
      address: 0.0.0.0:9000
      version: 2
  transforms:
    parser:
      ...
  sinks:
    storage:
      type: vector
      inputs: ["parser"]
      address: storagehost:9000

When I try to apply it, I got a Duplicate value: core.ServicePort{} error, in the generated service definition there are two ports defined. "vector" with port 9000, and "storage" with the same port 9000.

The helper function generates it here: https://github.com/vectordotdev/helm-charts/blob/develop/charts/vector/templates/_helpers.tpl#L145-L150

Is there any use case where sink should expose a port?

neuronull commented 1 year ago

Hi @jkapusi ,

Is there any use case where sink should expose a port?

There aren't many admittedly ... in fact prometheus_exporter might be the only one currently. But there is a use case for that.

While we might be able to alter the partial template helpers to handle this, it could get rather messy rather quickly, and we'd like to avoid adding complexity to that area if possible.

The vector sink is a bit of an outlier using the config setting named "address" on an egress setting. We actually have been recently discussing centralizing the UX on these terms address/endpoint/url etc , and this would be a good argument to do that. As such, I've created this issue to track that: https://github.com/vectordotdev/vector/issues/17074

Until that is handled though, you can either change the port values to not be the same, or you should be able to manually set the ServicePort array, which would then avoid this processing that flags the duplicate value.

jkapusi commented 1 year ago

Thank you! I used the ServicePort option and it solved my problem.