apiVersion: apps/v1
kind: Deployment
metadata:
  name: kafka-broker-controller
  namespace: knative-eventing
  labels:
    app: kafka-broker-controller
    eventing.knative.dev/release: devel
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kafka-broker-controller
  template:
    metadata:
      name: kafka-broker-controller
      labels:
        app: kafka-broker-controller
        eventing.knative.dev/release: devel
    spec:
      securityContext:
        runAsNonRoot: true
      serviceAccountName: kafka-broker-controller
      containers:
        - name: controller
          image: ko://knative.dev/eventing-kafka-broker/control-plane/cmd/kafka-broker-controller
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: config-logging
              mountPath: /etc/config-logging
              readOnly: true
          env:
            - name: DATA_PLANE_CONFIG_MAP_NAMESPACE
              value: knative-eventing
            - name: DATA_PLANE_CONFIG_MAP_NAME
              value: kafka-broker-brokers-triggers
            - name: CONFIG_LOGGING_NAME
              value: config-logging
            - name: CONFIG_OBSERVABILITY_NAME
              value: config-observability
            - name: METRICS_DOMAIN
              value: knative.dev/eventing
            - name: DATA_PLANE_CONFIG_FORMAT
              value: json
            - name: BROKER_INGRESS_NAME
              value: kafka-broker-ingress
            - name: GENERAL_CONFIG_MAP_NAME
              value: kafka-broker-config
            - name: SYSTEM_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          ports:
            - containerPort: 9090
              name: metrics
          terminationMessagePolicy: FallbackToLogsOnError
          terminationMessagePath: /dev/temination-log
          securityContext:
            allowPrivilegeEscalation: false
            privileged: false
            readOnlyRootFilesystem: true
      volumes:
        - name: config-logging
          configMap:
            name: config-logging
      restartPolicy: Always
