-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
tsh doesn't target the correct Kubernetes cluster if logging directly into a non-root cluster #3693
Comments
~/.tsh/profile
~/.tsh/profile
~/.tsh/profile
@russjones This can lead to some pretty bad UX. e.g. Accidentally shutting down a production cluster, when you think it's staging. I can see this being an |
@awly Do you have any thoughts on this issue? |
#3639 looks related, since we use |
Hmm, actually, the issue might be different. |
OK, I think I got it working. As a stopgap solution, I updated the login flow to support the same k8s-specific stuff we support when re-issuing: In the long term, we should try to refactor and unify all this stuff. I'm still hazy on all the moving pieces and how it should ideally look like. |
Reopening to backport to 4.2 |
This is not working for SSO logins yet unfortunately. |
Closing this issue as I myself and @awly tested this with SSO. |
What happened: I ran
tsh login --proxy=example-main.gravitational.co:3080 gus-test-cluster-seven
and logged into a Teleport cluster. This caused my~/.tsh/profile
to get updated:Any
tsh
operation correctly targets the leaf cluster -gus-test-cluster-seven
. Anykubectl
operation actually targets the root cluster (example-main.gravitational.co
) instead:Rerunning the login command does not fix this. I have to explicitly switch to a different cluster (
tsh login --proxy=example-main.gravitational.co:3080 example-main.gravitational.co
) and back again (tsh login --proxy=example-main.gravitational.co:3080 gus-test-cluster-seven
) to fix the issue.What you expected to happen: Directly logging into a cluster with
tsh login --proxy=root-cluster leaf-cluster
should correctly target alltsh
andkubectl
operations at the correct cluster.How to reproduce it (as minimally and precisely as possible): See above.
Manually clearing out all unrelated entries in my
~/.kube/config
doesn't seem to help. Deleting~/.tsh/profile
doesn't help.Environment
Teleport version (use
teleport version
):Teleport Enterprise v4.2.9git:v4.2.9-0-ga4bd6c36 go1.13.2
Tsh version (use
tsh version
):Teleport v4.2.9 git:v4.2.9-0-ga4bd6c36 go1.13.2
(also happens with tsh4.2.8
)OS (e.g. from
/etc/os-release
):Fedora 31
Where are you running Teleport? (e.g. AWS, GCP, Dedicated Hardware): Root in GKE, leaf in AWS (created by
kops
)The text was updated successfully, but these errors were encountered: