---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: prow
  name: hook2
  labels:
    app: hook2
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  selector:
    matchLabels:
      app: hook2
  template:
    metadata:
      labels:
        app: hook2
    spec:
      serviceAccountName: "hook"
      terminationGracePeriodSeconds: 180
      containers:
        - name: hook2
          image: gcr.io/k8s-prow/hook:v20211029-f2e5351ee3
          imagePullPolicy: Always
          args:
            - --dry-run=false
            - --config-path=/etc/config/config.yaml
            - --github-app-id=120817
            - --github-app-private-key-path=/etc/github/key
            - --github-host=github.com
            - --github-endpoint=http://ghproxy
            - --github-endpoint=https://api.github.com
            - --job-config-path=/etc/job-config
          ports:
            - name: http
              containerPort: 8888
          volumeMounts:
            - name: hmac
              mountPath: /etc/webhook
              readOnly: true
            - name: key
              mountPath: /etc/github
              readOnly: true
            - name: config
              mountPath: /etc/config
              readOnly: true
            - name: job-config
              mountPath: /etc/job-config
              readOnly: true
            - name: plugins
              mountPath: /etc/plugins
              readOnly: true
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8081
            initialDelaySeconds: 3
            periodSeconds: 3
          readinessProbe:
            httpGet:
              path: /healthz/ready
              port: 8081
            initialDelaySeconds: 10
            periodSeconds: 3
            timeoutSeconds: 600
      volumes:
        - name: hmac
          secret:
            secretName: hmac-token
        - name: key
          secret:
            secretName: github-app-key
        - name: config
          configMap:
            name: config
        - name: job-config
          configMap:
            name: job-config
        - name: plugins
          configMap:
            name: plugins
