apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: prow
  name: hook
  labels:
    app: hook
spec:
  replicas: 4
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  selector:
    matchLabels:
      app: hook
  template:
    metadata:
      labels:
        app: hook
    spec:
      serviceAccountName: hook
      terminationGracePeriodSeconds: 180
      containers:
      - name: hook
        image: gcr.io/k8s-prow/hook:v20211214-82e6408890
        imagePullPolicy: Always
        args:
        - --config-path=/etc/config/config.yaml
        - --dry-run=false
        - --github-endpoint=http://ghproxy.prow.svc.cluster.local
        - --github-endpoint=https://api.github.com
        - --github-token-path=/etc/github/token
        - --job-config-path=/etc/job-config
        - --kubeconfig=/etc/kubeconfig/kubeconfig
        ports:
        - name: http
          containerPort: 8888
        - name: metrics
          containerPort: 9090
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
              - "ALL"
          privileged: false
        volumeMounts:
        - name: hmac
          mountPath: /etc/webhook
          readOnly: true
        - name: github-token
          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
        - name: kubeconfig
          mountPath: /etc/kubeconfig
          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: k8s-infra-prow-hmac-token
      - name: github-token
        secret:
          defaultMode: 420
          secretName: k8s-infra-ci-robot-github-token
      - name: kubeconfig
        secret:
          defaultMode: 420
          secretName: k8s-infra-build-clusters-kubeconfig
      - name: config
        configMap:
          name: config
      - name: job-config
        configMap:
          name: job-config
      - name: plugins
        configMap:
          name: plugins
