[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M737PPW1D2EC7G98DQ34F93M":3,"skill-same:01M737PPW1D2EC7G98DQ34F93M":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":6,"updatedAt":44,"install":45,"resources":58},"01M737PPW1D2EC7G98DQ34F93M","configure-api-gateway",null,"Deploy and configure an API gateway (Kong or Traefik) to handle API traffic management, authentication, rate limiting, request\u002Fresponse transformation, and routing. Covers plugin configuration, upstream services, consumer management, and integration with existing infrastructure. Use when multiple backend services need a unified API endpoint, when centralized authentication or rate limiting is required, when implementing API versioning, or when needing detailed analytics and load balancing for microservices.","roohe\u002Fagentic-super-skills","roohe","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99054084?v=4","01M734WCDFP6RZVT5CNM00QR26","01M734WCE4BD0T4NZS5PCV9V5F",10,"MIT","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fconfigure-api-gateway\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: configure-api-gateway\nlocale: caveman-lite\nsource_locale: en\nsource_commit: 82c77053\ntranslator: \"Julius Brussee homage — caveman\"\ntranslation_date: \"2026-04-19\"\ndescription: >\n  Deploy and configure an API gateway (Kong or Traefik) to handle API traffic management,\n  authentication, rate limiting, request\u002Fresponse transformation, and routing. Covers plugin\n  configuration, upstream services, consumer management, and integration with existing\n  infrastructure. Use when multiple backend services need a unified API endpoint, when\n  centralized authentication or rate limiting is required, when implementing API versioning,\n  or when needing detailed analytics and load balancing for microservices.\nlicense: MIT\nallowed-tools: Read Write Edit Bash Grep Glob\nmetadata:\n  author: Philipp Thoss\n  version: \"1.0\"\n  domain: devops\n  complexity: intermediate\n  language: multi\n  tags: api-gateway, kong, traefik, rate-limiting, authentication, routing, middleware\n---\n\n# Configure API Gateway\n\nDeploy and configure an API gateway for centralized API traffic management and policy enforcement.\n\n## When to Use\n\n- Multiple backend services need unified API endpoint with consistent policies\n- Require centralized authentication\u002Fauthorization for API access\n- Need rate limiting and quota management across APIs\n- Want to transform requests\u002Fresponses without modifying backend services\n- Implementing API versioning and deprecation strategies\n- Need detailed API analytics and monitoring\n- Require service discovery and load balancing for microservices\n\n## Inputs\n\n- **Required**: Kubernetes cluster or Docker environment\n- **Required**: Choice of API gateway (Kong or Traefik)\n- **Required**: Backend service endpoints to proxy\n- **Optional**: Authentication provider (OAuth2, OIDC, API keys)\n- **Optional**: Rate limiting requirements (requests per minute\u002Fhour)\n- **Optional**: Custom middleware or plugin configurations\n- **Optional**: TLS certificates for HTTPS endpoints\n\n## Procedure\n\n> See [Extended Examples](references\u002FEXAMPLES.md) for complete configuration files and templates.\n\n### Step 1: Install API Gateway\n\nDeploy the API gateway with database (Kong) or file-based config (Traefik).\n\n**For Kong with PostgreSQL:**\n```yaml\n# kong-deployment.yaml (excerpt - see EXAMPLES.md for complete file)\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: kong\n---\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: kong\n  namespace: kong\nspec:\n  replicas: 2\n  # ... (PostgreSQL, migrations, services - see EXAMPLES.md)\n```\n\n**For Traefik:**\n```yaml\n# traefik-deployment.yaml (excerpt - see EXAMPLES.md for complete file)\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: traefik\n---\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: traefik\n  namespace: traefik\nspec:\n  replicas: 2\n  # ... (RBAC, ConfigMap, services - see EXAMPLES.md)\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-1-install-api-gateway) for the complete deployment manifests\n\nDeploy:\n```bash\nkubectl apply -f kong-deployment.yaml  # OR traefik-deployment.yaml\nkubectl wait --for=condition=ready pod -l app=kong -n kong --timeout=300s\nkubectl get svc -n kong kong-proxy  # Get load balancer IP\n```\n\n**Got:** Gateway pods running with 2 replicas. Load balancer service has external IP assigned. Admin API accessible (Kong: port 8001, Traefik: dashboard port 8080). Health checks passing.\n\n**If fail:**\n- Check pod logs: `kubectl logs -n kong -l app=kong`\n- Verify database connection (Kong): `kubectl logs -n kong kong-migrations-\u003Chash>`\n- Check service account permissions (Traefik): `kubectl get clusterrolebinding traefik -o yaml`\n- Ensure ports not already bound: `kubectl get svc --all-namespaces | grep 8000`\n\n### Step 2: Configure Backend Services and Routes\n\nDefine upstream services and create routes to expose APIs.\n\n**For Kong (using decK for declarative config):**\n```bash\n# Install decK CLI\ncurl -sL https:\u002F\u002Fgithub.com\u002FKong\u002Fdeck\u002Freleases\u002Fdownload\u002Fv1.28.0\u002Fdeck_1.28.0_linux_amd64.tar.gz | tar -xz\nsudo mv deck \u002Fusr\u002Flocal\u002Fbin\u002F\n\n# Create kong.yaml with services, routes, upstreams\n# (see EXAMPLES.md for complete configuration)\ndeck sync --kong-addr http:\u002F\u002Flocalhost:8001 -s kong.yaml\ncurl -i http:\u002F\u002Flocalhost:8001\u002Froutes  # Verify routes\n```\n\n**For Traefik (using IngressRoute CRD):**\n```yaml\n# traefik-routes.yaml (excerpt)\napiVersion: traefik.io\u002Fv1alpha1\nkind: IngressRoute\nmetadata:\n  name: user-api-route\nspec:\n  entryPoints: [websecure]\n  routes:\n  - match: Host(`api.example.com`) && PathPrefix(`\u002Fapi\u002Fusers`)\n    # ... (see EXAMPLES.md for full configuration)\n```\n\nApply routes:\n```bash\nkubectl apply -f traefik-routes.yaml\ncurl -H \"Host: api.example.com\" https:\u002F\u002FGATEWAY_IP\u002Fapi\u002Fusers\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-2-configure-backend-services-and-routes) for complete routing configurations\n\n**Got:** Routes correctly proxy traffic to backend services. Weighted routing distributes traffic according to configuration. Health checks monitor backend service health.\n\n**If fail:**\n- Verify backend services running: `kubectl get svc -n default`\n- Check DNS resolution: `kubectl run test --rm -it --image=busybox -- nslookup user-service.default.svc.cluster.local`\n- Review gateway logs: `kubectl logs -n kong -l app=kong --tail=50`\n- Validate configuration: `deck validate -s kong.yaml`\n\n### Step 3: Implement Authentication and Authorization\n\nConfigure authentication plugins\u002Fmiddleware for API security.\n\n**For Kong (API Key and JWT authentication):**\n```yaml\n# kong-auth-config.yaml (excerpt)\nconsumers:\n- username: mobile-app\n  custom_id: app-001\n\nkeyauth_credentials:\n- consumer: mobile-app\n  key: mobile-secret-key-123\n\nplugins:\n- name: key-auth\n  service: user-api\n  # ... (see EXAMPLES.md for full configuration)\n```\n\n```bash\ndeck sync --kong-addr http:\u002F\u002Flocalhost:8001 -s kong-auth-config.yaml\ncurl -i -H \"apikey: mobile-secret-key-123\" http:\u002F\u002FGATEWAY_IP\u002Fapi\u002Fusers\n```\n\n**For Traefik (BasicAuth and ForwardAuth middleware):**\n```yaml\n# traefik-auth-middleware.yaml (excerpt)\napiVersion: traefik.io\u002Fv1alpha1\nkind: Middleware\nmetadata:\n  name: basic-auth-middleware\nspec:\n  basicAuth:\n    secret: basic-auth\n    removeHeader: true\n# ... (see EXAMPLES.md for OAuth2, rate limiting)\n```\n\n```bash\nkubectl apply -f traefik-auth-middleware.yaml\ncurl -u user1:password https:\u002F\u002FGATEWAY_IP\u002Fapi\u002Fprotected\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-3-implement-authentication-and-authorization) for complete authentication configurations\n\n**Got:** Unauthenticated requests return 401. Valid credentials allow access. Rate limiting returns 429 after threshold. JWT tokens validate correctly. ACL enforces group permissions.\n\n**If fail:**\n- Verify consumer creation: `curl http:\u002F\u002Flocalhost:8001\u002Fconsumers`\n- Check plugin enabled: `curl http:\u002F\u002Flocalhost:8001\u002Fplugins | jq .`\n- Test with verbose: `curl -v` to see response headers\n- Validate JWT: use jwt.io to decode token\n\n### Step 4: Configure Request\u002FResponse Transformation\n\nAdd middleware to transform requests and responses.\n\n**For Kong:**\n```yaml\n# kong-transformations.yaml (excerpt)\nplugins:\n- name: request-transformer\n  service: user-api\n  config:\n    add:\n      headers: [X-Gateway-Version:1.0, X-Request-ID:$(uuid)]\n    remove:\n      headers: [X-Internal-Token]\n- name: correlation-id\n  # ... (see EXAMPLES.md for full configuration)\n```\n\n```bash\ndeck sync --kong-addr http:\u002F\u002Flocalhost:8001 -s kong-transformations.yaml\n```\n\n**For Traefik:**\n```yaml\n# traefik-transformations.yaml (excerpt)\napiVersion: traefik.io\u002Fv1alpha1\nkind: Middleware\nmetadata:\n  name: add-headers\nspec:\n  headers:\n    customRequestHeaders:\n      X-Gateway-Version: \"1.0\"\n    # ... (see EXAMPLES.md for circuit breaker, retry, chain)\n```\n\n```bash\nkubectl apply -f traefik-transformations.yaml\ncurl -v https:\u002F\u002FGATEWAY_IP\u002Fapi\u002Fusers | grep X-Gateway\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-4-configure-requestresponse-transformation) for complete transformation configurations\n\n**Got:** Request headers added\u002Fremoved as configured. Response headers include gateway metadata. Large requests rejected with 413. Circuit breaker trips on repeated failures. Retries occur for transient errors.\n\n**If fail:**\n- Verify middleware order in chain\n- Check for header conflicts with backend services\n- Test transformations individually before chaining\n- Review logs for transformation errors\n\n### Step 5: Enable Monitoring and Analytics\n\nConfigure metrics, logging, and dashboards for API visibility.\n\n**Kong monitoring setup:**\n```yaml\n# kong-monitoring.yaml (excerpt)\nplugins:\n- name: prometheus\n  config:\n    per_consumer: true\n- name: http-log\n  service: user-api\n  # ... (see EXAMPLES.md for Datadog, file-log configuration)\n```\n\n```bash\ndeck sync --kong-addr http:\u002F\u002Flocalhost:8001 -s kong-monitoring.yaml\n\n# Deploy ServiceMonitor (see EXAMPLES.md)\nkubectl apply -f kong-servicemonitor.yaml\ncurl http:\u002F\u002Flocalhost:8100\u002Fmetrics\n```\n\n**Traefik monitoring (built-in):**\n```yaml\n# ServiceMonitor (excerpt - see EXAMPLES.md for Grafana dashboard)\napiVersion: monitoring.coreos.com\u002Fv1\nkind: ServiceMonitor\nmetadata:\n  name: traefik-metrics\nspec:\n  endpoints:\n  - port: metrics\n    path: \u002Fmetrics\n    interval: 30s\n```\n\n```bash\nkubectl port-forward -n traefik svc\u002Ftraefik-dashboard 8080:8080\n# Open http:\u002F\u002Flocalhost:8080\u002Fdashboard\u002F\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-5-enable-monitoring-and-analytics) for complete monitoring configurations\n\n**Got:** Prometheus scraping gateway metrics successfully. Dashboards show request rates, latency percentiles, error rates. Logs forwarding to aggregation system. Metrics segmented by service, route, and consumer.\n\n**If fail:**\n- Verify ServiceMonitor: `kubectl get servicemonitor -A`\n- Check Prometheus targets in UI\n- Ensure metrics port accessible: `kubectl port-forward -n kong svc\u002Fkong-metrics 8100:8100`\n- Validate log endpoint reachability\n\n### Step 6: Implement API Versioning and Deprecation\n\nConfigure version management and graceful API deprecation.\n\n**Kong versioning strategy:**\n```yaml\n# kong-versioning.yaml (excerpt)\nservices:\n- name: user-api-v1\n  url: http:\u002F\u002Fuser-service-v1.default.svc.cluster.local:8080\n  routes:\n  - name: user-v1-route\n    paths: [\u002Fapi\u002Fv1\u002Fusers]\n  plugins:\n  - name: response-transformer\n    config:\n      add:\n        headers:\n        - X-Deprecation-Notice:\"API v1 deprecated on 2024-12-31\"\n        - Sunset:\"Wed, 31 Dec 2024 23:59:59 GMT\"\n# ... (see EXAMPLES.md for v2, default routing, rate limits)\n```\n\n**Traefik versioning:**\n```yaml\n# traefik-versioning.yaml (excerpt)\napiVersion: traefik.io\u002Fv1alpha1\nkind: Middleware\nmetadata:\n  name: v1-deprecation-headers\nspec:\n  headers:\n    customResponseHeaders:\n      X-Deprecation-Notice: \"API v1 deprecated on 2024-12-31\"\n# ... (see EXAMPLES.md for complete IngressRoutes)\n```\n\nTest versioning:\n```bash\ncurl -i https:\u002F\u002Fapi.example.com\u002Fapi\u002Fv1\u002Fusers  # Deprecated\ncurl -i https:\u002F\u002Fapi.example.com\u002Fapi\u002Fv2\u002Fusers  # Current\ncurl -i https:\u002F\u002Fapi.example.com\u002Fapi\u002Fusers     # Routes to v2\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-6-implement-api-versioning-and-deprecation) for complete versioning configurations\n\n**Got:** Different versions route to appropriate backend services. Deprecation headers present on v1 responses. Rate limits stricter for deprecated versions. Default path routes to latest version. Metrics segmented by API version.\n\n**If fail:**\n- Verify path precedence\u002Fpriority configuration (higher priority = evaluated first)\n- Check for overlapping path patterns\n- Test each version route independently\n- Review routing logs for path matching\n- Ensure backend services for each version are running\n\n## Validation\n\n- [ ] API gateway pods running with multiple replicas for HA\n- [ ] Load balancer service has external IP assigned\n- [ ] Routes correctly proxy traffic to backend services\n- [ ] Authentication\u002Fauthorization enforcing access control (401\u002F403 responses)\n- [ ] Rate limiting returns 429 after exceeding quotas\n- [ ] Request\u002Fresponse transformation adding\u002Fremoving headers correctly\n- [ ] Circuit breaker trips on repeated backend failures\n- [ ] Metrics exposed and scraped by Prometheus\n- [ ] Dashboards showing request rates, latency, errors\n- [ ] API versioning routing requests to correct backend versions\n- [ ] Deprecation headers present on older API versions\n- [ ] Health checks monitoring backend service availability\n\n## Pitfalls\n\n- **Database Dependency (Kong)**: Kong with database requires PostgreSQL\u002FCassandra. DB-less mode available but limits some features (runtime config changes). Use DB mode for production with multiple gateway instances.\n\n- **Path Matching Order**: Routes\u002FIngressRoutes evaluated in specific order. More specific paths should have higher priority. Overlapping paths cause unpredictable routing. Test with `curl -v` to verify actual route hit.\n\n- **Authentication Bypass**: Ensure authentication plugins applied to all routes. Easy to add route without auth. Use default plugins at service level, then override per-route as needed.\n\n- **Rate Limit Scope**: Rate limiting `policy: local` counts per gateway pod. For consistent limits across replicas, use centralized policy (Redis) or sticky sessions.\n\n- **CORS Configuration**: API gateway should handle CORS, not individual services. Add CORS plugin\u002Fmiddleware early to avoid browser preflight failures.\n\n- **SSL\u002FTLS Termination**: Gateway typically terminates SSL. Ensure certificates valid and auto-renewal configured. Use cert-manager for Kubernetes certificate management.\n\n- **Upstream Health Checks**: Configure active health checks to detect backend failures quickly. Passive checks rely on real traffic and may be slower to detect issues.\n\n- **Plugin\u002FMiddleware Execution Order**: Order matters. Authentication before rate limiting (avoid wasted rate limit slots for invalid requests). Transformation before logging (log transformed values).\n\n- **Resource Limits**: Gateway pods can consume significant CPU under load. Set appropriate resource requests\u002Flimits. Monitor CPU throttling in production.\n\n- **Migration Strategy**: Don't enable all plugins at once. Roll out incrementally: routing → authentication → rate limiting → transformations → advanced features.\n\n## Related Skills\n\n- `configure-ingress-networking` - Ingress controller setup complements API gateway\n- `setup-service-mesh` - Service mesh provides complementary east-west traffic management\n- `manage-kubernetes-secrets` - Certificate and credential management for gateway\n- `setup-prometheus-monitoring` - Monitoring integration for gateway metrics\n- `enforce-policy-as-code` - Policy enforcement that complements gateway authorization\n","# Configure API Gateway\n\nDeploy and configure an API gateway for centralized API traffic management and policy enforcement.\n\n## When to Use\n\n- Multiple backend services need unified API endpoint with consistent policies\n- Require centralized authentication\u002Fauthorization for API access\n- Need rate limiting and quota management across APIs\n- Want to transform requests\u002Fresponses without modifying backend services\n- Implementing API versioning and deprecation strategies\n- Need detailed API analytics and monitoring\n- Require service discovery and load balancing for microservices\n\n## Inputs\n\n- **Required**: Kubernetes cluster or Docker environment\n- **Required**: Choice of API gateway (Kong or Traefik)\n- **Required**: Backend service endpoints to proxy\n- **Optional**: Authentication provider (OAuth2, OIDC, API keys)\n- **Optional**: Rate limiting requirements (requests per minute\u002Fhour)\n- **Optional**: Custom middleware or plugin configurations\n- **Optional**: TLS certificates for HTTPS endpoints\n\n## Procedure\n\n> See [Extended Examples](references\u002FEXAMPLES.md) for complete configuration files and templates.\n\n### Step 1: Install API Gateway\n\nDeploy the API gateway with database (Kong) or file-based config (Traefik).\n\n**For Kong with PostgreSQL:**\n```yaml\n# kong-deployment.yaml (excerpt - see EXAMPLES.md for complete file)\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: kong\n---\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: kong\n  namespace: kong\nspec:\n  replicas: 2\n  # ... (PostgreSQL, migrations, services - see EXAMPLES.md)\n```\n\n**For Traefik:**\n```yaml\n# traefik-deployment.yaml (excerpt - see EXAMPLES.md for complete file)\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: traefik\n---\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: traefik\n  namespace: traefik\nspec:\n  replicas: 2\n  # ... (RBAC, ConfigMap, services - see EXAMPLES.md)\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-1-install-api-gateway) for the complete deployment manifests\n\nDeploy:\n```bash\nkubectl apply -f kong-deployment.yaml  # OR traefik-deployment.yaml\nkubectl wait --for=condition=ready pod -l app=kong -n kong --timeout=300s\nkubectl get svc -n kong kong-proxy  # Get load balancer IP\n```\n\n**Got:** Gateway pods running with 2 replicas. Load balancer service has external IP assigned. Admin API accessible (Kong: port 8001, Traefik: dashboard port 8080). Health checks passing.\n\n**If fail:**\n- Check pod logs: `kubectl logs -n kong -l app=kong`\n- Verify database connection (Kong): `kubectl logs -n kong kong-migrations-\u003Chash>`\n- Check service account permissions (Traefik): `kubectl get clusterrolebinding traefik -o yaml`\n- Ensure ports not already bound: `kubectl get svc --all-namespaces | grep 8000`\n\n### Step 2: Configure Backend Services and Routes\n\nDefine upstream services and create routes to expose APIs.\n\n**For Kong (using decK for declarative config):**\n```bash\n# Install decK CLI\ncurl -sL https:\u002F\u002Fgithub.com\u002FKong\u002Fdeck\u002Freleases\u002Fdownload\u002Fv1.28.0\u002Fdeck_1.28.0_linux_amd64.tar.gz | tar -xz\nsudo mv deck \u002Fusr\u002Flocal\u002Fbin\u002F\n\n# Create kong.yaml with services, routes, upstreams\n# (see EXAMPLES.md for complete configuration)\ndeck sync --kong-addr http:\u002F\u002Flocalhost:8001 -s kong.yaml\ncurl -i http:\u002F\u002Flocalhost:8001\u002Froutes  # Verify routes\n```\n\n**For Traefik (using IngressRoute CRD):**\n```yaml\n# traefik-routes.yaml (excerpt)\napiVersion: traefik.io\u002Fv1alpha1\nkind: IngressRoute\nmetadata:\n  name: user-api-route\nspec:\n  entryPoints: [websecure]\n  routes:\n  - match: Host(`api.example.com`) && PathPrefix(`\u002Fapi\u002Fusers`)\n    # ... (see EXAMPLES.md for full configuration)\n```\n\nApply routes:\n```bash\nkubectl apply -f traefik-routes.yaml\ncurl -H \"Host: api.example.com\" https:\u002F\u002FGATEWAY_IP\u002Fapi\u002Fusers\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-2-configure-backend-services-and-routes) for complete routing configurations\n\n**Got:** Routes correctly proxy traffic to backend services. Weighted routing distributes traffic according to configuration. Health checks monitor backend service health.\n\n**If fail:**\n- Verify backend services running: `kubectl get svc -n default`\n- Check DNS resolution: `kubectl run test --rm -it --image=busybox -- nslookup user-service.default.svc.cluster.local`\n- Review gateway logs: `kubectl logs -n kong -l app=kong --tail=50`\n- Validate configuration: `deck validate -s kong.yaml`\n\n### Step 3: Implement Authentication and Authorization\n\nConfigure authentication plugins\u002Fmiddleware for API security.\n\n**For Kong (API Key and JWT authentication):**\n```yaml\n# kong-auth-config.yaml (excerpt)\nconsumers:\n- username: mobile-app\n  custom_id: app-001\n\nkeyauth_credentials:\n- consumer: mobile-app\n  key: mobile-secret-key-123\n\nplugins:\n- name: key-auth\n  service: user-api\n  # ... (see EXAMPLES.md for full configuration)\n```\n\n```bash\ndeck sync --kong-addr http:\u002F\u002Flocalhost:8001 -s kong-auth-config.yaml\ncurl -i -H \"apikey: mobile-secret-key-123\" http:\u002F\u002FGATEWAY_IP\u002Fapi\u002Fusers\n```\n\n**For Traefik (BasicAuth and ForwardAuth middleware):**\n```yaml\n# traefik-auth-middleware.yaml (excerpt)\napiVersion: traefik.io\u002Fv1alpha1\nkind: Middleware\nmetadata:\n  name: basic-auth-middleware\nspec:\n  basicAuth:\n    secret: basic-auth\n    removeHeader: true\n# ... (see EXAMPLES.md for OAuth2, rate limiting)\n```\n\n```bash\nkubectl apply -f traefik-auth-middleware.yaml\ncurl -u user1:password https:\u002F\u002FGATEWAY_IP\u002Fapi\u002Fprotected\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-3-implement-authentication-and-authorization) for complete authentication configurations\n\n**Got:** Unauthenticated requests return 401. Valid credentials allow access. Rate limiting returns 429 after threshold. JWT tokens validate correctly. ACL enforces group permissions.\n\n**If fail:**\n- Verify consumer creation: `curl http:\u002F\u002Flocalhost:8001\u002Fconsumers`\n- Check plugin enabled: `curl http:\u002F\u002Flocalhost:8001\u002Fplugins | jq .`\n- Test with verbose: `curl -v` to see response headers\n- Validate JWT: use jwt.io to decode token\n\n### Step 4: Configure Request\u002FResponse Transformation\n\nAdd middleware to transform requests and responses.\n\n**For Kong:**\n```yaml\n# kong-transformations.yaml (excerpt)\nplugins:\n- name: request-transformer\n  service: user-api\n  config:\n    add:\n      headers: [X-Gateway-Version:1.0, X-Request-ID:$(uuid)]\n    remove:\n      headers: [X-Internal-Token]\n- name: correlation-id\n  # ... (see EXAMPLES.md for full configuration)\n```\n\n```bash\ndeck sync --kong-addr http:\u002F\u002Flocalhost:8001 -s kong-transformations.yaml\n```\n\n**For Traefik:**\n```yaml\n# traefik-transformations.yaml (excerpt)\napiVersion: traefik.io\u002Fv1alpha1\nkind: Middleware\nmetadata:\n  name: add-headers\nspec:\n  headers:\n    customRequestHeaders:\n      X-Gateway-Version: \"1.0\"\n    # ... (see EXAMPLES.md for circuit breaker, retry, chain)\n```\n\n```bash\nkubectl apply -f traefik-transformations.yaml\ncurl -v https:\u002F\u002FGATEWAY_IP\u002Fapi\u002Fusers | grep X-Gateway\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-4-configure-requestresponse-transformation) for complete transformation configurations\n\n**Got:** Request headers added\u002Fremoved as configured. Response headers include gateway metadata. Large requests rejected with 413. Circuit breaker trips on repeated failures. Retries occur for transient errors.\n\n**If fail:**\n- Verify middleware order in chain\n- Check for header conflicts with backend services\n- Test transformations individually before chaining\n- Review logs for transformation errors\n\n### Step 5: Enable Monitoring and Analytics\n\nConfigure metrics, logging, and dashboards for API visibility.\n\n**Kong monitoring setup:**\n```yaml\n# kong-monitoring.yaml (excerpt)\nplugins:\n- name: prometheus\n  config:\n    per_consumer: true\n- name: http-log\n  service: user-api\n  # ... (see EXAMPLES.md for Datadog, file-log configuration)\n```\n\n```bash\ndeck sync --kong-addr http:\u002F\u002Flocalhost:8001 -s kong-monitoring.yaml\n\n# Deploy ServiceMonitor (see EXAMPLES.md)\nkubectl apply -f kong-servicemonitor.yaml\ncurl http:\u002F\u002Flocalhost:8100\u002Fmetrics\n```\n\n**Traefik monitoring (built-in):**\n```yaml\n# ServiceMonitor (excerpt - see EXAMPLES.md for Grafana dashboard)\napiVersion: monitoring.coreos.com\u002Fv1\nkind: ServiceMonitor\nmetadata:\n  name: traefik-metrics\nspec:\n  endpoints:\n  - port: metrics\n    path: \u002Fmetrics\n    interval: 30s\n```\n\n```bash\nkubectl port-forward -n traefik svc\u002Ftraefik-dashboard 8080:8080\n# Open http:\u002F\u002Flocalhost:8080\u002Fdashboard\u002F\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-5-enable-monitoring-and-analytics) for complete monitoring configurations\n\n**Got:** Prometheus scraping gateway metrics successfully. Dashboards show request rates, latency percentiles, error rates. Logs forwarding to aggregation system. Metrics segmented by service, route, and consumer.\n\n**If fail:**\n- Verify ServiceMonitor: `kubectl get servicemonitor -A`\n- Check Prometheus targets in UI\n- Ensure metrics port accessible: `kubectl port-forward -n kong svc\u002Fkong-metrics 8100:8100`\n- Validate log endpoint reachability\n\n### Step 6: Implement API Versioning and Deprecation\n\nConfigure version management and graceful API deprecation.\n\n**Kong versioning strategy:**\n```yaml\n# kong-versioning.yaml (excerpt)\nservices:\n- name: user-api-v1\n  url: http:\u002F\u002Fuser-service-v1.default.svc.cluster.local:8080\n  routes:\n  - name: user-v1-route\n    paths: [\u002Fapi\u002Fv1\u002Fusers]\n  plugins:\n  - name: response-transformer\n    config:\n      add:\n        headers:\n        - X-Deprecation-Notice:\"API v1 deprecated on 2024-12-31\"\n        - Sunset:\"Wed, 31 Dec 2024 23:59:59 GMT\"\n# ... (see EXAMPLES.md for v2, default routing, rate limits)\n```\n\n**Traefik versioning:**\n```yaml\n# traefik-versioning.yaml (excerpt)\napiVersion: traefik.io\u002Fv1alpha1\nkind: Middleware\nmetadata:\n  name: v1-deprecation-headers\nspec:\n  headers:\n    customResponseHeaders:\n      X-Deprecation-Notice: \"API v1 deprecated on 2024-12-31\"\n# ... (see EXAMPLES.md for complete IngressRoutes)\n```\n\nTest versioning:\n```bash\ncurl -i https:\u002F\u002Fapi.example.com\u002Fapi\u002Fv1\u002Fusers  # Deprecated\ncurl -i https:\u002F\u002Fapi.example.com\u002Fapi\u002Fv2\u002Fusers  # Current\ncurl -i https:\u002F\u002Fapi.example.com\u002Fapi\u002Fusers     # Routes to v2\n```\n\nSee [EXAMPLES.md](references\u002FEXAMPLES.md#step-6-implement-api-versioning-and-deprecation) for complete versioning configurations\n\n**Got:** Different versions route to appropriate backend services. Deprecation headers present on v1 responses. Rate limits stricter for deprecated versions. Default path routes to latest version. Metrics segmented by API version.\n\n**If fail:**\n- Verify path precedence\u002Fpriority configuration (higher priority = evaluated first)\n- Check for overlapping path patterns\n- Test each version route independently\n- Review routing logs for path matching\n- Ensure backend services for each version are running\n\n## Validation\n\n- [ ] API gateway pods running with multiple replicas for HA\n- [ ] Load balancer service has external IP assigned\n- [ ] Routes correctly proxy traffic to backend services\n- [ ] Authentication\u002Fauthorization enforcing access control (401\u002F403 responses)\n- [ ] Rate limiting returns 429 after exceeding quotas\n- [ ] Request\u002Fresponse transformation adding\u002Fremoving headers correctly\n- [ ] Circuit breaker trips on repeated backend failures\n- [ ] Metrics exposed and scraped by Prometheus\n- [ ] Dashboards showing request rates, latency, errors\n- [ ] API versioning routing requests to correct backend versions\n- [ ] Deprecation headers present on older API versions\n- [ ] Health checks monitoring backend service availability\n\n## Pitfalls\n\n- **Database Dependency (Kong)**: Kong with database requires PostgreSQL\u002FCassandra. DB-less mode available but limits some features (runtime config changes). Use DB mode for production with multiple gateway instances.\n\n- **Path Matching Order**: Routes\u002FIngressRoutes evaluated in specific order. More specific paths should have higher priority. Overlapping paths cause unpredictable routing. Test with `curl -v` to verify actual route hit.\n\n- **Authentication Bypass**: Ensure authentication plugins applied to all routes. Easy to add route without auth. Use default plugins at service level, then override per-route as needed.\n\n- **Rate Limit Scope**: Rate limiting `policy: local` counts per gateway pod. For consistent limits across replicas, use centralized policy (Redis) or sticky sessions.\n\n- **CORS Configuration**: API gateway should handle CORS, not individual services. Add CORS plugin\u002Fmiddleware early to avoid browser preflight failures.\n\n- **SSL\u002FTLS Termination**: Gateway typically terminates SSL. Ensure certificates valid and auto-renewal configured. Use cert-manager for Kubernetes certificate management.\n\n- **Upstream Health Checks**: Configure active health checks to detect backend failures quickly. Passive checks rely on real traffic and may be slower to detect issues.\n\n- **Plugin\u002FMiddleware Execution Order**: Order matters. Authentication before rate limiting (avoid wasted rate limit slots for invalid requests). Transformation before logging (log transformed values).\n\n- **Resource Limits**: Gateway pods can consume significant CPU under load. Set appropriate resource requests\u002Flimits. Monitor CPU throttling in production.\n\n- **Migration Strategy**: Don't enable all plugins at once. Roll out incrementally: routing → authentication → rate limiting → transformations → advanced features.\n\n## Related Skills\n\n- `configure-ingress-networking` - Ingress controller setup complements API gateway\n- `setup-service-mesh` - Service mesh provides complementary east-west traffic management\n- `manage-kubernetes-secrets` - Certificate and credential management for gateway\n- `setup-prometheus-monitoring` - Monitoring integration for gateway metrics\n- `enforce-policy-as-code` - Policy enforcement that complements gateway authorization\n",{"name":5,"locale":23,"license":14,"metadata":24,"translator":31,"description":32,"allowed-tools":33,"source_commit":34,"source_locale":35,"translation_date":36},"caveman-lite",{"tags":25,"author":26,"domain":27,"version":28,"language":29,"complexity":30},"api-gateway, kong, traefik, rate-limiting, authentication, routing, middleware","Philipp Thoss","devops","1.0","multi","intermediate","Julius Brussee homage — caveman","Deploy and configure an API gateway (Kong or Traefik) to handle API traffic management, authentication, rate limiting, request\u002Fresponse transformation, and routing. Covers plugin configuration, upstream services, consumer management, and integration with existing infrastructure. Use when multiple backend services need a unified API endpoint, when centralized authentication or rate limiting is required, when implementing API versioning, or when needing detailed analytics and load balancing for microservices.\n","Read Write Edit Bash Grep Glob","82c77053","en","2026-04-19","master","f483e54f3ad5f202a77d45f2e57f8d970b71195f","skills_library\u002Fconfigure-api-gateway",2,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills","https:\u002F\u002Fgithub.com\u002Froohe","yoou.link","2026-05-19 15:56:07",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add roohe\u002Fagentic-super-skills --skill configure-api-gateway",{"tool":51,"command":52},"bunx","bunx skills add roohe\u002Fagentic-super-skills --skill configure-api-gateway",{"tool":54,"command":55},"pnpm","pnpm dlx skills add roohe\u002Fagentic-super-skills --skill configure-api-gateway","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fconfigure-api-gateway\u002FSKILL.md",true,[59],{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002FEXAMPLES.md","REFERENCE","参考文档",21240,"https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fconfigure-api-gateway\u002Freferences\u002FEXAMPLES.md",[66,73,80,87,94,101],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M73D865CZME2FCMKA4PQM348","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fzarr-python\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M73D7Z64J4ABWZJD7P44XBBF","youtube-downloader","Download and process YouTube content for research. Use when: downloading competitor videos for analysis; extracting audio for podcasts; getting transcripts for content repurposing; archiving webinars; research content curation","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyoutube-downloader\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M73D7K8778TGZV3GJFR3703D","yc-pitch-deck","Create a compelling startup pitch deck that follows the structure proven to raise billions from top investors. Master the YC and Sequoia formats that get founders funded. Use when: **Fundraising** to create investor pitch decks; **YC application** to structure your narrative; **Demo Day prep** to craft your 2-minute pitch; **Angel investors** to communicate your opportunity; **Partnership pitches** to structure compelling asks","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fyc-pitch-deck\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M73D70KJSE0E8Z28YMNNRT04","x-twitter-scraper","Use when the user needs X (Twitter) data or confirmation-gated X actions through Xquik: tweet search, user lookup, follower extraction, media download, monitoring, webhooks, MCP, SDKs, posting, likes, DMs, and profile updates. Requires a Xquik API key. Never ask for X login material.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fx-twitter-scraper\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M73D6ED01GV077R7K4NZNFZJ","write-vignette","Create R package vignettes using R Markdown or Quarto. Covers vignette setup, YAML configuration, code chunk options, building and testing, and CRAN requirements for vignettes. Use when adding a Getting Started tutorial, documenting complex workflows spanning multiple functions, creating domain-specific guides, or when CRAN submission requires user-facing documentation beyond function help pages.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-vignette\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":18},"01M73D69YJR0BK3NFHE0CYG3EF","write-validation-documentation","Write IQ\u002FOQ\u002FPQ validation documentation for computerized systems in regulated environments. Covers protocols, reports, test scripts, deviation handling, and approval workflows. Use when validating R or other software for regulated use, preparing for a regulatory audit, documenting qualification of computing environments, or creating and updating validation protocols and reports for new or re-qualified systems.","https:\u002F\u002Fgithub.com\u002Froohe\u002Fagentic-super-skills\u002Fblob\u002Fmaster\u002Fskills_library\u002Fwrite-validation-documentation\u002FSKILL.md",[],[]]