apiVersion: apps/v1
kind: Deployment
metadata:
  name: mortgage-deployment
spec:
  selector:
    matchLabels:
      app: mortgage-app
  replicas: 2
  template:
    metadata:
      labels:
        app: mortgage-app
    spec:
      containers:
        - name: mortgage-app
          image: shannonlal/mortgage-calculation-api:0.0.1
          ports:
            - containerPort: 3334
          imagePullPolicy: IfNotPresent # Image should not be pulled
          livenessProbe:
            httpGet:
              path: /api/health-check
              port: 3334
            initialDelaySeconds: 3
            periodSeconds: 3
            failureThreshold: 2
          env:
            - name: HEALTH_ID
              valueFrom:
                configMapKeyRef:
                  name: calculator-envs
                  key: healthId