---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: dennis-builder-handler
    app.kubernetes.io/name: dennis-builder-handler
  name: dennis-builder-handler
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/instance: dennis-builder-handler
      app.kubernetes.io/name: dennis-builder-handler
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/path: /metrics
        prometheus.io/port: "3000"
      labels:
        app.kubernetes.io/instance: dennis-builder-handler
        app.kubernetes.io/name: dennis-builder-handler
    spec:
      shareProcessNamespace: true
      containers:
      - env:
        - name: CONSUL_HTTP_ADDR
          value: "http://dennis-consul-server:8500"
        - name: CONSUL_AUTH_METHOD
          value: "auth-method-consul-auth"
        - name: LOG_LEVEL
          value: "debug"
        image: 731927492438.dkr.ecr.sa-east-1.amazonaws.com/dennis-builder-handler:dev-9
        imagePullPolicy: Always
        name: dennis-builder-handler
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /health
            port: 3000
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 30
          successThreshold: 1
          timeoutSeconds: 1
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /health
            port: 3000
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          limits:
            cpu: "1"
            memory: 1536Mi
          requests:
            cpu: 128m
            memory: 256Mi
        securityContext: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - name: "token"
          mountPath: "/var/run/secrets/nats.io"
          readOnly: true
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: vault-auth
      serviceAccountName: vault-auth
      terminationGracePeriodSeconds: 30
      volumes:
      - name: "token"
        projected:
          sources:
          - secret:
              name: "nats-builder-handler-dennis-nats-bound-token"
              items:
              - key: token
                path: "token"
