Skip to content

🚀 Add new Agent Token controller#628

Merged
arybolovlev merged 25 commits intomainfrom
add-new-agent-token-controller
Sep 29, 2025
Merged

🚀 Add new Agent Token controller#628
arybolovlev merged 25 commits intomainfrom
add-new-agent-token-controller

Conversation

@arybolovlev
Copy link
Collaborator

@arybolovlev arybolovlev commented Aug 4, 2025

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

No.

Description

This PR introduces a new controller that enables the management of Agent tokens across arbitrary Agent Pools. The controller can either fully manage the tokens for a pool or merge its tokens with any existing ones. In the latter case, the controller will manage only its own tokens, leaving the others unchanged.

This solution allows the operator to run on multiple clusters and sync tokens for the same pool, with each cluster having its own token(s) for agents.

Tests

  • E2E on HCP Terraform Operator
  • E2E on HCP Terraform Operator [Helm]

Usage Example

apiVersion: app.terraform.io/v1alpha2
kind: AgentToken
metadata:
  name: this
spec:
  organization: kubernetes-operator
  token:
    secretKeyRef:
      name: hcp-terraform-operator
      key: token
  agentPool:
    name: multik
  agentTokens:
  - name: token-a
  - name: token-b
  secretName: this
  deletionPolicy: retain
  managementPolicy: merge

References

Partially addresses issue #585.

Community Note

  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

@arybolovlev arybolovlev requested a review from a team as a code owner August 4, 2025 12:59
@arybolovlev arybolovlev added this to the v2.10.0 milestone Aug 4, 2025
@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label Aug 4, 2025
@arybolovlev arybolovlev marked this pull request as draft August 4, 2025 18:13
@arybolovlev arybolovlev marked this pull request as ready for review September 25, 2025 07:17
@arybolovlev arybolovlev force-pushed the add-new-agent-token-controller branch from 8c13e02 to d21d6e2 Compare September 25, 2025 09:58
Copy link
Contributor

@jrhouston jrhouston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a some nitpicky comments, going to approve

@arybolovlev arybolovlev merged commit 27f844f into main Sep 29, 2025
9 checks passed
@arybolovlev arybolovlev deleted the add-new-agent-token-controller branch September 29, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api crd documentation Improvements or additions to documentation github_actions Pull requests that update GitHub Actions code golang helm-chart size/XL test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants