apiVersion: apps/v1
kind: Deployment
metadata:
  name: canal-graph-deployment
  labels:
    app: canal-graph
spec:
  replicas: 3
  selector:
    matchLabels:
      app: canal-graph
  template:
    metadata:
      labels:
        app: canal-graph
    spec:
      containers:
        - name: canal-graph
          image: gcr.io/canalapp/canal-graph:0.7.1
          imagePullPolicy: Always
          ports:
            - name: http-api
              containerPort: 4080
          env:
            - name: DB_HOST
              value: 10.97.176.3
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: /etc/serviceaccount/canal-prod-backend-service-account.json
            - name: INVITE_KEY
              valueFrom:
                secretKeyRef:
                  key: INVITE_KEY
                  name: canal-prod-invite-key-env
          envFrom:
            - secretRef:
                name: canal-api-prod-creds
          readinessProbe:
            httpGet:
              port: 4080
              path: /system/health
          volumeMounts:
            - mountPath: /etc/serviceaccount
              name: serviceaccount
              readOnly: true
      volumes:
        - name: serviceaccount
          secret:
            secretName: canal-prod-backend-service-account
