feat(mecak8s): converge kustomize manifests into the Helm chart - #663
Merged
Conversation
JAORMX
approved these changes
Aug 20, 2026
jhrozek
force-pushed
the
feat/mecak8s-dex-fixture
branch
from
August 20, 2026 07:56
05085e1 to
fb0adf3
Compare
jhrozek
force-pushed
the
feat/mecak8s-kind-dex
branch
from
August 20, 2026 07:56
345ab53 to
0acd027
Compare
jhrozek
force-pushed
the
feat/mecak8s-dex-fixture
branch
from
August 20, 2026 09:20
fb0adf3 to
8c02f39
Compare
jhrozek
force-pushed
the
feat/mecak8s-kind-dex
branch
from
August 20, 2026 09:20
0acd027 to
14df259
Compare
jhrozek
force-pushed
the
feat/mecak8s-dex-fixture
branch
from
August 20, 2026 09:22
8c02f39 to
40d61be
Compare
jhrozek
force-pushed
the
feat/mecak8s-kind-dex
branch
from
August 20, 2026 09:22
14df259 to
55f5eb8
Compare
jhrozek
force-pushed
the
feat/mecak8s-dex-fixture
branch
from
August 20, 2026 11:10
40d61be to
074c27f
Compare
jhrozek
force-pushed
the
feat/mecak8s-kind-dex
branch
from
August 20, 2026 11:10
55f5eb8 to
e0b1c74
Compare
jhrozek
force-pushed
the
feat/mecak8s-dex-fixture
branch
from
August 20, 2026 12:14
074c27f to
82c70c6
Compare
jhrozek
force-pushed
the
feat/mecak8s-kind-dex
branch
from
August 20, 2026 12:14
e0b1c74 to
d004762
Compare
jhrozek
force-pushed
the
feat/mecak8s-dex-fixture
branch
from
August 20, 2026 13:03
82c70c6 to
af8ebb9
Compare
jhrozek
force-pushed
the
feat/mecak8s-kind-dex
branch
from
August 20, 2026 13:03
d004762 to
5966b28
Compare
deploy/mecak8s/ + deploy/mecak8s-oidc/ (kustomize) duplicated the same storage-free agent workload deploy/helm/mecak8s/ (Helm) already defines, and had already drifted from it. Add caller-identity (oidc.*) support to the chart, including the raw-driver NetworkPolicy the OIDC overlay used to carry (gated on oidc.enabled — it's a tenant-isolation boundary, not the general egress policy this chart deliberately omits), migrate task deploy:check, the kind e2e suite (e2e/k8s/), and the k8s-e2e CI workflow off kustomize onto the chart, then delete both kustomize directories. Also fixes a real bug in the chart's pre-existing validate* template helpers: `required`/`include` return their argument on success, and these were `include`d for validation side effects only, without discarding the return value — so image.repository/redis.endpoint/the redis port were being injected as literal text into the rendered Deployment YAML (invisible to every existing test, since they all used substring checks; kubeconform catches it immediately). Verified by actually running `task e2e:k8s` against a live kind cluster (not just unit tests + `helm template`), which surfaced three real regressions the static checks couldn't see and are fixed here: - baseAgentArgs() (the OIDC-restore helper) was missing --redis-allow-plaintext, so restoring a pod to the unauthenticated baseline crash-looped it (ADR 0228 fail-closed plaintext-Redis guard). - The Dex/JWKS-proxy e2e fixture's embedded NetworkPolicies still selected the agent pod with the retired kustomize label (app.kubernetes.io/name: mecatl, plus a part-of label the chart's pod template never carries at all), so they never matched the real chart-rendered agent pod — on both the allow-ingress-to-Dex side and the allow-egress-from-agent side. Corrected to the chart's actual pod labels (name: mecak8s, component: agent). - Once that label fix let those Egress-type policies start matching the agent pod, Kubernetes NetworkPolicy semantics flipped it from unrestricted to deny-except-explicitly-listed for egress, and it lost DNS/API/Redis (the general egress policy the deleted kustomize base used to provide). Added an e2e-fixture-only baseline egress policy (DNS + 443 + Redis) to restore parity — kept out of the chart itself per the earlier decision that it ships no NetworkPolicy. All 17 specs pass against a real cluster (`task e2e:k8s`, ~5 min). Co-Authored-By: mecatl <noreply@stacklok.com>
jhrozek
force-pushed
the
feat/mecak8s-kind-dex
branch
from
August 20, 2026 13:26
5966b28 to
247fc7f
Compare
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.
Summary
deploy/mecak8s/(kustomize) +deploy/mecak8s-oidc/(kustomize overlay) duplicated the same storage-free agent workloaddeploy/helm/mecak8s/(Helm) already defines, and had already drifted from it. This PR:oidc.*) support to the chart, including the raw-driver NetworkPolicy the OIDC overlay used to carry — gated onoidc.enabled, since it's a tenant-isolation boundary, not the general egress policy this chart deliberately omits (network isolation is left to the cluster's own policy layer).task deploy:check, the kind e2e suite (e2e/k8s/), and thek8s-e2eCI workflow off kustomize onto the chart.validate*template helpers:required/includereturn their argument on success, and these wereincluded for validation side effects only without discarding the return value — soimage.repository/redis.endpoint/the redis port were being injected as literal text into the rendered Deployment YAML (invisible to every existing test, since they all used substring checks;kubeconformcatches it immediately).Verified by actually running
task e2e:k8sagainst a live kind cluster (not just unit tests +helm template), which surfaced three further real regressions, all fixed here:baseAgentArgs()(the e2e OIDC-restore test helper) was missing--redis-allow-plaintext, so restoring a pod to the unauthenticated baseline crash-looped it (ADR 0228's fail-closed plaintext-Redis guard).app.kubernetes.io/name: mecatl, plus apart-oflabel the chart's pod template never carries at all), so they never matched the real chart-rendered agent pod. Corrected to the chart's actual pod labels.Egress-type policies start matching the agent pod, Kubernetes NetworkPolicy semantics flipped it from unrestricted to deny-except-explicitly-listed for egress, and it lost DNS/API/Redis (the general egress policy the deleted kustomize base used to provide). Added an e2e-fixture-only baseline egress policy (DNS + 443 + Redis) to restore parity — kept out of the chart itself per the decision above.All 17 specs pass against a real cluster (
task e2e:k8s, ~5 min).Fixes #634
Stack
4th (top) of a 4-PR stack (based on #662):
Test plan
go build ./.../go vet ./...go test ./deploy/... ./internal/app/... ./internal/deploycheck/...task docs:llms && task docs:checktask deploy:checktask e2e:k8sagainst a real kind cluster — all 17 specs pass