Skip to content

Agents: Self Registration - support labels/annotations #792

@drewbailey

Description

@drewbailey

Problem

The https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Cluster/ discovers target clusters by reading Argo CD cluster secrets and filtering them by labels (e.g. env=production, region=us-west-2). With self registering agents in argocd-agent, cluster secrets are created by the principal during self-registration, but there is no way for an agent to declare labels/annotations to add to the cluster secret.

A clear and concise description of what you want to happen.

Agent side (cmd/argocd-agent/agent.go, agent/options.go)

  • Add --cluster-labels key=val,key=val and --cluster-annotations key=val,key=val flags
  • Store as map[string]strings on agent options
  • Send as part of the existing connect/auth handshake (extend the auth request proto, or a new dedicated RPC— see tradeoffs below)

Wire protocol two potential options:

  1. Extend the existing AuthRequest proto to carry cluster_labels / cluster_annotations map fields
  2. New RegisterAgent RPC called after auth

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions