gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.33k stars 1.74k forks source link

teleport-kube-agent pitfall: `tokenName` vs `token_name` #33836

Open programmerq opened 10 months ago

programmerq commented 10 months ago

Current Behavior

When setting joinParams in the values.yaml file for teleport-kube-agent, it is easy to write token_name instead of tokenName.

In teleport.yaml, snake_case is used:

join_params:
  token_name: foo
  method: token

but in the helm values, camelCase is used:

joinParams:
  tokenName: foo
  method: token

It is very easy to grab token_name from a teleport.yaml example, and end up with a silent failure. The tokenName field is empty, so an empty token name is tried, and that can cause a warning and then error: WARN Empty config value file: /etc/teleport-secrets/auth-token utils/config.go:45 ... ERRO [PROC:1] Kube failed to establish connection to cluster: rpc error: code = InvalidArgument desc = missing parameter Token. pid:7.1 service/connect.go:123

Expected Behavior

The helm chart should be more helpful here. Here are some possible things that would make the experience better:

Bug details:

taraspos commented 5 months ago

I just faced the same pitfall with teleport-cluster/.

I added configuration like:

    authentication:
      local_auth: false

but it had to be camel case:

    authentication:
      localAuth: false

https://goteleport.com/docs/reference/helm-reference/teleport-cluster/#authenticationlocalauth