---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: ${project.artifactId}
    provider: fabric8
    version: ${project.version}
    group: ${project.groupId}
  name: ${project.artifactId}
spec:
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: ${project.artifactId}
      provider: fabric8
      group: ${project.groupId}
  template:
    metadata:
      labels:
        app: ${project.artifactId}
        provider: fabric8
        version: ${project.version}
        group: ${project.groupId}
    spec:
      containers:
      - env:
        - name: KUBERNETES_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        image: test/${project.artifactId}:0.0.1
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /health
            port: 8081
            scheme: HTTP
          initialDelaySeconds: 180
          successThreshold: 1
        name: spring-boot
        ports:
        - containerPort: 9779
          name: prometheus
          protocol: TCP
        - containerPort: 8080
          protocol: TCP
        - containerPort: 8778
          name: jolokia
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /health
            port: 8081
            scheme: HTTP
          initialDelaySeconds: 10
          successThreshold: 1
        securityContext:
          privileged: false
