You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add --default-agent-pod-labels flag for global agent pod labels (#1534)
## Summary
- Adds a new `--default-agent-pod-labels` CLI flag /
`DEFAULT_AGENT_POD_LABELS` env var that applies a set of labels to all
agent pod templates created by kagent
- Labels are specified as comma-separated `key=value` pairs (e.g.
`team=platform,environment=production`)
- Fully wired through Helm via `controller.agentDeployment.podLabels`
map in values.yaml
- Label precedence: built-in defaults → global default labels →
per-agent `spec.deployment.labels`
## Test plan
- [x] Unit tests for `ParseLabels` (8 cases covering valid input, edge
cases, and errors)
- [x] Unit test for `DEFAULT_AGENT_POD_LABELS` env var loading
- [x] Existing translator golden tests pass
- [x] 4 new Helm unit tests (labels set, empty, not configured, single
label)
- [x] Deployed to Kind cluster with `podLabels: {team: platform,
environment: production}` — verified all 11 agent pod templates contain
both labels
- [x] `kubectl get pods -l team=platform` returns all agent pods
Comment left by Claude on behalf of @EItanya
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
commandLine.StringVar(&agent_translator.DefaultSkillsInitImageConfig.Repository, "skills-init-image-repository", agent_translator.DefaultSkillsInitImageConfig.Repository, "The repository to use for the skills init image.")
178
179
179
180
commandLine.StringVar(&agent_translator.DefaultServiceAccountName, "default-service-account-name", "", "Global default ServiceAccount name for agent pods. When set, agents without an explicit serviceAccountName will use this instead of creating a per-agent ServiceAccount.")
181
+
182
+
commandLine.Var(&MapValue{Target: &agent_translator.DefaultAgentPodLabels}, "default-agent-pod-labels", "Comma-separated key=value pairs of labels to apply to all agent pod templates (e.g. 'team=platform,env=prod'). Per-agent labels take precedence.")
180
183
}
181
184
182
185
// LoadFromEnv loads configuration values from environment variables.
Copy file name to clipboardExpand all lines: helm/kagent/templates/controller-configmap.yaml
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -60,3 +60,12 @@ data:
60
60
{{- if and .Values.controller.agentDeployment .Values.controller.agentDeployment.serviceAccountName (not (eq .Values.controller.agentDeployment.serviceAccountName "")) }}
0 commit comments