Service Definitions
This reference documents the Kubernetes Service resources that expose applications within the cluster.Frontend Service
The frontend service exposes the React/Nginx application on port 80.Configuration
platform/kubernetes/frontend/service.yaml:1-28
Service Type
- Type: ClusterIP
- Access: Internal cluster only
- External Access: Via Ingress/ALB
Port Mapping
| Service Port | Target Port | Protocol | Description |
|---|---|---|---|
| 80 | 80 | TCP | HTTP traffic to Nginx |
Backend Service
The backend service exposes the Node.js API application.Configuration
platform/kubernetes/backend/service.yaml:1-29
Service Type
- Type: ClusterIP
- Access: Internal cluster only
- External Access: Via Ingress/ALB
Port Mapping
| Service Port | Target Port | Protocol | Description |
|---|---|---|---|
| 80 | 3000 | TCP | HTTP traffic to Node.js |
Database Services
PostgreSQL uses two services: a headless service for StatefulSet management and a standard ClusterIP service for application connections.Headless Service
Required for StatefulSet DNS resolution:platform/kubernetes/database/service.yaml:20-44
ClusterIP Service
For backend application connections:platform/kubernetes/database/service.yaml:49-70
DNS Resolution
The headless service creates individual DNS records for each pod:Port Mapping
| Service Port | Target Port | Protocol | Description |
|---|---|---|---|
| 5432 | 5432 | TCP | PostgreSQL connections |
Service Discovery
All services can be accessed using Kubernetes DNS:Within Same Namespace
Fully Qualified Domain Names
Load Balancing
All services use round-robin load balancing (sessionAffinity: None) to distribute traffic evenly across available pods.
Service Endpoints
Services automatically track healthy pod endpoints using:- Pod selector labels (e.g.,
app: backend) - Readiness probe status
- Pod lifecycle state
Connection Flow
Service Types
| Type | Use Case | Accessibility |
|---|---|---|
| ClusterIP | Internal services | Cluster only |
| Headless | StatefulSet pods | DNS per pod |
| LoadBalancer | External access | Public (via Ingress) |