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

K8S_AUTH_MOUNT env variable not working #94

Open
jonnylangefeld opened this issue Dec 20, 2022 · 1 comment
Open

K8S_AUTH_MOUNT env variable not working #94

jonnylangefeld opened this issue Dec 20, 2022 · 1 comment

Comments

@jonnylangefeld
Copy link
Contributor

jonnylangefeld commented Dec 20, 2022

The help says

  -k8s-auth-mount string
        The vault mount where k8s auth takes place (env: K8S_AUTH_MOUNT, note: will infer via k8s metadata api if left unset) (default "kubernetes")

I'm setting the env variable via

env:
        - name: K8S_AUTH
          value: 'true'
        - name: K8S_AUTH_MOUNT
          value: 'kubernetes'
        - name: VAULT_ADDR
          value: 'http://vault.vault-system.svc.cluster.local:8200'

on a kubernetes init container running daytona.

But the logs on that init container show me that it's trying to infer the auth endpoint from GCPs metadata API:

{"level":"info","applicationName":"daytona","time":"2022-12-20T16:24:39Z","message":"Attempting kubernetes auth.."}
{"level":"error","applicationName":"daytona","error":"Error making API request.\n\nURL: PUT http://vault.vault-system.svc.cluster.local:8200/v1/auth/kubernetes-gcp-<cluster-name>/login\nCode: 403. Errors:\n\n* permission denied","time":"2022-12-20T16:24:39Z","message":"failed to retrieve vault token"}

I would expect that the auth endpoint is http://vault.vault-system.svc.cluster.local:8200/v1/auth/kubernetes

Tested on latest version v1.2.4

@jonnylangefeld
Copy link
Contributor Author

This is only an issue if the K8S_AUTH_MOUNT is explicitly set to kubernetes. Setting it to kubernetes-kubernetes or presumably any other string works: http://vault.vault-system.svc.cluster.local:8200/v1/auth/kubernetes-kubernetes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant