# Source: lighthouse/templates/keeper-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: lighthouse-keeper
  labels:
    chart: "lighthouse-0.0.939"
    app: lighthouse-keeper
    gitops.jenkins-x.io/pipeline: 'namespaces'
  namespace: jx
  annotations:
    wave.pusher.com/update-on-config-change: 'true'
    jenkins-x.io/hash: 'b4c48675c745b117411141fe91a1a94fa99816dc63c4c77ef24eeed53f977c22'
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  selector:
    matchLabels:
      app: lighthouse-keeper
  template:
    metadata:
      annotations:
        ad.datadoghq.com/keeper.logs: '[{"source":"lighthouse","service":"keeper"}]'
      labels:
        app: lighthouse-keeper
    spec:
      serviceAccountName: lighthouse-keeper
      terminationGracePeriodSeconds: 30
      containers:
        - name: lighthouse-keeper
          image: gcr.io/jenkinsxio/lighthouse-keeper:0.0.939
          imagePullPolicy: IfNotPresent
          args:
            - "--namespace=jx"
          ports:
            - name: http
              containerPort: 8888
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
            initialDelaySeconds: 120
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 1
          readinessProbe:
            httpGet:
              path: /
              port: http
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 1
          env:
            - name: "GIT_KIND"
              value: "github"
            - name: "GIT_SERVER"
              value: "https://github.com"
            - name: "GIT_USER"
              value: xzfvictor
            - name: "GIT_TOKEN"
              valueFrom:
                secretKeyRef:
                  name: lighthouse-oauth-token
                  key: oauth
            - name: "JX_LOG_FORMAT"
              value: "json"
            - name: "LOGRUS_FORMAT"
              value: "json"
            - name: "LIGHTHOUSE_KEEPER_STATUS_CONTEXT_LABEL"
              value: "Lighthouse Merge Status"
          resources:
            limits:
              cpu: 400m
              memory: 512Mi
            requests:
              cpu: 100m
              memory: 128Mi
