What the agent does
A manifest pull request is reviewed badly as a patch, because what reaches the cluster is the rendered output of every overlay and chart value, not the lines in the diff. The agent begins with how this repository renders. In a repository like GoogleCloudPlatform/microservices-demo the same application is described in several places: kustomize/base with one file per service, fifteen optional components under kustomize/components, a chart in helm-chart whose Chart.yaml is at version 0.10.7, a kubernetes-manifests directory meant for Skaffold, and the generated release/kubernetes-manifests.yaml. terraform/main.tf creates the cluster with enable_autopilot = true and applies ../kustomize/ with kubectl apply -k. Four workflows check changes, each filtered by path: kustomize-build-ci.yaml runs kubectl kustomize . on the base and kustomize build on the three component combinations in kustomize/tests; helm-chart-ci.yaml runs helm lint --strict and a series of helm template variants; kubevious-manifests-ci.yaml validates three directories; and one validates Terraform.
Those jobs prove the files render. They do not say what changed in the result, and because they are path-filtered a pull request that edits only kustomize/base never runs the chart's lint and template checks. So the agent renders both branches. On the base branch and on the pull request branch it runs the same commands as the workflows, the base, each directory in kustomize/tests, and the chart with its default values and with the value sets the Helm workflow uses, and it diffs the rendered documents resource by resource. It runs kubeconform in strict mode over the pull request's output, and names any resource kind it had no schema for, such as the Istio resources one component adds, as rendered but not validated.
It reads the rendered diff against the conventions the existing workloads follow. Every Deployment in the base sets a pod securityContext with runAsNonRoot and a fixed user, and a container context with allowPrivilegeEscalation: false, all capabilities dropped and readOnlyRootFilesystem: true; and sets CPU and memory requests and limits on its main container. Every one except the load generator has readiness and liveness probes. A new or changed workload is held to the same. On Autopilot that is more than style: requests are what the cluster provisions and bills from, and a pod that asks for privileged mode or host access is rejected at admission. The service images in the base are pinned to a release tag, v0.10.7, so a new image on a floating tag is a finding.
Two cross-file checks catch what a per-file review misses. The network-policies component has a deny-all policy and one policy per service, each listing which pods may reach it on which port: cartservice admits frontend and checkoutservice on 7070. A pull request that adds a service, a port or a new caller without the matching policy works with the base alone and is blocked wherever that component is enabled, which includes all three test combinations. And since the same Deployment exists in kustomize/base and in helm-chart/templates, a change to one that is absent from the other is reported as drift, with both rendered versions shown.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Review this pull request to our Kubernetes manifests for GKE. Read the README files under kustomize, helm-chart and kubernetes-manifests, kustomize/kustomization.yaml, every component's kustomization.yaml, kustomize/tests, helm-chart/Chart.yaml and values.yaml, terraform/main.tf and every workflow under .github/workflows first. Install kubectl, kustomize, helm and kubeconform. On the base branch and on the pull request branch, render exactly what the workflows render: kubectl kustomize on kustomize/, kustomize build on each directory in kustomize/tests, helm lint --strict, and helm template with default values and with each value set the Helm workflow uses. Diff the rendered output per resource and base the review on that diff, not on the patch. Run kubeconform in strict mode on the pull request's rendered output and list any kinds it had no schema for as not validated. Then check: every new or changed workload has the pod and container securityContext, resource requests and limits, and probes the existing workloads have; nothing asks for privileged mode, host networking or host paths, which an Autopilot cluster rejects; images are pinned to a tag or digest; a new service, port or caller has a matching NetworkPolicy in the network-policies component; a change made in the Kustomize base is mirrored in the Helm templates and the other way round; labels and selectors still match. You have no cluster: do not claim anything was applied. Post one review on the pull request with file and line for every finding, the rendered before and after for each changed resource, and the command output quoted. Do not push commits.",
"resources": [
{
"url": "https://github.com/your-org/your-app/pull/42"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
One review on the pull request. It begins with a table of what was rendered, the base, each test combination and each chart variant, with a pass or fail for the render and for schema validation. Next comes the part reviewers of manifests rarely get: for each resource that changed, the rendered YAML before and after, so a three-line patch to a component is shown as the Deployment it actually produces in each combination that includes it.
Findings follow, each with the file and line in the pull request and the reason in terms of this repository: the sibling workload that sets the field the new one omits, the policy file that would need a new entry, the chart template that still has the old value. A change that renders identically everywhere, a comment or a reordering, gets a one-line review saying the output is unchanged.
The review is explicit about its limit. Nothing was applied to a cluster, so admission by GKE, scheduling, and whether the pods become ready are not verified; the review lists those as checks for the pull request's own deployment or a staging cluster. It comments and does not approve.
Run it on every pull request opened
In the Project that holds the repository, create an automation with this prompt, read-only switched on, and a github trigger on pull_request.opened and pull_request.synchronize, with branch_patterns set to your default branch. Read-only runs can read and comment and cannot push. The trigger puts the pull request after the prompt and substitutes nothing, so the paths to render stay in the prompt.
The trigger fires for an owner, member or collaborator. It never fires for bot senders, so the weekly pull requests from a dependency bot such as Renovate get no automatic review, and never for forks. For a bot's pull request, a maintainer starts the same review by hand with the pull request's URL in resources. A fork's pull request keeps its branch in the fork, so a maintainer pushes the contributor's commits to a branch in the repository itself and opens the pull request from there.
The use case this job follows, with its automation and trigger: Review every pull request.
Why run it on Rush?
Rendering every overlay and chart variant on two branches and diffing the results is mechanical work that a human reviewer skips, and it needs four command-line tools at versions that behave like CI's. The agent installs them in a sandbox of its own for each pull request and runs the full matrix every time, and when several manifest pull requests are open they are rendered side by side in separate sandboxes without sharing a working tree.
The review a person reads is short, but everything behind it is kept: each kustomize build and helm template invocation with its output is in the session's transcript, readable with GET /o/{org}/sessions/{id}/messages. If a finding looks wrong, the rendered document it was drawn from is there to check.
Frequently asked questions
Does the agent need access to our GKE cluster?
No. It works from the repository alone: rendering, diffing and validating against schemas. That means it cannot confirm admission or readiness, and the review says so. If you want a server-side dry run, that needs cluster credentials supplied to the run, which is a separate decision.
Can it tell whether Autopilot will reject a workload?
For the common causes, yes, statically: privileged containers, host namespaces and host path volumes are visible in the rendered spec and are flagged. It does not reproduce every rule GKE applies or the adjustments Autopilot makes to resource requests, so a pass from the review is not a guarantee of admission.
We only use Helm, or only Kustomize. Does that matter?
No. The agent reads which renderers the repository has and runs those. The cross-check between a Kustomize base and Helm templates applies only where both describe the same workload.
How does it handle custom resources like Istio or Gateway API kinds?
It validates them when it can fetch a schema for the kind and version, and otherwise lists them as rendered but not validated. It never reports a custom resource as valid on the strength of the render alone.
More GKE jobs
The same job on other stacks
- Review Kubernetes Manifests in Pull Requests (Kubernetes)
- Review Kustomize Changes on Every Pull Request (Kustomize)
- Review Argo CD App Changes in Pull Requests (Argo CD)