apiVersion: apps/v1 kind: Deployment metadata: name: vims-api namespace: vims labels: app: vims-api spec: replicas: 2 selector: matchLabels: app: vims-api template: metadata: labels: app: vims-api spec: containers: - name: api image: 155407238699.dkr.ecr.eu-north-1.amazonaws.com/vims:latest imagePullPolicy: Always ports: - containerPort: 3450 envFrom: - configMapRef: name: vims-config envFrom: - secretRef: name: vims-secrets livenessProbe: httpGet: path: /health/live port: 3450 initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: /health/ready port: 3450 initialDelaySeconds: 5 periodSeconds: 5 resources: requests: memory: "512Mi" cpu: "500m" limits: memory: "1Gi" cpu: "1000m" --- apiVersion: v1 kind: Service metadata: name: vims-api namespace: vims spec: selector: app: vims-api ports: - port: 80 targetPort: 3450 type: ClusterIP --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: vims-api-hpa namespace: vims spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: vims-api 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