api-gateway-service-mesh
Skill1 starsChanged 4 months agoMITView on GitHub
API gateway and service mesh architecture: Istio strict mTLS and authorization policy, VirtualService traffic shifting, Envoy Gateway and Kong ingress, retries/timeouts/outlier detection, and rate limiting. Use when configuring ingress routing, enforcing zero-trust service-to-service traffic, or debugging mesh routing and mTLS failures.
In this repository167 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/rules/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-index.mdcCursor rule
- .cursor/rules/skills/ai-agent-security-llm-threats.mdcCursor rule
- .cursor/rules/skills/api-gateway-service-mesh.mdcCursor rule
- .cursor/rules/skills/aws-cloud-migration-strategies.mdcCursor rule
- .cursor/rules/skills/aws-eks-enterprise-patterns.mdcCursor rule
- .cursor/rules/skills/aws-iam-zero-trust-policies.mdcCursor rule
- .cursor/rules/skills/azure-aks-enterprise-landing-zones.mdcCursor rule
- .cursor/rules/skills/azure-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/backup-and-disaster-recovery.mdcCursor rule
- .cursor/rules/skills/chaos-engineering-resilience-testing.mdcCursor rule
- .cursor/rules/skills/cicd-pipeline-design.mdcCursor rule
- .cursor/rules/skills/cloud-native-microservices-patterns.mdcCursor rule
- .cursor/rules/skills/cloud-security-posture-cspm-cis.mdcCursor rule
- .cursor/rules/skills/configuration-management-ansible.mdcCursor rule
- .cursor/rules/skills/container-runtime-security-falco.mdcCursor rule
- .cursor/rules/skills/database-devops-lifecycle.mdcCursor rule
- .cursor/rules/skills/detection-engineering-threat-hunting.mdcCursor rule
- .cursor/rules/skills/devops-metrics-dora-kpis.mdcCursor rule
- .cursor/rules/skills/docker-containerization-basics.mdcCursor rule
- .cursor/rules/skills/enterprise-iac-governance-terragrunt.mdcCursor rule
- .cursor/rules/skills/finops-framework-inform-optimize-operate.mdcCursor rule
- .cursor/rules/skills/gcp-cloud-engineering-patterns.mdcCursor rule
- .cursor/rules/skills/gcp-gke-autopilot-multi-tenant.mdcCursor rule
- .cursor/rules/skills/git-branching-merge-strategies.mdcCursor rule
- .cursor/rules/skills/gitops-multi-cluster-argo-flux.mdcCursor rule
- .cursor/rules/skills/helm-kubernetes-deployment.mdcCursor rule
- .cursor/rules/skills/incident-management-and-postmortem.mdcCursor rule
- .cursor/rules/skills/infrastructure-host-monitoring.mdcCursor rule
- .cursor/rules/skills/internal-developer-portal-backstage.mdcCursor rule
- .cursor/rules/skills/linux-sysadmin-troubleshooting.mdcCursor rule
- .cursor/rules/skills/performance-load-testing.mdcCursor rule
- .cursor/rules/skills/policy-as-code-opa-kyverno.mdcCursor rule
- .cursor/rules/skills/prometheus-grafana-otel-tracing.mdcCursor rule
- .cursor/rules/skills/scalability-high-availability-patterns.mdcCursor rule
- .cursor/rules/skills/scripting-and-automation.mdcCursor rule
- .cursor/rules/skills/secops-incident-triage-forensics.mdcCursor rule
- .cursor/rules/skills/secrets-management-vault-kms.mdcCursor rule
- .cursor/rules/skills/serverless-event-driven-architecture.mdcCursor rule
- .cursor/rules/skills/shift-left-security-sast-sca.mdcCursor rule
- .cursor/rules/skills/sli-slo-error-budget-design.mdcCursor rule
- .cursor/rules/skills/supply-chain-security-slsa-sigstore.mdcCursor rule
- .cursor/rules/skills/terraform-iac-modules.mdcCursor rule
- .cursor/rules/skills/write-a-skill.mdcCursor rule
- .cursor/rules/skills/zero-downtime-release-strategies.mdcCursor rule
- ai-agent-security-llm-threatsSkill
- aws-cloud-migration-strategiesSkill
- aws-eks-enterprise-patternsSkill
- aws-iam-zero-trust-policiesSkill
- azure-aks-enterprise-landing-zonesSkill
- azure-cloud-engineering-patternsSkill
- backup-and-disaster-recoverySkill
- chaos-engineering-resilience-testingSkill
- cicd-pipeline-designSkill
- cloud-native-microservices-patternsSkill
- cloud-security-posture-cspm-cisSkill
- configuration-management-ansibleSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
Don't: Never configure retries without idempotent request semantics or backoff limits.
- Distinctive: line 154
Prefer Gateway API for new ingress: it is the direction all three implementations are moving, and it keeps the routing contract portable …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API Gateway & Service Mesh (Istio & Envoy) Architecture
When to Use This Skill
Triggers — load this skill when:
- North-south ingress or east-west mesh routing must be designed or changed
- Service-to-service traffic needs mTLS and authorization policy
- A 503/routing/mTLS failure inside the mesh needs diagnosis
Route elsewhere when:
- Weighted rollout automation ->
zero-downtime-release-strategies - Application-side resilience patterns ->
scalability-high-availability-patterns - Mesh telemetry pipelines ->
prometheus-grafana-otel-tracing
1. Istio Zero-Trust Strict mTLS & VirtualService Traffic Shifting
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: default
namespace: production
spec:
mtls:
mode: STRICT # Enforce encrypted mTLS across all service-to-service traffic
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: user-service-route
namespace: production
spec:
hosts:
- "user-service.production.svc.cluster.local"
http:
- route:
- destination:
host: user-service.production.svc.cluster.local
subset: v1
weight: 90
- destination:
host: user-service.production.svc.cluster.local
subset: v2
weight: 10
retries:
attempts: 3
perTryTimeout: 2s
retryOn: "5xx,connect-failure,refused-stream"2. Best Practices & Anti-Patterns
- Do: Enforce
STRICTmTLS across internal namespaces to prevent unauthenticated lateral movement. - Do: Implement API Gateway rate limiting and authentication (JWT verification) at the edge before traffic enters the cluster mesh.
- Don't: Never configure retries without idempotent request semantics or backoff limits.
3. Default-Deny Authorization & Outlier Detection
mTLS proves who is calling; authorization decides whether they may. Strict mTLS without an AuthorizationPolicy still allows every service to call every other service.
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata: { name: deny-all, namespace: prod } # 1. default deny for the namespace
spec: {} # empty spec + no rules = deny everything
---
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata: { name: checkout-allow-from-web, namespace: prod }
spec:
selector: { matchLabels: { app: checkout } }
action: ALLOW
rules:
- from:
- source:
principals: ["cluster.local/ns/prod/sa/web-frontend"] # SPIFFE identity, not IP
to:
- operation: { methods: ["POST"], paths: ["/api/v1/checkout"] }DestinationRule carries the client-side resilience settings the application would otherwise have to implement:
apiVersion: networking.istio.io/v1
kind: DestinationRule
metadata: { name: checkout, namespace: prod }
spec:
host: checkout.prod.svc.cluster.local
trafficPolicy:
tls: { mode: ISTIO_MUTUAL }
connectionPool:
tcp: { maxConnections: 200, connectTimeout: 2s }
http: { http2MaxRequests: 500, maxRequestsPerConnection: 100 }
outlierDetection: # passive health checking = circuit breaking
consecutive5xxErrors: 5
interval: 10s
baseEjectionTime: 30s
maxEjectionPercent: 50 # never eject the whole fleet
subsets:
- name: v1
labels: { version: v1 }
- name: v2
labels: { version: v2 }503 UC/UF means the sidecar could not reach upstream: check istioctl proxy-config
endpoints, whether the port name carries the right protocol prefix, and whether outlier
detection has ejected the endpoints. maxRequestsPerConnection: 1 disables keep-alive — set it
only for upstreams that mishandle connection reuse.
4. Gateway Choice: Istio Gateway, Envoy Gateway or Kong
North-south ingress and east-west mesh are separate decisions; conflating them produces two overlapping control planes.
| Option | Config surface | Choose it when |
| Istio Ingress Gateway | Istio CRDs (Gateway, VirtualService) | The mesh is already Istio and one control plane is preferred |
| Envoy Gateway | Kubernetes Gateway API (HTTPRoute, GRPCRoute) | Standards-based routing wanted, mesh-agnostic, no Istio lock-in |
| Kong | Kong CRDs / declarative config, plugin ecosystem | API-management needs dominate: consumers, keys, quotas, monetisation |
# Gateway API — portable across Envoy Gateway, Istio and Kong implementations
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata: { name: checkout, namespace: prod }
spec:
parentRefs: [{ name: public-gateway, namespace: istio-system }]
hostnames: ["checkout.example.com"]
rules:
- matches: [{ path: { type: PathPrefix, value: /api/v1 } }]
timeouts: { request: 10s }
backendRefs: [{ name: checkout, port: 8080, weight: 100 }]Prefer Gateway API for new ingress: it is the direction all three implementations are moving, and it keeps the routing contract portable while mesh-internal policy stays in Istio CRDs. Kong earns its place when the requirement is an API product (consumer onboarding, rate-limit tiers, keys), not merely routing.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

