apiVersion: apps/v1
kind: Deployment
metadata:
  name: haskell-servant
spec:
  replicas: 2
  selector:
    matchLabels:
      app: haskell-servant
  template:
    metadata:
      labels:
        app: haskell-servant
    spec:
      containers:
      - name: haskell-servant
        image: elmanhasa/haskell-servant:latest
        imagePullPolicy: Always
        ports:
        - name: http
          containerPort: 8080
        env:
        - name: DB_CONFIG
          valueFrom:
            configMapKeyRef:
              key: connectionString
              name: servant-play-config
        readinessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 30
          successThreshold: 1
          failureThreshold: 3
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 30
          successThreshold: 1
          failureThreshold: 3


