Enable Kubernetes Service Discovery for API7 Gateway upstreams
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 9s
Build and Deploy / build-api (push) Successful in 43s
Build and Deploy / build-web (push) Successful in 1m1s

Configured API7 Gateway to use Kubernetes Service Discovery instead of
static upstream nodes. This enables dynamic discovery of backend Pods
through the Kubernetes API.

Benefits:
- Automatic scaling: New Pods are automatically added to upstream pool
- Health checks: Only healthy Pods receive traffic
- Zero downtime: Automatic updates during deployments and rollouts
- No manual upstream configuration needed

Changes:
- Updated configmap-adc.yaml to use discovery_type: kubernetes
- Service discovery queries Kubernetes API for Pod endpoints
- Falls back to static nodes if serviceDiscovery.enabled is false
- Added documentation in values.yaml explaining the feature

The RBAC permissions (services, endpoints watch) were already configured
in rbac-adc.yaml, so no additional permissions are needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
d.viti
2025-10-09 15:24:29 +02:00
parent f04862f6f7
commit e995482bfd
2 changed files with 29 additions and 0 deletions

View File

@@ -258,6 +258,11 @@ api7:
key: ""
# Service Discovery
# When enabled, API7 Gateway dynamically discovers backend Pods through Kubernetes API
# instead of using static upstream nodes. This provides:
# - Automatic scaling: New Pods are automatically added to the upstream pool
# - Health checks: Only healthy Pods receive traffic
# - Zero downtime: Automatic updates during deployments and rollouts
serviceDiscovery:
enabled: true # Use Kubernetes service discovery
namespace: "" # Leave empty to use release namespace