apiVersion: apps/v1
kind: Deployment
metadata:
 name: kafka-ui
 labels:
   app: kafka-ui
spec:
 replicas: 1
 selector:
   matchLabels:
     app: kafka-ui
 template:
   metadata:
     labels:
       app: kafka-ui
   spec:
     containers:
       - name: kafka-ui
         image: provectuslabs/kafka-ui:latest
         env:
           - name: KAFKA_CLUSTERS_0_NAME 
             value: "k8s-kafka"
           - name: KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS
             value: "kafka:9092"
           - name: KAFKA_CLUSTERS_0_PROPERTIES_SECURITY_PROTOCOL
             value: "PLAINTEXT"
           - name: KAFKA_CLUSTERS_0_PROPERTIES_SASL_ENABLED
             value: "false"
         ports:
           - containerPort: 8080
             name: http
         resources:
           limits:
             memory: "1Gi"
             cpu: "500m"
           requests:
             memory: "512Mi"
             cpu: "250m"
---
apiVersion: v1
kind: Service
metadata:
 name: kafka-ui
 labels:
   app: kafka-ui
spec:
 type: LoadBalancer
 ports:
   - port: 8080
     targetPort: http
     protocol: TCP
     name: http
 selector:
   app: kafka-ui
