apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: cfc-app
    version: v1
  name: cfc-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cfc-app
      version: v1
  template:
    metadata:
      labels:
        app: cfc-app
        version: v1
    spec:
      containers:
        - name: cfc-app
          image: image-registry.openshift-image-registry.svc:5000/cfc-app/cfc-app:latest
          imagePullPolicy: Always
          envFrom:
            - secretRef:
                name: smtp-mailtrap
            - secretRef:
                name: db-cfc-app
          ports:
            - containerPort: 3000
              name: http
              protocol: TCP
          resources:
            limits:
              cpu: "300m"
              memory: "400Mi"
          readinessProbe:
            httpGet:
              path: /health
              port: 3000
              scheme: HTTP         
            initialDelaySeconds: 20
            timeoutSeconds: 4
            periodSeconds: 5
            failureThreshold: 12
          livenessProbe:
            httpGet:
              path: /health
              port: 3000
              scheme: HTTP
            initialDelaySeconds: 20
            timeoutSeconds: 4
            periodSeconds: 5
            failureThreshold: 12
