Skill name: ingress2gateway
Intent and objective
Automate the discovery, analysis, risk-profiling, and translation of legacy GKE
and NGINX Ingress resources into native GKE Gateway API specifications using the
ingress2gateway tool.
Activation criteria
- Use when: Migrating legacy GKE or NGINX Ingress manifests to native GKE
Gateway API specifications (Gateway, HTTPRoute)
Prerequisites and sandbox configuration
1. Environment sandbox specification
This skill runs in a local sandbox environment with the following
specifications:
- Type:
local-sandbox
- Python Version:
>=3.10
- Virtual Environment Path:
.agent/skills/ingress2gateway/scripts/.venv
- Requirements Lockfile:
.agent/skills/ingress2gateway/scripts/requirements.txt
2. Host binary constraints (prerequisites validation)
Before execution, verify the following host binary constraints:
- python3: Must be version
>=3.10 (check using python3 --version).
- gcloud: Required to handle identity challenges, project queries, and GKE
cluster authentication (check using
gcloud --version).
- kubectl: Must be version
>=1.30 (check using
kubectl version --client -o json). Required to interact with GKE 1.30+
compatible APIs.
3. Secure outbound network allowlists (egress guardrails)
The sandbox requires outbound HTTPS access to the following domains:
github.com: To verify network download access to the ingress2gateway
repository releases without downloading assets.
*.googleapis.com: To authenticate Google Cloud identities and communicate
with GKE Control Planes.
dl.google.com: To download Google Cloud SDK framework assets and kubectl
components if missing.
bootstrap.pypa.io: As a secure fallback to fetch get-pip.py if the host
environment lacks pip and ensurepip completely.
Interactive JSON exchange protocol (crucial)
This skill utilizes a strict JSON payload protocol on stdout (delimited by
__AGENT_UI_DATA_START__ and __AGENT_UI_DATA_END__) and expects a JSON
response on stdin for every user input step.
The executing agent must:
- Never truncate or summarize any JSON payloads emitted between
__AGENT_UI_DATA_START__ and __AGENT_UI_DATA_END__. Display them in full
to the user.
- Never make assumptions or skip user input. Prompt the user for input at
every single stage the script pauses and waits for
stdin.
- Format user choices as the required JSON structure and append a
newline (
\n) before writing to the script's stdin.
- Render Risk Profiles Visually: When presenting the risk profile at Phase
4, the agent must render a clear Markdown table of the compatible (Green
Lane) and incompatible (Red Lane) resources, detailing the risks/blockers,
so the operator can make an informed decision.
Strict execution lifecycle and master report pipeline
Master report markdown template (to be updated incrementally)
The structural markdown template for the migration analysis report is maintained
in assets/report_template.md.
When initialized or updated across the pipeline phases, the runtime engine
automatically copies this template to output
GKE_Ingress_to_Gateway_API_Migration_Analysis_Report.md and incrementally
populates its section placeholders.
Structured macro-pipeline execution phases
You will advance strictly through these 6 consecutive operational phases.
- Phase 1: Environment Sandbox Pre-flight Validation.
- Phase 2: Identity & Context Resolution
- Phase 3: Resource Discovery & Target Inventory.
- Phase 4: Ingress scanning & Risk Profiling.
- Phase 5: Translation & Dry Run validation.
- Phase 6: Approval and execution
Phase 1: Environment sandbox pre-flight validation
Before executing any Python scripts or processing cluster manifests, you
must verify and initialize the local environment by reading and following
the pre-flight validation instructions in references/preflight_validation.md.
Phase 2: Identity and context resolution
Invoke the Core Python Script: Instantly upon entering Phase 2, run the
python orchestrator script:
python3 .agent/skills/ingress2gateway/scripts/main.py
Cluster Discovery UI Payload: The script discovers GKE clusters and
emits a JSON payload (select_cluster). Intercept this payload, present
options to the operator, and write the choice to the script's stdin.
Kubeconfig Sandboxing: Once selected, the script configures local
sandboxed credentials for the chosen GKE cluster.
Phase 3: Resource discovery and target inventory
- Orchestrated Scanning: The active script scans the target GKE cluster
context to discover Ingress manifests.
- Incremental Report Generation: The script copies the report template to
GKE_Ingress_to_Gateway_API_Migration_Analysis_Report.md and updates the
[Populated in Phase 3] placeholder with the target inventory.
- Intermediate UI Exchange: The script does not pause at this stage, but
advances to Phase 4.
Phase 4: Ingress scanning and risk profiling
Automated Risk Triage: The scanner.py sub-component will
programmatically evaluate metadata arrays for custom or native rewrite
snippets.
Incremental Document Update: The script replaces the [Populated in Phase
4] placeholder with a breakdown of Critical Blockers and Translation
Warnings discovered during verification.
Interactive JSON Handoff Gate: The agent must capture the script's
emitted stdout payload between AGENT_UI_DATA_START and
AGENT_UI_DATA_END. Display the comprehensive risk inventory full-string
array to the operator, pause processing execution, and wait for a structured
JSON map selection on stdin identifying approved migration asset targets.
Phase 5: Translation and dry run validation
Translation Execution: The engine passes approved target JSON structures
to translator.py, which pulls down and runs the pre-compiled ingress2gateway
compiler to generate native Gateway API resource maps.
Validation & Safety Check: The script executes the dry-run
kubectl apply --dry-run=server -f {GATEWAY_API_MANIFEST_YAML} command
against the target cluster context. It analyzes the resulting stdout/stderr
for validation errors and captures the server response using Kubernetes API.
Incremental Document Update: The script replaces the [Populated in Phase
5 & 6] placeholder with the consolidated raw Gateway, HttpRoute and URLMap
API manifest, the detected server-side validation results, and a detailed
explanation of any translation or deployment anomalies.
Interactive Deployment Signature: The script prints out the compilation
details using the approve_deployment UI protocol template. The agent must
display this text entirely and halt, blocking the runtime sequence until the
user submits a signed APPROVE or CANCEL string map to stdin.
Conditional Execution Gate:
- If the validation response indicates zero deploy-time errors, the agent
immediately proceeds to Phase 6 (Execution).
- If validation errors are returned, the agent must halt, append a
comprehensive error report to the bottom of the Markdown document, display
the final document, and explicitly ask the user for permission to
proceed with manual correction or bypass strict validation rules.
Phase 6: Approval and execution
Live Data Plane Injection: If the interaction response on stdin reads
APPROVE, the script applies the manifests to the cluster using kubectl apply
-f -. It then overwrites the final placeholders with a complete transaction
receipt string block.
Conditional Execution Gate: If the response reads CANCEL, the script
intercepts the rejection, dumps the fully compiled Gateway configurations
locally into a migration-fallback.yaml asset backup, and posts a Deployment
Paused status block to the analysis file.
Mandatory Hold & Exit: Once the underlying script lifecycle gracefully
exits, the agent must present a final execution summary to the workspace
terminal and wait for further user interaction commands.
1---2name: ingress2gateway3description: Automates migrating legacy GKE Ingress resources to the modern Gateway API. Use when migrating legacy GKE or NGINX Ingress resources to GKE Gateway API specifications.4---56# Skill name: ingress2gateway78## Intent and objective910Automate the discovery, analysis, risk-profiling, and translation of legacy GKE11and NGINX Ingress resources into native GKE Gateway API specifications using the12`ingress2gateway` tool.1314### Activation criteria1516- **Use when:** Migrating legacy GKE or NGINX Ingress manifests to native GKE17 Gateway API specifications (Gateway, HTTPRoute)1819## Prerequisites and sandbox configuration2021### 1. Environment sandbox specification2223This skill runs in a local sandbox environment with the following24specifications:2526- **Type:** `local-sandbox`27- **Python Version:** `>=3.10`28- **Virtual Environment Path:** `.agent/skills/ingress2gateway/scripts/.venv`29- **Requirements Lockfile:**30 `.agent/skills/ingress2gateway/scripts/requirements.txt`3132### 2. Host binary constraints (prerequisites validation)3334Before execution, verify the following host binary constraints:3536- **python3:** Must be version `>=3.10` (check using `python3 --version`).37- **gcloud:** Required to handle identity challenges, project queries, and GKE38 cluster authentication (check using `gcloud --version`).39- **kubectl:** Must be version `>=1.30` (check using40 `kubectl version --client -o json`). Required to interact with GKE 1.30+41 compatible APIs.4243### 3. Secure outbound network allowlists (egress guardrails)4445The sandbox requires outbound HTTPS access to the following domains:4647- `github.com`: To verify network download access to the `ingress2gateway`48 repository releases without downloading assets.49- `*.googleapis.com`: To authenticate Google Cloud identities and communicate50 with GKE Control Planes.51- `dl.google.com`: To download Google Cloud SDK framework assets and `kubectl`52 components if missing.53- `bootstrap.pypa.io`: As a secure fallback to fetch `get-pip.py` if the host54 environment lacks pip and ensurepip completely.5556## Interactive JSON exchange protocol (crucial)5758This skill utilizes a strict JSON payload protocol on `stdout` (delimited by59`__AGENT_UI_DATA_START__` and `__AGENT_UI_DATA_END__`) and expects a JSON60response on `stdin` for every user input step.6162The executing agent must:63641. **Never truncate or summarize any JSON payloads** emitted between65 `__AGENT_UI_DATA_START__` and `__AGENT_UI_DATA_END__`. Display them in full66 to the user.671. **Never make assumptions or skip user input.** Prompt the user for input at68 every single stage the script pauses and waits for `stdin`.691. **Format user choices as the required JSON structure and append a**70 **newline (`\n`)** before writing to the script's `stdin`.711. **Render Risk Profiles Visually:** When presenting the risk profile at Phase72 4, the agent must render a clear Markdown table of the compatible (Green73 Lane) and incompatible (Red Lane) resources, detailing the risks/blockers,74 so the operator can make an informed decision.7576## Strict execution lifecycle and master report pipeline7778### Master report markdown template (to be updated incrementally)7980The structural markdown template for the migration analysis report is maintained81in `assets/report_template.md`.8283When initialized or updated across the pipeline phases, the runtime engine84automatically copies this template to output85`GKE_Ingress_to_Gateway_API_Migration_Analysis_Report.md` and incrementally86populates its section placeholders.8788## Structured macro-pipeline execution phases8990You will advance strictly through these 6 consecutive operational phases.9192- **Phase 1:** Environment Sandbox Pre-flight Validation.93- **Phase 2:** Identity & Context Resolution94- **Phase 3:** Resource Discovery & Target Inventory.95- **Phase 4:** Ingress scanning & Risk Profiling.96- **Phase 5:** Translation & Dry Run validation.97- **Phase 6:** Approval and execution9899### Phase 1: Environment sandbox pre-flight validation100101Before executing any Python scripts or processing cluster manifests, you102**must** verify and initialize the local environment by reading and following103the pre-flight validation instructions in `references/preflight_validation.md`.104105### Phase 2: Identity and context resolution1061071. **Invoke the Core Python Script:** Instantly upon entering Phase 2, run the108 python orchestrator script:109110 ```bash111 python3 .agent/skills/ingress2gateway/scripts/main.py112 ```1131141. **Cluster Discovery UI Payload:** The script discovers GKE clusters and115 emits a JSON payload (`select_cluster`). Intercept this payload, present116 options to the operator, and write the choice to the script's `stdin`.1171. **Kubeconfig Sandboxing:** Once selected, the script configures local118 sandboxed credentials for the chosen GKE cluster.119120### Phase 3: Resource discovery and target inventory1211221. **Orchestrated Scanning:** The active script scans the target GKE cluster123 context to discover Ingress manifests.1241. **Incremental Report Generation:** The script copies the report template to125 `GKE_Ingress_to_Gateway_API_Migration_Analysis_Report.md` and updates the126 `[Populated in Phase 3]` placeholder with the target inventory.1271. **Intermediate UI Exchange:** The script does not pause at this stage, but128 advances to Phase 4.129130### Phase 4: Ingress scanning and risk profiling1311321. **Automated Risk Triage:** The scanner.py sub-component will133 programmatically evaluate metadata arrays for custom or native rewrite134 snippets.1351361. **Incremental Document Update:** The script replaces the [Populated in Phase137 4] placeholder with a breakdown of Critical Blockers and Translation138 Warnings discovered during verification.1391401. **Interactive JSON Handoff Gate:** The agent must capture the script's141 emitted stdout payload between **AGENT_UI_DATA_START** and142 **AGENT_UI_DATA_END**. Display the comprehensive risk inventory full-string143 array to the operator, pause processing execution, and wait for a structured144 JSON map selection on stdin identifying approved migration asset targets.145146### Phase 5: Translation and dry run validation1471481. **Translation Execution:** The engine passes approved target JSON structures149 to translator.py, which pulls down and runs the pre-compiled ingress2gateway150 compiler to generate native Gateway API resource maps.1511521. **Validation & Safety Check:** The script executes the dry-run153 `kubectl apply --dry-run=server -f {GATEWAY_API_MANIFEST_YAML}` command154 against the target cluster context. It analyzes the resulting stdout/stderr155 for validation errors and captures the server response using Kubernetes API.1561571. **Incremental Document Update:** The script replaces the [Populated in Phase158 5 & 6] placeholder with the consolidated raw Gateway, HttpRoute and URLMap159 API manifest, the detected server-side validation results, and a detailed160 explanation of any translation or deployment anomalies.1611621. **Interactive Deployment Signature:** The script prints out the compilation163 details using the approve_deployment UI protocol template. The agent must164 display this text entirely and halt, blocking the runtime sequence until the165 user submits a signed APPROVE or CANCEL string map to stdin.1661671. **Conditional Execution Gate:**168169 - If the validation response indicates zero deploy-time errors, the agent170 immediately proceeds to Phase 6 (Execution).171 - If validation errors are returned, the agent **must halt**, append a172 comprehensive error report to the bottom of the Markdown document, display173 the final document, and explicitly **ask the user for permission to174 proceed with manual correction or bypass strict validation rules.**175176### Phase 6: Approval and execution1771781. **Live Data Plane Injection:** If the interaction response on stdin reads179 APPROVE, the script applies the manifests to the cluster using kubectl apply180 -f -. It then overwrites the final placeholders with a complete transaction181 receipt string block.1821831. **Conditional Execution Gate:** If the response reads CANCEL, the script184 intercepts the rejection, dumps the fully compiled Gateway configurations185 locally into a migration-fallback.yaml asset backup, and posts a Deployment186 Paused status block to the analysis file.1871881. **Mandatory Hold & Exit:** Once the underlying script lifecycle gracefully189 exits, the agent must present a final execution summary to the workspace190 terminal and wait for further user interaction commands.