apiVersion: apps/v1
kind: Deployment
metadata:
  name: heartbeat
  namespace: josie-health
  labels:
    app: heartbeat
    app.kubernetes.io/part-of: josiedothealth
spec:
  replicas: 1
  selector:
    matchLabels:
      app: heartbeat
  template:
    metadata:
      labels:
        app: heartbeat
    spec:
      containers:
      - name: heartbeat
        image: image-registry.openshift-image-registry.svc:5000/josie-health/heartbeat:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
          protocol: TCP
        envFrom:
        - configMapRef:
            name: heartbeat-config
        - secretRef:
            name: heartbeat-secret
        - secretRef:
            name: heartbeat-vapid-keys
        volumeMounts:
        - name: config
          mountPath: /app/config
        livenessProbe:
          httpGet:
            path: /api/stats
            port: 8080
          initialDelaySeconds: 30
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /api/stats
            port: 8080
          initialDelaySeconds: 5
          periodSeconds: 5
        resources:
          limits:
            cpu: 200m
            memory: 256Mi
          requests:
            cpu: 100m
            memory: 128Mi
      volumes:
      - name: config
        configMap:
          name: heartbeat-env-config
