[v14] Relax Kubernetes CRD discovery when building cache#36227
Merged
tigrato merged 1 commit intobranch/v14from Jan 3, 2024
Merged
[v14] Relax Kubernetes CRD discovery when building cache#36227tigrato merged 1 commit intobranch/v14from
tigrato merged 1 commit intobranch/v14from
Conversation
Teleport Kubernetes Service has a monitor that constantly watches the Resources registered in the Kubernetes Cluster via API Discovery. The goal is to keep an up-to-date representation of all resources existing in the cluster in order to be able to register them for Teleport per-Resource RBAC. Having an up-to-date represenation allows us to unmarshal the API responses and filter them when the custom resources are local. When the Kubernetes APIs are registered using non-local services - i.e. the API is served by a POD running within the cluster like metrics API - and those services aren't healthy - i.e. pod not running, invalid selector, cluster has no nodes - the discovery watcher returns an error and fails. This is an improper configuration but seems to be a common problem. This PR relaxes the discovery mechanism and doesn't enforce that all APIs return their resources if they aren't currently available. When the `client.Discovery().ServerGroupsAndResources()` returns a `*discovery.ErrGroupDiscoveryFailed`, it also returns the partial results that we will use for registration. Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
rosstimothy
approved these changes
Jan 3, 2024
AntonAM
approved these changes
Jan 3, 2024
Merged
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.
Backport #36214 to branch/v14
changelog: Safeguard against the disruption of cluster access caused by incorrect Kubernetes APIService configurations.