# Example Kubernetes Deployment and Service for SMOA backend. # Apply: kubectl apply -f docs/infrastructure/k8s/ # Requires: backend image built (e.g. docker build -f backend/Dockerfile .) and pushed to your registry. apiVersion: apps/v1 kind: Deployment metadata: name: smoa-backend labels: app: smoa-backend spec: replicas: 1 selector: matchLabels: app: smoa-backend template: metadata: labels: app: smoa-backend spec: containers: - name: backend image: smoa-backend:1.0.0 imagePullPolicy: IfNotPresent ports: - containerPort: 8080 env: - name: SPRING_PROFILES_ACTIVE value: "prod" - name: SMOA_API_KEY valueFrom: secretKeyRef: name: smoa-secrets key: api-key - name: SMOA_CORS_ORIGINS valueFrom: configMapKeyRef: name: smoa-config key: cors-origins optional: true resources: requests: memory: "512Mi" cpu: "250m" limits: memory: "1Gi" cpu: "1000m" livenessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: /health port: 8080 initialDelaySeconds: 10 periodSeconds: 5 restartPolicy: Always --- apiVersion: v1 kind: Service metadata: name: smoa-backend labels: app: smoa-backend spec: type: ClusterIP ports: - port: 8080 targetPort: 8080 protocol: TCP name: http selector: app: smoa-backend --- # Optional: create secret and configmap (replace values) # kubectl create secret generic smoa-secrets --from-literal=api-key=YOUR_API_KEY # kubectl create configmap smoa-config --from-literal=cors-origins=https://smoa.example.com