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

Provide helpful error messages when ports aren't defined #188

Open
spencergilbert opened this issue Mar 25, 2022 · 3 comments
Open

Provide helpful error messages when ports aren't defined #188

spencergilbert opened this issue Mar 25, 2022 · 3 comments

Comments

@spencergilbert
Copy link
Contributor

If you've provided existingConfigMap/s but no ports for the service we don't force an error and the user only gets the Kubernetes rejection, we can create a similar experience as we have for the data dir and direct the user to correct the error.

@arve0
Copy link

arve0 commented Nov 24, 2022

Also relevant when using customConfig with api.enabled: false and no sources.vector.adress.

For example this values.yaml:

role: Agent

customConfig:
  data_dir: /vector-data-dir
  api:
    enabled: false
    address: 127.0.0.1:8686
    playground: false
  sources:
    in:
      type: stdin
  sinks:
    stdout:
      type: console
      inputs: [vector]
      encoding:
        codec: json

Gives an invalid Service.spec.ports (empty):

$ helm template -f v.yaml . | yq 'select(.kind == "Service").spec'
clusterIP: None
ports:
selector:
  app.kubernetes.io/name: vector
  app.kubernetes.io/instance: release-name
  app.kubernetes.io/component: Agent
type: ClusterIP
---
ports:
selector:
  app.kubernetes.io/name: vector
  app.kubernetes.io/instance: release-name
  app.kubernetes.io/component: Agent
type: ClusterIP

Kind of documented in if used all options need to be specified, but took me some time to figure out.

@spencergilbert
Copy link
Contributor Author

Yeah, technically documented but clearly not clear. I've done some work on a related chart and working in some additional fail usage to help catch this at "compile time" vs apply time, that I can port back over. Still a place I'd like to improve the UX and documentation.

@ogarcia
Copy link

ogarcia commented Oct 25, 2023

I think I have fallen into the same error. If I put this configuration file:

role: "Agent"

service:
  enabled: false
  
serviceHeadless:
  enabled: false
  
customConfig:
  data_dir: /vector-data-dir
  api:
    enabled: false
    address: 127.0.0.1:8686
    playground: false
  sources:
    kubernetes_logs:
      type: kubernetes_logs
  sinks:
    type: console
    inputs: [kubernetes_logs]
    encoding:
      codec: json

I get an error and it won't install:
Error: INSTALLATION FAILED: template: vector/templates/daemonset.yaml:42:10: executing "vector/templates/daemonset.yaml" at <include "vector.pod" .>: error calling include: template: vector/templates/_pod.tpl:90:8: executing "vector.pod" at <include "vector.containerPorts" .>: error calling include: template: vector/templates/_helpers.tpl:150:62: executing "vector.containerPorts" at <include "_helper.componentIter">: error calling include: template: vector/templates/_helpers.tpl:119:19: executing "_helper.componentIter" at <$options>: wrong type for value; expected map[string]interface {}; got []interface {}

The most interesting thing is that if I set api.enabled to true with the same configuration, it also gives the same error.

UPDATE: My mistake, I missed the stdout: in the sinks:. Sorry for the noise.

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

No branches or pull requests

3 participants