apiVersion: apps/v1 kind: Deployment metadata: name: console-backend namespace: site11-pipeline labels: app: console-backend spec: replicas: 2 selector: matchLabels: app: console-backend template: metadata: labels: app: console-backend spec: containers: - name: console-backend image: yakenator/site11-console-backend:latest imagePullPolicy: Always ports: - containerPort: 8000 protocol: TCP env: - name: ENV value: "production" - name: MONGODB_URL value: "mongodb://host.docker.internal:27017" - name: REDIS_URL value: "redis://host.docker.internal:6379" - name: USERS_SERVICE_URL value: "http://users-backend:8000" resources: requests: memory: "256Mi" cpu: "100m" limits: memory: "512Mi" cpu: "500m" readinessProbe: httpGet: path: /health port: 8000 initialDelaySeconds: 10 periodSeconds: 5 livenessProbe: httpGet: path: /health port: 8000 initialDelaySeconds: 30 periodSeconds: 10 --- apiVersion: v1 kind: Service metadata: name: console-backend namespace: site11-pipeline labels: app: console-backend spec: type: ClusterIP selector: app: console-backend ports: - port: 8000 targetPort: 8000 protocol: TCP --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: console-backend-hpa namespace: site11-pipeline spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: console-backend minReplicas: 2 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70 - type: Resource resource: name: memory target: type: Utilization averageUtilization: 80