apiVersion: apps/v1
kind: Deployment
metadata:
  name: tekton-step-observer
  namespace: tekton-pipelines
  labels: &labels
    app: step-observer
    app.kubernetes.io/name: step-observer
    app.kubernetes.io/component: controller
    app.kubernetes.io/instance: default
    app.kubernetes.io/version: "devel"
    app.kubernetes.io/part-of: tekton-pipelines
spec:
  replicas: 1
  selector:
    matchLabels: *labels
  template:
    metadata:
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
      labels: *labels
    spec:
      serviceAccountName: tekton-step-observer
      containers:
        - name: tekton-step-observer
          image: ko://github.com/tom24d/step-observe-controller/cmd/controller
          volumeMounts:
            - name: config-logging
              mountPath: /etc/config-logging
          env:
            - name: SYSTEM_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            # If you are changing these names, you will also need to update
            # the reconciler's Role in 200-role.yaml to include the new
            # values in the "configmaps" "get" rule.
            - name: CONFIG_LOGGING_NAME
              value: config-logging
            - name: CONFIG_OBSERVABILITY_NAME
              value: config-observability
            - name: CONFIG_FEATURE_FLAGS_NAME
              value: feature-flags
            - name: CONFIG_LEADERELECTION_NAME
              value: config-leader-election
            - name: METRICS_DOMAIN
              value: tekton.dev/pipeline
          ports:
            - containerPort: 9090
              name: metrics
      volumes:
        - name: config-logging
          configMap:
            name: config-logging
