apiVersion: apps/v1
kind: Deployment
metadata:
  name: kt-channel-controller
  namespace: knative-eventing
spec:
  replicas: 1
  selector:
    matchLabels: &labels
      messaging.optum.dev/channel: kafka-channel
      messaging.optum.dev/role: controller
  template:
    metadata:
      labels: *labels
    spec:
      serviceAccountName: kt-channel-controller
      containers:
      - name: controller
        image: ko://github.com/optum/kafka-topic-channel/cmd/channel/kt-channel/controller
        env:
        - name: CONFIG_LOGGING_NAME
          value: config-logging
        - name: METRICS_DOMAIN
          value: knative.dev/eventing
        - name: SYSTEM_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: CONFIG_LEADERELECTION_NAME
          value: config-leader-election
        - name: DISPATCHER_IMAGE
          value: ko://github.com/optum/kafka-topic-channel/cmd/channel/kt-channel/dispatcher
        ports:
        - containerPort: 9090
          name: metrics
        volumeMounts:
        - name: config-logging
          mountPath: /etc/config-logging
      volumes:
      - name: config-logging
        configMap:
          name: config-logging
