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

When kamel is launched from inside a container, it is using the serviceaccount of this container instead of the user configured in kubeconfig #1048

Closed
apupier opened this issue Nov 7, 2019 · 3 comments · Fixed by #1054
Assignees
Labels
area/core Core features of the integration platform kind/bug Something isn't working
Milestone

Comments

@apupier
Copy link
Contributor

apupier commented Nov 7, 2019

kamel CLI command are returning this kind of error
Error: integrations.camel.apache.org is forbidden: User "system:serviceaccount:che:che-workspace" cannot create resource "integrations" in API group "camel.apache.org" in the namespace "che"

although the current user is minikube (and which is admin so have all rights):

sh-5.0$ kubectl config view --template='{{ range .contexts }}{{ if eq .name "'$(kubectl config current-context)'" }}Current user: {{ .context.user }}{{ end }}{{ end }}'
Current user: minikube
@nicolaferraro
Copy link
Member

Is the KUBECONFIG env var set in your case?

@apupier
Copy link
Contributor Author

apupier commented Nov 7, 2019

Is the KUBECONFIG env var set in your case?

no it is not.

And when I set it to $HOME/.kube/config , it works!

I think it would be nice to follow the same behavior than kubectl to pick the user.
If too complicated, maybe an intermediate step can be to provide more guidance to users in error message to explain from where the user has been resolved? (would it be really easier to implement?)

@nicolaferraro
Copy link
Member

Currently the logic search for some files that are only present only in containers, in order to determine which credentials to pick. We should reverse the logic prefer KUBECONFIG or ~/.kube/config to the container service account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Core features of the integration platform kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants