-
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: print kubernetes info in profile status #4348
Conversation
I tested this locally and it works OK - it got the correct output for 2/3 clusters I had listed in
proxy_service:
enabled: yes
ssh_public_addr: teleport.cluster:3023
public_addr: teleport.cluster:3080
tunnel_listen_addr: 0.0.0.0:3080
tunnel_public_addr: teleport.cluster:3080
https_key_file: /etc/letsencrypt/live/teleport.cluster/privkey.pem
https_cert_file: /etc/letsencrypt/live/teleport.cluster/fullchain.pem
This probably isn't a show-stopper, but it might confuse people as to why we're reporting Kubernetes being enabled in their
|
@webvictim I noticed the first issue too, when I re-used a Teleport cluster name:
Regarding the second issue - good to flag it, but it seems like parsing the output in a way that depends on the exact number of spaces is doomed to fail. My hope is that the number of users parsing status output is tiny, and most of them doing it with |
I don't know of anyone using it.. but that likely means there is. I'll defer to @russjones, I think if we do it it should at least be in a minor release with notes. I'm also leaning to put this into |
2020f3c
to
516bef7
Compare
My view is that |
lib/client/api.go
Outdated
// The TLS cert may have k8s users and groups even when proxy isn't | ||
// configured to talk to a k8s cluster. | ||
// RouteToCluster is only set when k8s support is enabled though. | ||
KubeEnabled: tlsID.RouteToCluster != "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is not a reliable indicator that Kubernetes support is enabled. If you are using the -J
flag for SSH RouteToCluster
will be set. What about something like the following:
var kubeEnabled bool
if len(tlsID.KubernetesUsers) > 0 || len(tlsID.KubernetesGroups) > 0 {
kubeEnabled = true
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KubernetesUsers
is set to user login in the default admin
role, so that's not a reliable indicator either.
I just realized that #4427 will make k8s support explicitly visible in the cert, so I'll wait for that to merge and use the new TLS extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
a5b81cb
to
7a54cb3
Compare
d8a5229
to
36a8f66
Compare
Print when k8s support is detected, and if so what users/groups are used.
36a8f66
to
7c10e8a
Compare
PTAL |
Print when k8s support is detected, and if so what users/groups are
used.
Fixes #3447
Updates #3952