feat: Add deployment infrastructure and documentation

Docker:
- Add production-ready Dockerfiles for all microservices
- Optimize for multi-stage builds and minimal image sizes

Kubernetes:
- Add namespace and service manifests
- Include MongoDB and Redis deployment configurations
- Configure API server and charging engine deployments

Documentation:
- Add comprehensive README with platform overview
- Include technology stack and quick start instructions
- Provide prerequisites and setup guidance
This commit is contained in:
nutcas3
2026-04-03 19:56:33 +03:00
parent b69b7ec087
commit 4dda7e25d8
10 changed files with 595 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
name: taas-platform
labels:
name: taas-platform
environment: production
+93
View File
@@ -0,0 +1,93 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: mongodb-config
namespace: taas-platform
data:
MONGO_INITDB_DATABASE: "free5gc"
---
apiVersion: v1
kind: Secret
metadata:
name: mongodb-secret
namespace: taas-platform
type: Opaque
stringData:
MONGO_INITDB_ROOT_USERNAME: "admin"
MONGO_INITDB_ROOT_PASSWORD: "changeme-in-production"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongodb-pvc
namespace: taas-platform
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongodb
namespace: taas-platform
spec:
replicas: 1
selector:
matchLabels:
app: mongodb
template:
metadata:
labels:
app: mongodb
spec:
containers:
- name: mongodb
image: mongo:7.0
ports:
- containerPort: 27017
env:
- name: MONGO_INITDB_ROOT_USERNAME
valueFrom:
secretKeyRef:
name: mongodb-secret
key: MONGO_INITDB_ROOT_USERNAME
- name: MONGO_INITDB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mongodb-secret
key: MONGO_INITDB_ROOT_PASSWORD
- name: MONGO_INITDB_DATABASE
valueFrom:
configMapKeyRef:
name: mongodb-config
key: MONGO_INITDB_DATABASE
volumeMounts:
- name: mongodb-storage
mountPath: /data/db
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "2Gi"
cpu: "1000m"
volumes:
- name: mongodb-storage
persistentVolumeClaim:
claimName: mongodb-pvc
---
apiVersion: v1
kind: Service
metadata:
name: mongodb
namespace: taas-platform
spec:
selector:
app: mongodb
ports:
- port: 27017
targetPort: 27017
type: ClusterIP
+46
View File
@@ -0,0 +1,46 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: taas-platform
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:7-alpine
ports:
- containerPort: 6379
command:
- redis-server
- --maxmemory
- "2gb"
- --maxmemory-policy
- allkeys-lru
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "2Gi"
cpu: "500m"
---
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: taas-platform
spec:
selector:
app: redis
ports:
- port: 6379
targetPort: 6379
type: ClusterIP
+77
View File
@@ -0,0 +1,77 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: api-server-config
namespace: taas-platform
data:
API_PORT: "8000"
GIN_MODE: "release"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-server
namespace: taas-platform
spec:
replicas: 3
selector:
matchLabels:
app: api-server
template:
metadata:
labels:
app: api-server
spec:
containers:
- name: api-server
image: taas-api-server:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
env:
- name: MONGODB_URI
value: "mongodb://admin:changeme-in-production@mongodb:27017/free5gc"
- name: REDIS_URI
value: "redis://redis:6379"
- name: API_PORT
valueFrom:
configMapKeyRef:
name: api-server-config
key: API_PORT
- name: GIN_MODE
valueFrom:
configMapKeyRef:
name: api-server-config
key: GIN_MODE
resources:
requests:
memory: "128Mi"
cpu: "100m"
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
namespace: taas-platform
spec:
selector:
app: api-server
ports:
- port: 8000
targetPort: 8000
type: LoadBalancer
@@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: charging-engine
namespace: taas-platform
spec:
replicas: 2
selector:
matchLabels:
app: charging-engine
template:
metadata:
labels:
app: charging-engine
spec:
containers:
- name: charging-engine
image: taas-charging-engine:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
env:
- name: REDIS_URI
value: "redis://redis:6379"
- name: SERVER_PORT
value: "8080"
- name: RUST_LOG
value: "info"
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "1000m"
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: charging-engine
namespace: taas-platform
spec:
selector:
app: charging-engine
ports:
- port: 8080
targetPort: 8080
type: ClusterIP