Service Discovery
The ServiceController manages data plane service deployments within tenant namespaces. It handles service deployment, scaling (both horizontal and vertical), health checking, and service endpoint discovery across the platform.
Service Deployment
Deploy a Service
Endpoint: POST /api/v1/infrastructure/services/tenants/:tenantId/deploy
curl -X POST http://localhost:8089/api/v1/infrastructure/services/tenants/550e8400/deploy \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${TOKEN}" \
-d '{
"serviceName": "ai-service",
"version": "1.2.0",
"replicas": 2,
"resources": {
"cpuRequest": "500m",
"cpuLimit": "2000m",
"memoryRequest": "1Gi",
"memoryLimit": "4Gi"
}
}'List Tenant Services
Endpoint: GET /api/v1/infrastructure/services/tenants/:tenantId
Returns all deployed services for a tenant with their status, version, and endpoint information.
Get Service Status
Endpoint: GET /api/v1/infrastructure/services/tenants/:tenantId/:serviceName
Scaling
Scale a Service
Endpoint: POST /api/v1/infrastructure/services/tenants/:tenantId/:serviceName/scale
curl -X POST http://localhost:8089/api/v1/infrastructure/services/tenants/550e8400/ai-service/scale \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${TOKEN}" \
-d '{
"replicas": 4
}'Horizontal Pod Autoscaler (HPA)
The HorizontalPodAutoscalerManager manages Kubernetes HPA resources for automatic horizontal scaling based on CPU, memory, or custom metrics.
Vertical Pod Autoscaler (VPA)
The VerticalPodAutoscalerManager manages Kubernetes VPA resources for automatic resource right-sizing.
TenantService Entity
| Field | Type | Description |
|---|---|---|
id | UUID | Service record ID |
tenantId | UUID | Owning tenant |
serviceName | String | Service identifier |
version | String | Deployed version |
replicas | int | Desired replica count |
status | String | DEPLOYING, RUNNING, DEGRADED, STOPPED |
endpoint | String | Internal service endpoint |
healthStatus | String | Last health check result |
configuration | JSON | Service-specific configuration |
Health Checking
The HealthCheckService periodically probes deployed services:
| Check Type | Description |
|---|---|
| HTTP health | GET request to /health endpoint |
| TCP connectivity | TCP connection to service port |
| Readiness | Kubernetes readiness probe status |
| Liveness | Kubernetes liveness probe status |
Health results feed into the topology view and trigger alerts when services become unhealthy.
Service Endpoints
Services are discoverable within the Kubernetes cluster via standard DNS:
<service-name>.<tenant-namespace>.svc.cluster.local:<port>For example: ai-service.tenant-acme.svc.cluster.local:8000