---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: prow
  name: prow-controller-manager
  labels:
    app: prow-controller-manager
spec:
  replicas: 1
  selector:
    matchLabels:
      app: prow-controller-manager
  template:
    metadata:
      labels:
        app: prow-controller-manager
    spec:
      serviceAccountName: prow-controller-manager
      containers:
      - name: prow-controller-manager
        args:
        - --dry-run=false
        - --config-path=/etc/config/config.yaml
        - --job-config-path=/etc/job-config
        - --github-endpoint=http://ghproxy
        - --github-endpoint=https://api.github.com
        - --enable-controller=plank
        - --github-app-id=$(GITHUB_APP_ID)
        - --github-app-private-key-path=/etc/github/cert
        env:
        - name: GITHUB_APP_ID
          valueFrom:
            secretKeyRef:
              name: github-token
              key: appid
        - name: KUBECONFIG
          value: "/etc/kubeconfig/config:/etc/kubeconfig/config"
        ports:
        - name: metrics
          containerPort: 9090
        image: gcr.io/k8s-prow/prow-controller-manager:v20220331-c4e1c201d5
        volumeMounts:
        - name: kubeconfig
          mountPath: /etc/kubeconfig
          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
      volumes:
      - name: kubeconfig
        secret:
          secretName: kubeconfig
          defaultMode: 420
      - name: github-token
        secret:
          secretName: github-token
      - name: config
        configMap:
          name: config
      - name: job-config
        configMap:
          name: job-config
