Fix Kubernetes Legacy Proxy heartbeats#29733
Merged
Conversation
When a Teleport Kubernetes Proxy runs in legacy mode - i.e. - spec
enables `proxy_service.kubernetes.enabled`, the proxy is capable of
proxy requests to a target Kubernetes cluster instead of forwarding them
to a Teleport Kubernetes Service.
The following config enables the legacy proxy mode in proxy:
```yaml
proxy_service:
enabled: yes
web_listen_addr: 0.0.0.0:3080
public_addr: tele.local:3080
kubernetes:
enabled: yes
listen_addr: 0.0.0.0:3026
kubeconfig_file: path # optional
```
Because the proxy forwards and heartbeat the configured Kube clusters,
it needs permissions to upsert the kube cluster in auth's backend and
to extend its expiration date.
This PR fixes a problem that exists since Teleport 8 where the proxy
is allowed to upsert the kube server but it's not allowed to extend the
expiration time.
When the request fails, the proxy becomes in degraded state and the
performance is affected.
Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
c038457 to
fef8fd7
Compare
rosstimothy
reviewed
Jul 28, 2023
Contributor
rosstimothy
left a comment
There was a problem hiding this comment.
Can we add a test to cover this scenario?
6078eb3 to
c038457
Compare
espadolini
approved these changes
Jul 28, 2023
Contributor
espadolini
left a comment
There was a problem hiding this comment.
This PR fixes a problem introduced in Teleport 8
approved based on this
Contributor
Author
|
rosstimothy
approved these changes
Jul 28, 2023
Contributor
rosstimothy
left a comment
There was a problem hiding this comment.
Thanks for the test!
This was referenced Jul 28, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a Teleport Kubernetes Proxy runs in legacy mode - i.e. - spec enables
proxy_service.kubernetes.enabled, the proxy is capable of proxy requests to a target Kubernetes cluster instead of forwarding them to a Teleport Kubernetes Service.The following config enables the legacy proxy mode in proxy:
Because the proxy forwards and heartbeat the configured Kube clusters, it needs permissions to upsert the kube cluster in auth's backend and to extend its expiration date.
This PR fixes a problem introduced in Teleport 8 where the proxy is allowed to upsert the kube server, but it's not allowed to extend the expiration time.
When the request fails, the proxy becomes degraded and the performance is affected.