# Add an Ingress to a Kustomize App from a Linear Issue

Yes. An agent picks up the labelled Linear issue, adds an Ingress for your Kustomize app's Service, renders and validates it with kubectl kustomize and opens a PR.

[Run this on Rush](https://cloud.getrush.ai/run/add-ingress/kustomize/). Opens the console with this prompt ready to send, in a Project that has your repository.

## What the agent does

The agent starts from the Linear issue and the repository in its own sandbox, and reads the Kustomize tree before it writes a manifest. In a GitOps repository laid out like argoproj/argocd-example-apps, `kustomize-guestbook/kustomization.yaml` sets `namePrefix: kustomize-` and lists two resources: `guestbook-ui-deployment.yaml`, one replica of `gcr.io/google-samples/gb-frontend:v5` listening on container port 80, and `guestbook-ui-svc.yaml`, a Service with no `type`, so ClusterIP, from port 80 to target port 80 with the selector `app: guestbook-ui`. There is no Ingress, so the app is reachable only inside the cluster or through a port-forward, which is what the issue asks to change.

Rather than invent a shape, the agent copies the one the repository already uses. `sock-shop/base/front-end-ingress.yaml` is a `networking.k8s.io/v1` Ingress with `ingressClassName: nginx`, a host rule, a `/` path and a backend naming the `front-end` Service on port 80, listed in `sock-shop/kustomization.yaml` next to the Service it fronts. The new `kustomize-guestbook/guestbook-ui-ingress.yaml` follows it: the class and host from the issue, `pathType: Prefix` for `/`, the backend `guestbook-ui` on port 80, and a `tls` block with a secret name only if the issue asks for TLS. The backend is written with the unprefixed Service name, because the name prefix applies to every resource in the kustomization; the agent confirms in the render that Kustomize rewrites the backend reference to `kustomize-guestbook-ui` and, if a Kustomize version did not, says so rather than hard-coding the prefixed name.

Then it checks how the app is delivered. `apps/values.yaml` lists `kustomize-guestbook` among the applications that `apps/templates/applications.yaml` turns into Argo CD `Application` resources with `automated` sync, `prune` and `selfHeal`, pointing at the directory by path, so adding the file to `resources:` in `kustomization.yaml` is enough for the next sync to create the Ingress; no Application changes. The agent renders with `kubectl kustomize kustomize-guestbook`, installs `kubeconform` in its sandbox to validate the rendered Ingress against the Kubernetes schema, and runs `kubectl kustomize` on `sock-shop` too so a reviewer can see the existing Ingress and the new one side by side.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "A Linear issue labelled agent says: \"Expose kustomize-guestbook through an Ingress. Use the nginx ingress class and the host guestbook.example.internal, route / to the guestbook-ui Service on port 80, and follow how sock-shop declares its front-end Ingress.\" Do the work in this repository: add the Ingress to the kustomize-guestbook base and its kustomization, keep the backend name unprefixed and confirm in the render that the namePrefix is applied to it, run kubectl kustomize and kubeconform on the result, and open a pull request that links back to the issue and includes the rendered Ingress.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
```

1. **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.
2. **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.
3. **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

What comes back is a pull request that adds `kustomize-guestbook/guestbook-ui-ingress.yaml` and one line to `kustomize-guestbook/kustomization.yaml`. The Deployment, the Service and everything under `apps/` are untouched, so the only object Argo CD creates after merge is the Ingress.

The description links the issue, pastes the rendered Ingress with its prefixed name and rewritten backend, quotes the `kubeconform` summary, and lists the choices it made from the issue: the class, the host, the path type and whether TLS is on. If the issue left something out, such as the TLS secret's name, it says what it assumed and where to change it.

Before merging, a reviewer checks that an ingress controller with that class runs in the target cluster, that DNS for the host points at it, and that the health of the `Application` stays green after sync; an Ingress whose class has no controller sits with no address and no error.

## Run it on every Linear issue labelled platform

In the console, an automation in the Project with a `linear` trigger on `linear.issue.labeled` and the label `platform` starts one run per labelled issue, with the issue added after the saved prompt as its context and the Project's repository cloned. The trigger fills in no placeholder; the saved prompt says to do what the issue describes, render it and open a pull request that links back. An automation's runs are capped by its own `max_runs_per_hour`.

The pull request links the issue, so the person who labelled it sees the branch from Linear, and the run's transcript holds the render and the schema check for anyone who wants to see what was validated before they review the diff.

## Why run it on Rush?

An Ingress is a short manifest, and most of the risk is in the parts you cannot see in the file: whether the name prefix reaches the backend reference, whether the class matches a controller, and whether the GitOps layer needs a change too. The agent reads the kustomization, the apps-of-apps chart and the repository's own Ingress before it writes, and renders the result rather than reasoning about it.

On Rush the render and the schema validation run in the agent's own sandbox with the real tools, and the transcript keeps their output beside the diff. A team with many Kustomize apps can label many issues at once, and each run works in its own sandbox and opens its own pull request.

## Frequently asked questions

### Does the backend name need the namePrefix?

No. Kustomize's name reference rules rewrite an Ingress backend that names a Service in the same kustomization, so the file says `guestbook-ui` and the render shows `kustomize-guestbook-ui`. The agent checks this in the rendered output and reports it in the pull request rather than relying on it silently.

### Will Argo CD pick it up without an Application change?

Yes. The `Application` for the directory is generated from `apps/values.yaml` with automated sync, prune and self-heal, and it syncs the directory's kustomization as a whole. Adding the Ingress to `resources:` is the whole change on the GitOps side.

### What about TLS?

Only if the issue asks. When it does, the agent adds a `tls` entry with the host and a secret name and notes that the secret must exist or be issued by cert-manager in that namespace; it does not add cert-manager annotations unless the issue names an issuer.

### How is the manifest validated without a cluster?

With `kubectl kustomize` for the render and `kubeconform` for the schema, both run in the sandbox. That catches a wrong `apiVersion`, a misplaced `pathType` or a backend with no port before anything reaches a cluster; what it cannot check is whether the class has a controller, which the pull request leaves to the reviewer.

## More Kustomize jobs

- [Validate Every Kustomize Build With kubeconform in CI](https://getrush.ai/run/add-kubeconform-to-ci/kustomize/)
- [Add Liveness and Readiness Probes with a Kustomize Patch](https://getrush.ai/run/add-liveness-readiness-probes/kustomize/)
- [Add NetworkPolicies to a Kustomize App](https://getrush.ai/run/add-network-policies/kustomize/)

## The same job on other stacks

- [Add an Ingress Template to a Helm Chart](https://getrush.ai/run/add-ingress/helm/)
- [Add an Ingress to a Kubernetes App](https://getrush.ai/run/add-ingress/kubernetes/)

## More jobs like this: Turn a Linear label into a PR

- [Add Input Validation to an Actix Web App from a Linear Issue](https://getrush.ai/run/add-input-validation/actix/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
