---
apiVersion: v1
kind: ConfigMap
metadata:
  name: health-checker-configmap
data:
  db.json: |
    {
      "health": [
        {
          "status": "ok"
        }
      ]
    }
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: health-checker-deployment
  labels:
    app: health-checker
spec:
  replicas: 1
  selector:
    matchLabels:
      app: health-checker
  template:
    metadata:
      labels:
        app: health-checker
    spec:
      containers:
        - name: health-checker
          image: clue/json-server:latest
          ports:
            - containerPort: 80
          volumeMounts:
            - name: json
              mountPath: /data/db.json
              subPath: db.json
          readinessProbe:
            httpGet:
              path: /health
              port: 80
            initialDelaySeconds: 5
            periodSeconds: 5
            timeoutSeconds: 5
      volumes:
        - name: json
          configMap:
            name: health-checker-configmap
            items:
              - key: db.json
                path: db.json
