kind: Deployment apiVersion: apps/v1 metadata: namespace: regula name: regula-face-api labels: app: regula-face-api spec: replicas: 2 selector: matchLabels: app: regula-face-api template: metadata: labels: app: regula-face-api spec: containers: - name: faceapi image: regulaforensics/face-api:nightly-cpu ## Set requried version TAG here imagePullPolicy: Always env: ## General settings - name: FACEAPI_BIND value: "0.0.0.0:41101" ## Default value - name: FACEAPI_BACKLOG value: "20" ## Default value - name: FACEAPI_WORKERS value: "1" ## Default value - name: FACEAPI_ENABLE_DEMO_WEB_APP value: "true" ## Default value ## Resources and Limits. Each worker requires 1 cpu/2Gb memory, this SumCPU = Nworkers * 1 cpu; SumMemory = Nworkers * 3Gb resources: requests: memory: "3Gi" cpu: "1" limits: memory: "3Gi" cpu: "1" ports: - name: http containerPort: 41101 readinessProbe: httpGet: path: /api/ping port: http initialDelaySeconds: 20 periodSeconds: 20 volumeMounts: - name: regula-license mountPath: /app/extBin/unix/regula.license subPath: regula.license - name: nginx image: nginx:latest ports: - name: http containerPort: 80 - name: https containerPort: 443 resources: requests: cpu: "0.5" memory: "256Mi" limits: cpu: "1" memory: "512Mi" volumeMounts: - name: default mountPath: /etc/nginx/conf.d/default.conf subPath: default.conf - name: tls-cert mountPath: /etc/nginx/ssl/ volumes: - name: regula-license secret: secretName: regula-license - name: default configMap: name: default items: - key: default.conf path: default.conf - name: tls-cert secret: secretName: certificates --- ## Prerequisits - Metrics Server https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/#metrics-server apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: namespace: regula name: regula-face-api labels: app: regula-face-api spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: regula-face-api minReplicas: 2 maxReplicas: 5 targetCPUUtilizationPercentage: 150 --- apiVersion: v1 kind: Service metadata: name: regula-face-api namespace: regula spec: ports: - name: http port: 80 protocol: TCP targetPort: 80 - name: https port: 443 protocol: TCP targetPort: 443 selector: app: regula-face-api type: ClusterIP