apiVersion: apps/v1
kind: Deployment
metadata:
  name: kafka-acl-viewer
  namespace: kafka
  labels:
    app: kafka-acl-viewer
spec:
  selector:
    matchLabels:
      app: kafka-acl-viewer
  template:
    metadata:
      labels:
        app: kafka-acl-viewer
    spec:
      containers:
      - name: kafka-acl-viewer
        image: kafka-acl-viewer:latest
        imagePullPolicy: Never
        ports:
        - containerPort: 8080
        volumeMounts:
          - name: kafka-acl-viewer-certs
            mountPath: "/kafka-client-certs"
            readOnly: true
          - name: kafka-cluster-cert
            mountPath: "/kafka-ca-certs"
            readOnly: true
        env:
          - name: KAFKA_URL
            value: "my-cluster-kafka-bootstrap:9093"
          - name: CA_FILE
            value: "/kafka-ca-certs/ca.crt"
          - name: CERT_FILE
            value: "/kafka-client-certs/user.crt"
          - name: KEY_FILE
            value: "/kafka-client-certs/user.key"
          - name: FETCH_INTERVAL
            value: "10s"
      volumes:
        - name: kafka-acl-viewer-certs
          secret:
            secretName: kafka-acl-viewer
            items:
              - key: user.crt
                path: user.crt
              - key: user.key
                path: user.key
        - name: kafka-cluster-cert
          secret:
            secretName: my-cluster-cluster-ca-cert
