What the agent does
kubectl apply prints no matches for kind "Ingress" in version "extensions/v1beta1" when a manifest asks for an API the cluster no longer serves. Kubernetes 1.22 removed that Ingress version, so a file that applied for years fails after a cluster upgrade, or the first time someone creates a fresh local cluster. The agent starts by measuring the problem instead of editing by search and replace. It validates every manifest with kubeconform against the schemas of two releases: the last one where the file worked and the one you run now. In a project like MartinHeinz/python-project-blueprint, whose k8s/app.yaml holds a Namespace, a Deployment, a ConfigMap, a Service and an Ingress, the Ingress validates against 1.21 and gets could not find schema for Ingress against 1.22. That pins the break to one resource and one release.
Changing the apiVersion line to networking.k8s.io/v1 is not the fix, and validation shows why. With only that line changed, the schema rejects the resource twice: missing property 'pathType', and additional properties 'serviceName', 'servicePort' not allowed. The new version reshaped the backend. This file's rule sends path / on host localhost to serviceName: blueprint, servicePort: 443; in v1 that becomes service.name: blueprint with service.port.number: 443, and each path needs a pathType. The agent picks Prefix for a path of / and says so, because the removed version behaved like ImplementationSpecific and for other paths the two can match differently. It keeps the tls block and the two nginx.ingress.kubernetes.io annotations as they are.
The same validation pass finds problems the error message never mentioned, and the agent reports each one separately from the fix you asked for. In this file the Deployment is invalid on every version: at '/spec/template/spec/containers': got object, want array. The cause is on line 22, where a comment about a registry issue runs on and swallows the - image: martinheinz/python-project-blueprint:flask entry that should start the container list. kubectl never got that far, because it stopped at the Ingress. The agent restores the line break, since the Deployment cannot apply without it, and marks that as a second, independent change in the pull request.
It also checks what a schema cannot. This Ingress names no class, neither the old kubernetes.io/ingress.class annotation nor spec.ingressClassName, so whether a controller serves it depends on the cluster having a default IngressClass; the agent states that as a question for the reviewer. And it reads how the manifest gets applied: here the Makefile has manifest-update, which runs kubectl apply -f ./k8s/app.yaml, and cluster, which creates a kind cluster from k8s/cluster/kind-config.yaml. It then lists every other removed version it finds across the repository, such as batch/v1beta1 CronJobs or policy/v1beta1 PodDisruptionBudgets, with the release that removed each.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "claude",
"input": "Applying this repository's Kubernetes manifests fails with: no matches for kind \"Ingress\" in version \"extensions/v1beta1\". Find every manifest (plain YAML, Kustomize bases and overlays, and rendered Helm templates if a chart is present). Install kubeconform and validate all of them against two Kubernetes versions: 1.21.0 and the version given at the end of this prompt. Save both summaries. For every resource whose API version is not served in the target version, rewrite it to the current version: for Ingress use networking.k8s.io/v1, move serviceName and servicePort to service.name and service.port.number or service.port.name, add a pathType to every path and say why you chose it, and move a kubernetes.io/ingress.class annotation to spec.ingressClassName. Keep annotations, hosts and TLS settings unchanged. Do not change images, replicas, ports or resource names. Validate again in strict mode until every resource passes. If validation finds errors unrelated to API versions, fix only those that stop the file from applying, in a separate commit, and explain each. You have no cluster: do not claim a server-side result, and list what only a cluster can confirm, such as whether a default IngressClass exists. Read the Makefile, scripts and CI workflows for how manifests are applied and report any pinned kubectl or cluster version. Open a pull request with the validation output before and after. Target version: 1.31.0.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- 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
A pull request with two commits against k8s/app.yaml. The first rewrites the Ingress: a new apiVersion, a pathType on the one path, and the backend in its nested form. The second restores the swallowed - image: line in the Deployment. The description carries three kubeconform summaries: the original file against 1.21 (four valid, one invalid), the original against the target version (three valid, one invalid, one with no schema), and the result in strict mode with all five resources valid.
The reviewer's work is the list under the heading for things only a cluster can confirm. Schema validation proves the resource is well formed for that release. It does not prove that an ingress controller picks it up, that tls-secret exists in the blueprint namespace, or that the ssl-passthrough annotation is enabled on the controller. A server-side dry run against a real cluster, kubectl apply --dry-run=server -f k8s/app.yaml, is the check to make before merging, and the description gives the command.
Run it on every planned cluster upgrade
The useful time to run this is before the upgrade, not after the failed apply. Change the last line of the prompt to the version you are moving to and start one run per repository that holds manifests. From a script, send the request with that repository in resources and a request_id that is a UUID v5 of the repository name and target version, so running the script again for the same upgrade returns the run it already started.
For the failure case, add an automation on the Project with a github trigger on workflow_run.failure, so a deploy workflow that fails starts the run with the failure appended after the prompt as event text. The prompt is the only instruction, and a deploy that failed for another reason ends in a report with no pull request.
The use case this job follows, with its automation and trigger: Fix a bug from an alert.
Why run it on Rush?
An apply stops at the first resource the server rejects, so fixing by error message means one upgrade, one failure, one fix, repeated. Validating every manifest against the target release's schemas shows all of them at once, including files nobody has applied since they were written. The agent runs that in a sandbox, where installing a validator and pulling schema sets for two versions needs no one's workstation, and it keeps both summaries with the run so the pull request's numbers can be traced to a command.
It is also honest about its limit. Without your cluster the agent can prove the shape of a manifest and nothing about the controllers behind it, and the pull request says which is which. That split is what lets a reviewer merge the mechanical part quickly and spend their attention on the two or three questions that need a real API server.
Frequently asked questions
Can I just change the apiVersion line?
For Ingress, no. networking.k8s.io/v1 requires pathType on every path and replaced serviceName and servicePort with a nested service object, so a one-line edit produces a resource the API server rejects for a different reason. Some other kinds, such as a CronJob moving from batch/v1beta1 to batch/v1, do need only the version line.
Which pathType should I use?
Prefix matches the path and everything under it by path segment, and Exact matches only that path. ImplementationSpecific leaves it to the controller, which is how the removed version behaved. For a single / rule they all route the same traffic; for paths with regular expressions or trailing-slash rules, keep ImplementationSpecific unless you have tested the others on your controller.
Does this work for Helm charts?
Yes. The agent renders the chart with helm template and its default values, validates the output, and edits the templates that produced the failing resources. If a template already switches on the cluster's capabilities, it fixes the branch for current versions and leaves the legacy branch in place.
What about objects already running in the cluster?
Existing Ingress objects survived the upgrade, because the API server stores them once and serves them in whichever versions it still supports. What breaks is the next apply from a file that names the removed version. So the fix belongs in the repository, and nothing needs to be deleted from the cluster.