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