apiVersion: apps/v1
kind: Deployment
metadata:
  name: scrumlr-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: scrumlr-server
  template:
    metadata:
      labels: 
        app: scrumlr-server
    spec:
      containers:
        - name: scrumlr-server
          image: scrumlr-parse
          imagePullPolicy: IfNotPresent
          ports:
            - name: serverport
              containerPort: 4000
          envFrom:
            - configMapRef:
                name: scrumlr-server-configmap
            - secretRef:
                name: scrumlr-server-secrets
          livenessProbe: 
            httpGet:
              path: /api/health
              port: serverport
            initialDelaySeconds: 30
            periodSeconds: 10
            timeoutSeconds: 5
          readinessProbe: 
            httpGet:
              path: /api/users
              port: serverport
              httpHeaders:
                - name: X-Parse-Application-Id
                  value: Scrumlr
            initialDelaySeconds: 30
            periodSeconds: 5
            timeoutSeconds: 5
      restartPolicy: Always