-
Notifications
You must be signed in to change notification settings - Fork 2k
[v17] Add support for Kubernetes OIDC joining #57800
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
Merged
timothyb89
merged 5 commits into
branch/v17
from
timothyb89/v17/kubernetes-oidc-joining
Aug 22, 2025
Merged
[v17] Add support for Kubernetes OIDC joining #57800
timothyb89
merged 5 commits into
branch/v17
from
timothyb89/v17/kubernetes-oidc-joining
Aug 22, 2025
Conversation
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
* MWI: Add `oidc` subtype for Kubernetes joining This adds a new `oidc` subtype for Kubernetes joining, which allows workloads to join using a Kubernetes service account token (JWT) as usual, but verifies it using an OIDC flow rather than a static JWKS keyset. This should better support platforms like EKS where the JWKS keyset is rotated regularly. * Validate OIDC subtype properly * Initialize OIDC validator at startup * Fix OIDC claims implementation * Force use of cluster name as audience * Remove authorized party workaround * Reintroduce kubernetes claims check * Remove unused constant * Update generated operator resources * Update generated TF docs * Add validator tests * Improve proto docs, enforce HTTP issuers, and add insecure override * Update autogenerated docs
This partially backports various dependencies of the original change. Note that this is not a clean backport, and minor code and organizational changes were made to facilitate this backport, including copying some OIDC code directly into the token validator. Additionally, caching support from #57789 was integrated directly. It inherently depends on the same OIDC code that required modification, so it has been pulled in directly.
|
Amplify deployment status
|
I've abandoned the caching approach in #57789, so this PR will proceed without caching, as in branch/v18.
…kubernetes-oidc-joining
strideynet
approved these changes
Aug 18, 2025
r0mant
approved these changes
Aug 18, 2025
…kubernetes-oidc-joining
Merged
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.
This PR adds Kubernetes OIDC joining to v17, as originally added in #57538. However, as we've since switched OIDC libraries in v18, the change could not be cleanly backported: this depends on #54939, but in addition to being a poor backport candidate, depends on a new version of
zitadel/oidc/v3that I'm wary of updating in v17 unnecessarily.Instead, I've ended up directly including some of the
zitadel/oidcrelated functions that this particular join method needs, and left some notes to indicate that, should #54939 be backported in full, we should remove the duplicated functionality.changelog: Add new
oidcjoining mode for Kubernetes delegated joining to support providers that can be configured to provide public OIDC endpoints, like EKS, AKS, and GKE.To use, you'll need a Kubernetes cluster that issues OIDC tokens from an issuer with a public OpenID-compatible endpoint, like Amazon EKS. To check and resolve the right issuer value, run this command:
This attempts to resolve the issuer from your local machine; providers like EKS will return an OIDC config pointing to internal URLs when used on an internal network. If your provider's OIDC endpoint isn't available, the
curlcall will fail, in which case this method won't work.Once you've determined the issuer, create a join token:
You'll need to configure your Kubernetes pod to project a token with the Teleport cluster name as the configured audience, in this case we'll assume
example.teleport.sh.To project an additional token, add this to your pod spec:
When joining a client (Teleport agent,
tbot, etc) make sureKUBERNETES_TOKEN_PATHis set to the token in the projected mount path, e.g./var/run/secrets/teleport-token/token.