apiVersion: apps/v1
kind: Deployment
metadata:
  name: face-service-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      component: face-service
  template:
    metadata:
      labels:
        component: face-service
        tier: backend
    spec:
      containers:
        - name: face-service
          image: docker.pkg.github.com/mrsupiri/speculo/face-service:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 3000
          env:
            - name: IMAGE_PROCESSOR_URL
              value: http://image-processor-cluster-ip-service/api/v1/fingerprint
            - name: COMPARATOR_URL
              value: http://facecomparator:8080/v1/models/facecomparator
            - name: DB_NAME
              valueFrom:
                secretKeyRef:
                  name: database-secrets
                  key: DB_NAME
            - name: DB_USERNAME
              valueFrom:
                secretKeyRef:
                  name: database-secrets
                  key: DB_USERNAME
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: database-secrets
                  key: DB_PASSWORD
            - name: DB_HOST
              valueFrom:
                secretKeyRef:
                  name: database-secrets
                  key: DB_HOST
