kind: Deployment
apiVersion: apps/v1
metadata:
  name: kafka-deployment
  namespace: kafka-cluster
spec:
  replicas: 1
  selector:
    matchLabels:
      name: kafka
      app: kafka
  template:
    metadata:
      labels:
        name: kafka
        app: kafka
    spec:
      containers:
      - name: kafka
        image: thecloudgarage/k8s-springboot-kafka-order-management:kafka
        ports:
        - containerPort: 9092
        env:
        - name: KAFKA_ADVERTISED_PORT
          value: "9092"
        - name: KAFKA_ADVERTISED_HOST_NAME
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: KAFKA_ZOOKEEPER_CONNECT
          value: zoo1:2181,zoo2:2181,zoo3:2181
        - name: KAFKA_CREATE_TOPICS
          value: mytopic:5:1
