Skip to content

[v15] Reduce resource consumption when generating Kubernetes certificates#52148

Merged
rosstimothy merged 2 commits intobranch/v15from
tross/backport-52109/v15
Mar 20, 2025
Merged

[v15] Reduce resource consumption when generating Kubernetes certificates#52148
rosstimothy merged 2 commits intobranch/v15from
tross/backport-52109/v15

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy commented Feb 13, 2025

Backport #52109 and #52442 to branch/v15

Changelog: Improve latency and reduce resource consumption of generating Kubernetes certificates via tctl auth sign and tsh kube login.

@rosstimothy rosstimothy force-pushed the tross/backport-52109/v15 branch 2 times, most recently from 4a0697e to 4457d8c Compare February 20, 2025 20:15
@rosstimothy rosstimothy marked this pull request as ready for review February 20, 2025 20:36
@github-actions github-actions Bot added kubernetes-access size/sm tctl tctl - Teleport admin tool tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Feb 20, 2025
@github-actions github-actions Bot requested review from avatus and tigrato February 20, 2025 20:36
rosstimothy and others added 2 commits March 20, 2025 10:55
…52109)

Closes #52073.

The requested Kubernetes cluster is now cross referenced with the
KubeServers in the unified resource cache. This results in a
reduction in CPU, memory, and cert generation latency. This also
cleans up some of the helper functions in lib/kube/utils that
were no longer needed, and suboptimal.

The client side changes here shouldn't have any impact, as the
server is performing the same check, and returning the equivalent
error the client side code used to. This will also cut the time
of `tctl auth sign` in half as both the client and server were
performing the same expensive CheckKubeCluster operation.
#52109 added a dependency on the unified resource cache to user
cert generation to reduce resource consumption. A number of tests
that exercise generating Kubernetes user certs were either not
waiting for the Kubernetes resources to exist prior to authentication
and getting lucky, or checking that the resources were in the auth
cache, but not the unified resource cache.

This attempts to cover any tests which generate Kubernetes user
certificates to verify that the unified resource cache contains
the expected cluster before proceeding.

Fixes #52157.
Fixes #52441.
@rosstimothy rosstimothy force-pushed the tross/backport-52109/v15 branch from 4457d8c to 5e95249 Compare March 20, 2025 15:05
@rosstimothy rosstimothy enabled auto-merge March 20, 2025 15:12
@rosstimothy rosstimothy added this pull request to the merge queue Mar 20, 2025
Merged via the queue into branch/v15 with commit 56f4068 Mar 20, 2025
32 of 33 checks passed
@rosstimothy rosstimothy deleted the tross/backport-52109/v15 branch March 20, 2025 15:43
@fheinecke fheinecke mentioned this pull request Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport kubernetes-access size/sm tctl tctl - Teleport admin tool tsh tsh - Teleport's command line tool for logging into nodes running Teleport.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants