Skip to content

[v16] Reduce resource consumption when generating Kubernetes certificates#52147

Merged
rosstimothy merged 2 commits intobranch/v16from
tross/backport-52109/v16
Mar 20, 2025
Merged

[v16] Reduce resource consumption when generating Kubernetes certificates#52147
rosstimothy merged 2 commits intobranch/v16from
tross/backport-52109/v16

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy commented Feb 13, 2025

Backport #52109 and #52442 to branch/v16

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/v16 branch 2 times, most recently from f9627ad to 299f3e2 Compare February 20, 2025 20:14
@rosstimothy rosstimothy marked this pull request as ready for review February 20, 2025 20:35
@github-actions github-actions Bot requested review from avatus and tigrato 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
rosstimothy and others added 2 commits March 20, 2025 10:36
…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/v16 branch from 299f3e2 to ef6f974 Compare March 20, 2025 14:54
@rosstimothy rosstimothy added this pull request to the merge queue Mar 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 20, 2025
@rosstimothy rosstimothy added this pull request to the merge queue Mar 20, 2025
Merged via the queue into branch/v16 with commit 8793660 Mar 20, 2025
39 of 40 checks passed
@rosstimothy rosstimothy deleted the tross/backport-52109/v16 branch March 20, 2025 16:16
@doggydogworld doggydogworld mentioned this pull request Mar 28, 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