---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: app
  namespace: cnb-nodejs
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cnb-nodejs
  template:
    metadata:
      labels:
        app: cnb-nodejs
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/path: "/metrics"
        prometheus.io/port:  "8080"
    spec:
      containers:
        - image: alexandreroman/cnb-nodejs
          name: app
          resources:
            limits:
              memory: 256Mi
          ports:
            - containerPort: 8080
          envFrom:
            - configMapRef:
                name: app
          livenessProbe:
            httpGet:
              port: 8080
              path: /
            initialDelaySeconds: 60
            periodSeconds: 2
          readinessProbe:
            httpGet:
              port: 8080
              path: /
            initialDelaySeconds: 10
#          volumeMounts:
#            - mountPath: /app-data
#              name: data
#      volumes:
#        - name: data
#          persistentVolumeClaim:
#            claimName: data
#      initContainers:
#        - name: set-volume-permissions
#          image: busybox
#          command: ["sh", "-c", "chown -R 1000:1000 /app-data"]
#          volumeMounts:
#            - name: data
#              mountPath: /app-data
