Skip to content

feat: agent.egressPolicyRefs picks the namespace's EgressPolicies - #104

Merged
teemow merged 2 commits into
mainfrom
egress-policy-refs
Oct 22, 2026
Merged

teemow merged 2 commits into
mainfrom
egress-policy-refs

Conversation

@teemow

@teemow teemow commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Problem

An agent can pick kagent's namespaced EgressPolicy objects through Agent.spec.egressPolicyRefs, but the agent chart has no value for the refs, and a kubectl edit is dropped by the next upgrade of the agent's release. Part of giantswarm/giantswarm#38744 (agent chart; agent-manager and the Dev Portal follow).

Proposed solution

  • agent.egressPolicyRefs (a list of names, empty by default) renders into the Agent's spec.egressPolicyRefs as {name} entries beside spec.egress. The chart copies none of a policy's rules.
  • The values schema mirrors the CRD: at most 16 unique resource names; anything else is refused, naming the entry.
  • helm-unittest cases for the render and every refusal; README "What an agent can reach" explains picking an EgressPolicy; CHANGELOG.

Acceptance criteria

  • helm unittest helm/agent: 115 passed.
  • agentlab proof (agentlab-2, agent-platform 4.157.1, kagent controller 1.21.1). This branch's chart was installed with Helm into kagent (toolset: [preset:none]), next to an EgressPolicy eg38744-example granting https://example.com:
    • the agent with agent.egressPolicyRefs: [eg38744-example] was Ready on the kagent Harness, with spec.egressPolicyRefs: [{name: eg38744-example}]. In a turn, its bash tool's wget got https://example.com/ 200, while https://proxy.golang.org/ got 403 actor egress policy denied … not in this agent's egress policy;
    • the control agent without the ref was Ready, and both URLs got 403 from the gate;
    • https://proxy.golang.org was added to the policy, with no Helm upgrade (the Agent's generation stayed 1). The Agent recompiled, and a new Session's probe got https://proxy.golang.org/ 200;
    • an agent naming a policy that does not exist got ResolvedRefs=False (resolve EgressPolicy "kagent/eg38744-absent": not found) and was never Ready. The README says so.
    • All fixtures were removed afterwards.

@teemow
teemow requested a review from a team as a code owner October 22, 2026 10:03
@circleci-architect

circleci-architect Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Published Helm chart agent

2.2.9-r7812d4fet20261022120017hba32f8a
Chart agent
Version 2.2.9-r7812d4fet20261022120017hba32f8a
OCI reference oci://gsoci.azurecr.io/charts/giantswarm/agent:2.2.9-r7812d4fet20261022120017hba32f8a
Digest sha256:9a7843841014ab6dfef0b7d34485e5fec54d7413af540a0214c7695a319bdd50
Registry public — gsoci.azurecr.io
Git catalog giantswarm-test-catalog (index)
Pull this chart
helm pull oci://gsoci.azurecr.io/charts/giantswarm/agent --version 2.2.9-r7812d4fet20261022120017hba32f8a

Posted by architect-orb · build 1344 · commit ba32f8a · updated in place on every push

@teemow
teemow merged commit 530ebf5 into main Oct 22, 2026
13 checks passed
@teemow
teemow deleted the egress-policy-refs branch October 22, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant