feat: MachineAccountKey Proxy Backend#546
Merged
JoseSzycho merged 21 commits intomainfrom Apr 2, 2026
Merged
Conversation
This change is made to take advantage of the already custom storage layer of the identity APIGroup
This allows us to have a custom API for the machineAccountKeys, letting provision private keys and public key using Milo as the source of truth. When Milo provision the private key, it won't be stored in the etcd, but will returned in teh update/create response.
…machineAccountKey
…om update logic for key rotation.
🤖 Automatically added newlines to 1 file(s) Co-Authored-By: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Contributor
📝 Documentation AnalysisJoggr found 1 outdated docs in the pull request. AutofixJoggr opened 1 pull request(s) to fix the outdated docs. Outdated
|
Contributor
|
🤖 I automatically added missing newlines at the end of 1 file(s) in this PR. All files should now end with a newline character as per coding standards. |
|
|
scotwells
reviewed
Apr 1, 2026
scotwells
reviewed
Apr 1, 2026
scotwells
reviewed
Apr 1, 2026
scotwells
previously approved these changes
Apr 2, 2026
scotwells
approved these changes
Apr 2, 2026
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.
This PR migrates the MachineAccountKey resource from the legacy iam.miloapis.com group to the modern identity.miloapis.com group. It also implements a proxy-based backend that delegates key management to an external authentication provider (Zitadel), moving away from internal etcd-backed storage.
Summary of Changes
1. API Migration and Refactoring
API Group Change: Moved MachineAccountKey from iam.miloapis.com/v1alpha1 to identity.miloapis.com/v1alpha1.
New Schema: Defined the resource schema in pkg/apis/identity/v1alpha1/machineaccountkey_types.go, including support for auto-generated public keys and PEM-encoded private keys returned on creation.
2. Implementation of Proxy Backend
REST Implementation: Developed a new REST handler in internal/apiserver/identity/machineaccountkeys that implements Kubernetes standard operations (Create, Get, List, Delete).
Dynamic Provider: Implemented a DynamicProvider that proxies requests to an external auth-provider URL using client-go dynamic interfaces. It handles identity forwarding via X-Remote-* headers using transport.NewAuthProxyRoundTripper.
3. Roles and Access Control
RBAC Roles: Added predefined roles for machine account key management:
identity-machine-account-keys-editor: Allows creation, updating, and deletion.
identity-machine-account-keys-viewer: Allows read-only access.
Protected Resources: Established identity.miloapis.com-machineaccountkey as a ProtectedResource, linking it to Project as its parent in the resource hierarchy.
Related to: