Files
telecom-platform/deployments/kubernetes/manifests/applications.yaml
T
nutcas3 a0c862a1a4 feat: Add Kubernetes manifests for telecom platform applications and configuration
- Add api-server Deployment with 3 replicas, 8000 HTTP and 9090 metrics ports, database/Redis/InfluxDB environment configuration, 256Mi-512Mi memory, 250m-500m CPU, health probes
- Add charging-engine Deployment with 2 replicas, 3001 port, Redis integration, 128Mi-256Mi memory, 100m-200m CPU
- Add packet-gateway Deployment with 2 replicas, 9000 metrics port, privileged security context with NET_ADMIN/SYS_ADMIN capabilities
2026-04-17 17:26:00 +03:00

356 lines
7.9 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-server
namespace: telecom-platform
labels:
app: api-server
component: backend
spec:
replicas: 3
selector:
matchLabels:
app: api-server
template:
metadata:
labels:
app: api-server
component: backend
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9090"
prometheus.io/path: "/metrics"
spec:
containers:
- name: api-server
image: telecom/api-server:latest
ports:
- containerPort: 8000
name: http
- containerPort: 9090
name: metrics
env:
- name: DATABASE_HOST
valueFrom:
configMapKeyRef:
name: telecom-config
key: DATABASE_HOST
- name: DATABASE_PORT
valueFrom:
configMapKeyRef:
name: telecom-config
key: DATABASE_PORT
- name: DATABASE_NAME
valueFrom:
configMapKeyRef:
name: telecom-config
key: DATABASE_NAME
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: telecom-secrets
key: DATABASE_PASSWORD
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: telecom-config
key: REDIS_HOST
- name: REDIS_PORT
valueFrom:
configMapKeyRef:
name: telecom-config
key: REDIS_PORT
- name: CHARGING_ENGINE_URL
valueFrom:
configMapKeyRef:
name: telecom-config
key: CHARGING_ENGINE_URL
- name: ES2_URL
valueFrom:
configMapKeyRef:
name: telecom-config
key: ES2_URL
- name: INFLUXDB_URL
valueFrom:
configMapKeyRef:
name: telecom-config
key: INFLUXDB_URL
- name: INFLUXDB_TOKEN
valueFrom:
secretKeyRef:
name: telecom-secrets
key: INFLUXDB_TOKEN
- name: INFLUXDB_ORG
valueFrom:
configMapKeyRef:
name: telecom-config
key: INFLUXDB_ORG
- name: INFLUXDB_BUCKET
valueFrom:
configMapKeyRef:
name: telecom-config
key: INFLUXDB_BUCKET
- name: METRICS_PORT
valueFrom:
configMapKeyRef:
name: telecom-config
key: METRICS_PORT
- name: LOG_LEVEL
valueFrom:
configMapKeyRef:
name: telecom-config
key: LOG_LEVEL
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 5
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: api-server-service
namespace: telecom-platform
labels:
app: api-server
spec:
selector:
app: api-server
ports:
- name: http
port: 8000
targetPort: 8000
- name: metrics
port: 9090
targetPort: 9090
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: charging-engine
namespace: telecom-platform
labels:
app: charging-engine
component: backend
spec:
replicas: 2
selector:
matchLabels:
app: charging-engine
template:
metadata:
labels:
app: charging-engine
component: backend
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "3001"
prometheus.io/path: "/metrics"
spec:
containers:
- name: charging-engine
image: telecom/charging-engine:latest
ports:
- containerPort: 3001
name: http
env:
- name: REDIS_URL
value: "redis://redis-service:6379"
- name: LOG_LEVEL
value: "info"
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
livenessProbe:
httpGet:
path: /health
port: 3001
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /health
port: 3001
initialDelaySeconds: 5
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: charging-engine-service
namespace: telecom-platform
labels:
app: charging-engine
spec:
selector:
app: charging-engine
ports:
- name: http
port: 3001
targetPort: 3001
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: packet-gateway
namespace: telecom-platform
labels:
app: packet-gateway
component: network
spec:
replicas: 2
selector:
matchLabels:
app: packet-gateway
template:
metadata:
labels:
app: packet-gateway
component: network
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9000"
prometheus.io/path: "/metrics"
spec:
containers:
- name: packet-gateway
image: telecom/packet-gateway:latest
ports:
- containerPort: 9000
name: metrics
env:
- name: REDIS_URL
value: "redis://redis-service:6379"
- name: INTERFACE
value: "eth0"
- name: LOG_LEVEL
value: "info"
securityContext:
privileged: true
capabilities:
add:
- NET_ADMIN
- SYS_ADMIN
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /health
port: 9000
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /health
port: 9000
initialDelaySeconds: 5
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: packet-gateway-service
namespace: telecom-platform
labels:
app: packet-gateway
spec:
selector:
app: packet-gateway
ports:
- name: metrics
port: 9000
targetPort: 9000
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-dashboard
namespace: telecom-platform
labels:
app: web-dashboard
component: frontend
spec:
replicas: 2
selector:
matchLabels:
app: web-dashboard
template:
metadata:
labels:
app: web-dashboard
component: frontend
spec:
containers:
- name: web-dashboard
image: telecom/web-dashboard:latest
ports:
- containerPort: 3000
name: http
env:
- name: NEXT_PUBLIC_API_URL
value: "http://api-server-service:8000"
- name: NEXT_PUBLIC_WS_URL
value: "ws://api-server-service:8000"
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 5
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: web-dashboard-service
namespace: telecom-platform
labels:
app: web-dashboard
spec:
selector:
app: web-dashboard
ports:
- name: http
port: 3000
targetPort: 3000
type: ClusterIP