---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: default
  name: start-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      app: start
  template:
    metadata:
      labels:
        app: start
    spec:
      containers:
        - name: start-app
          image: gcr.io/cf-spring-boot/initializr-k8s-image@sha256:8e2dc101a479433cf81031d045e5df9b780d363ba16a214dfce14d6eb41e26fa
          lifecycle:
            preStop:
              exec:
                command: ["sh", "-c", "sleep 10"]
          livenessProbe:
            httpGet:
              path: /actuator/health/liveness
              port: 8080
            initialDelaySeconds: 5
          readinessProbe:
            httpGet:
              path: /actuator/health/readiness
              port: 8080
          volumeMounts:
            - name: elastic
              mountPath: "/etc/config/initializr/stats/elastic"
              readOnly: true
          env:
            - name: SERVER_SHUTDOWN
              value: graceful
            - name: SPRING_CONFIG_IMPORT
              value: configtree:/etc/config/
      volumes:
        - name: elastic
          secret:
            secretName: elastic