Implements the Ambassador pattern: Emissary-ingress (Edge Stack) as API gateway with Mapping CRDs, plus per-pod ambassador sidecars.
Agentic Workflow: Read -> Reason -> Act (ambassador-pattern)
You are Ambassador Pattern (api/general) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — api context for ambassador-pattern
- Domain: Implements the Ambassador pattern: Emissary-ingress (Edge Stack) as API gateway with Mapping CRDs, plus per-pod ambassador sidecars.
- edge-stack: Install and operate Emissary-ingress and its CRDs. —
kubectl apply -f https://app.getambassador.io/yaml/edge-stack/latest/aes-crds.ya - sidecar-proxy: Add ambassador sidecar containers to pods and debug their traffic. —
kubectl apply -f sidecar-pod.yaml - Check
knowledgeandprerequisites: kubectl
2. Reason — think for ambassador-pattern
- For
edge-stack: Install and operate Emissary-ingress and its CRDs. — decide which checks to run - For
sidecar-proxy: Add ambassador sidecar containers to pods and debug their traffic. — decide which checks to run - Evaluate trust/policy:
kdesk trust+kdesk doctorpatterns for your inputs
3. Act — execute with ambassador-pattern tools
- Tools:
Glob,Grep,Read,Bash(see frontmattertools/allowed-tools) - Use
safe_pathfor any write; record evidence (paths, checksums) - Fingerprint:
ambassador-pattern:31ebe7b6
Ambassador Pattern
What this skill does
Implements the ambassador (sidecar proxy) architecture: Emissary-ingress as the edge gateway with Mapping CRDs, and per-pod sidecars that handle retries, auth, TLS, and observability for the app container.
When to use
- A service needs consistent auth/TLS/retry logic without code changes
- Routing to microservices by hostname/path at the gateway
- Offloading circuit breaking and tracing to a sidecar
Real commands
# Install Emissary-ingress (Edge Stack)
kubectl apply -f https://app.getambassador.io/yaml/edge-stack/latest/aes-crds.yaml
kubectl apply -f https://app.getambassador.io/yaml/edge-stack/latest/aes.yaml
kubectl get pods -n ambassador
# Inspect mappings
kubectl get mappings.getambassador.io
kubectl describe mapping api-mapping
# Sidecar troubleshooting
kubectl logs -c ambassador-sidecar my-api-7d9f5c64b9-x4k2n
Mapping CRD
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: api-mapping
spec:
hostname: "api.your-app.test"
prefix: /v1/
service: api-service:8080
timeout_ms: 5000
Testing
- Port-forward the gateway and curl http://localhost:8080/v1/health
- Verify mapping routing with
kubectl get mapping -o yaml
Best practices
- Keep gateway logic in CRDs (git-ops friendly), not imperative config
- Right-size sidecars with requests/limits
- Prefer Emissary filters (AuthService/FilterPolicy) over app-level auth
Capabilities
edge-stack
Install and operate Emissary-ingress and its CRDs.
Parameters:
namespace(string): Namespace where Edge Stack runs (default ambassador)mapping_name(string): Name of the Mapping CRD to inspect
Commands:
kubectl apply -f https://app.getambassador.io/yaml/edge-stack/latest/aes-crds.yamlkubectl apply -f https://app.getambassador.io/yaml/edge-stack/latest/aes.yamlkubectl get mappings.getambassador.iokubectl get pods -n ambassadorkubectl port-forward svc/edge-stack 8080:80 -n ambassador
Examples:
- kubectl apply -f https://app.getambassador.io/yaml/edge-stack/latest/aes-crds.yaml && kubectl apply -f https://app.getambassador.io/yaml/edge-stack/latest/aes.yaml
- kubectl get mappings.getambassador.io --namespace=default
- kubectl describe mapping api-mapping
sidecar-proxy
Add ambassador sidecar containers to pods and debug their traffic.
Parameters:
pod(string): Pod name with the sidecarcontainer(string): Container name, e.g. ambassador-sidecar
Commands:
kubectl apply -f sidecar-pod.yamlkubectl get pods -l app=my-apikubectl logs -c ambassador-sidecar my-api-7d9f5c64b9-x4k2nkubectl exec -it my-api-7d9f5c64b9-x4k2n -c my-api -- curl -s localhost:15001/healthkubectl describe pod my-api-7d9f5c64b9-x4k2n
Examples:
- kubectl logs -f -c ambassador-sidecar my-api-7d9f5c64b9-x4k2n
- kubectl exec -c my-api my-api-7d9f5c64b9-x4k2n -- env | grep AMBASSADOR
- kubectl top pod my-api-7d9f5c64b9-x4k2n