#apiVersion: v1
#kind: Namespace
#metadata:
#  name: "kafka"
#  labels:
#    name: "kafka"
#---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: zookeeper-service
  name: zookeeper-service
# namespace: kafka
spec:
  type: NodePort
  ports:
    - name: zookeeper-port
      port: 2181
      nodePort: 30181
      targetPort: 2181
  selector:
    app: zookeeper
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: zookeeper
  name: zookeeper
# namespace: kafka
spec:
  replicas: 1
  selector:
    matchLabels:
      app: zookeeper
  template:
    metadata:
      labels:
        app: zookeeper
    spec:
      containers:
        - image: ubuntu/zookeeper:latest
          imagePullPolicy: Always
          name: zookeeper
          env:
            - name: TZ
              value: US/Michigan
            - name: "ALLOW_ANONYMOUS_LOGIN"
              value: "yes"
          ports:
            - containerPort: 2181
