---
apiVersion: apps/v1
kind: Deployment
metadata:
#  labels:
#    app.kubernetes.io/component: controller
#    app.kubernetes.io/name: tekton-pipelines
  name: tekton-pipelines-controller
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tekton-pipelines-controller
  template:
    metadata:
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
        sidecar.istio.io/inject: "false"
      labels:
        app: tekton-pipelines-controller
#        app.kubernetes.io/component: controller
#        app.kubernetes.io/name: tekton-pipelines
    spec:
      containers:
      - args:
        - -logtostderr
        - -stderrthreshold
        - INFO
        - -kubeconfig-writer-image
        - $(registry)/$(kubeconfigwriter)
        - -creds-image
        - $(registry)/$(creds-init)
        - -git-image
        - $(registry)/$(git-init)
        - -nop-image
        - $(registry)/$(nop)
        - -bash-noop-image
        - $(registry)/$(bash)
        - -gsutil-image
        - $(registry)/$(gsutil)
        - -entrypoint-image
        - $(registry)/$(entrypoint)
        - -imagedigest-exporter-image
        - $(registry)/$(imagedigestexporter)
        - -pr-image
        - $(registry)/$(pullrequest-init)
        - -build-gcs-fetcher-image
        - $(registry)/$(gcs-fetcher)
        env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: CONFIG_OBSERVABILITY_NAME
          value: config-observability
        - name: METRICS_DOMAIN
          value: tekton.dev/pipeline
        image: $(registry)/$(controller)
        name: tekton-pipelines-controller
        volumeMounts:
        - mountPath: /etc/config-logging
          name: config-logging
      serviceAccountName: tekton-pipelines-controller
      volumes:
      - configMap:
          name: config-logging
        name: config-logging
---
apiVersion: apps/v1
kind: Deployment
metadata:
#  labels:
#    app.kubernetes.io/component: webhook-controller
#    app.kubernetes.io/name: tekton-pipelines
  name: tekton-pipelines-webhook
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tekton-pipelines-webhook
  template:
    metadata:
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
        sidecar.istio.io/inject: "false"
      labels:
        app: tekton-pipelines-webhook
#        app.kubernetes.io/component: webhook-controller
#        app.kubernetes.io/name: tekton-pipelines
    spec:
      containers:
      - env:
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        image: $(registry)/$(webhook)
        name: webhook
        volumeMounts:
        - mountPath: /etc/config-logging
          name: config-logging
      serviceAccountName: tekton-pipelines-controller
      volumes:
      - configMap:
          name: config-logging
        name: config-logging
---
