# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# ----------------------------------------------------------
# WARNING: This file is autogenerated. Do not manually edit.
# ----------------------------------------------------------

# [START gke_release_kubernetes_manifests_microservices_demo]
apiVersion: v1
kind: ServiceAccount
metadata:
  name: dubbo-go
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: dubbo-go-registry
rules:
  - apiGroups:
      - ""
    resources:
      - pods
    verbs:
      - list
      - patch
      - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: dubbo-go-registry
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: dubbo-go-registry
subjects:
  - kind: ServiceAccount
    name: dubbo-go
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: emailservice
spec:
  selector:
    matchLabels:
      app: emailservice
  template:
    metadata:
      labels:
        app: emailservice
    spec:
      serviceAccountName: dubbo-go
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-email-service:1.0-go
          ports:
            - containerPort: 20004
          env:
            - name: PORT
              value: "20004"
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
            - name: DISABLE_TRACING
              value: "1"
            - name: DISABLE_PROFILER
              value: "1"
          readinessProbe:
            periodSeconds: 5
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20004"]
          livenessProbe:
            periodSeconds: 5
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20004"]
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
  name: emailservice
spec:
  type: ClusterIP
  selector:
    app: emailservice
  ports:
    - name: grpc
      port: 50004
      targetPort: 20004
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: checkoutservice
spec:
  selector:
    matchLabels:
      app: checkoutservice
  template:
    metadata:
      labels:
        app: checkoutservice
    spec:
      serviceAccountName: dubbo-go
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-checkout-service:1.0-go
          ports:
            - containerPort: 20002
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20002"]
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20002"]
          env:
            - name: PORT
              value: "20002"
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
            - name: PRODUCT_CATALOG_SERVICE_ADDR
              value: "productcatalogservice:50006"
            - name: SHIPPING_SERVICE_ADDR
              value: "shippingservice:50007"
            - name: PAYMENT_SERVICE_ADDR
              value: "paymentservice:50005"
            - name: EMAIL_SERVICE_ADDR
              value: "emailservice:50004"
            - name: CURRENCY_SERVICE_ADDR
              value: "currencyservice:50003"
            - name: CART_SERVICE_ADDR
              value: "cartservice:50001"
            - name: DISABLE_STATS
              value: "1"
            - name: DISABLE_TRACING
              value: "1"
            - name: DISABLE_PROFILER
              value: "1"
            - name: JAEGER_SERVICE_ADDR
              value: "jaeger-collector:14268"
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
  name: checkoutservice
spec:
  type: ClusterIP
  selector:
    app: checkoutservice
  ports:
    - name: grpc
      port: 50002
      targetPort: 20002
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: recommendationservice
spec:
  selector:
    matchLabels:
      app: recommendationservice
  template:
    metadata:
      labels:
        app: recommendationservice
    spec:
      serviceAccountName: dubbo-go
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-recommendation-service:1.0-go
          ports:
            - containerPort: 20011
          readinessProbe:
            periodSeconds: 5
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20011"]
          livenessProbe:
            periodSeconds: 5
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20011"]
          env:
            - name: PORT
              value: "20011"
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
            - name: PRODUCT_CATALOG_SERVICE_ADDR
              value: "productcatalogservice:50006"
            - name: DISABLE_TRACING
              value: "1"
            - name: DISABLE_PROFILER
              value: "1"
            - name: DISABLE_DEBUGGER
              value: "1"
          resources:
            requests:
              cpu: 100m
              memory: 220Mi
            limits:
              cpu: 200m
              memory: 450Mi
---
apiVersion: v1
kind: Service
metadata:
  name: recommendationservice
spec:
  type: ClusterIP
  selector:
    app: recommendationservice
  ports:
    - name: grpc
      port: 50011
      targetPort: 20011
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
spec:
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      serviceAccountName: dubbo-go
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-frontend-service:1.0-go
          ports:
            - containerPort: 8090
            - containerPort: 20010
          env:
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
          readinessProbe:
            initialDelaySeconds: 10
            httpGet:
              path: "/_healthz"
              port: 8090
              httpHeaders:
                - name: "Cookie"
                  value: "shop_session-id=x-readiness-probe"
          livenessProbe:
            initialDelaySeconds: 10
            httpGet:
              path: "/_healthz"
              port: 8090
              httpHeaders:
                - name: "Cookie"
                  value: "shop_session-id=x-liveness-probe"
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
  name: frontend
spec:
  type: ClusterIP
  selector:
    app: frontend
  ports:
    - name: http
      port: 80
      targetPort: 8090
    - name: tcp
      port: 50010
      targetPort: 20010
---
apiVersion: v1
kind: Service
metadata:
  name: frontend-external
spec:
  type: LoadBalancer
  selector:
    app: frontend
  ports:
    - name: http
      port: 80
      targetPort: 8090
    - name: tcp
      port: 50010
      targetPort: 20010
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: paymentservice
spec:
  selector:
    matchLabels:
      app: paymentservice
  template:
    metadata:
      labels:
        app: paymentservice
    spec:
      serviceAccountName: dubbo-go
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-payment-service:1.0-go
          ports:
            - containerPort: 20005
          env:
            - name: PORT
              value: "20005"
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
            - name: DISABLE_TRACING
              value: "1"
            - name: DISABLE_PROFILER
              value: "1"
            - name: DISABLE_DEBUGGER
              value: "1"
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20005"]
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20005"]
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
  name: paymentservice
spec:
  type: ClusterIP
  selector:
    app: paymentservice
  ports:
    - name: grpc
      port: 50005
      targetPort: 20005
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: productcatalogservice
spec:
  selector:
    matchLabels:
      app: productcatalogservice
  template:
    metadata:
      labels:
        app: productcatalogservice
    spec:
      serviceAccountName: dubbo-go
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-productcatalog-service:1.0-go
          ports:
            - containerPort: 20006
          env:
            - name: PORT
              value: "20006"
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
            - name: DISABLE_STATS
              value: "1"
            - name: DISABLE_TRACING
              value: "1"
            - name: DISABLE_PROFILER
              value: "1"
          # - name: JAEGER_SERVICE_ADDR
          #   value: "jaeger-collector:14268"
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20006"]
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20006"]
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
  name: productcatalogservice
spec:
  type: ClusterIP
  selector:
    app: productcatalogservice
  ports:
    - name: grpc
      port: 50006
      targetPort: 20006
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cartservice
spec:
  selector:
    matchLabels:
      app: cartservice
  template:
    metadata:
      labels:
        app: cartservice
    spec:
      serviceAccountName: dubbo-go
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-cart-service:1.0-go
          imagePullPolicy: Never
          ports:
            - containerPort: 20001
          env:
            - name: REDIS_ADDR
              value: "redis-cart:6379"
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
          resources:
            requests:
              cpu: 200m
              memory: 64Mi
            limits:
              cpu: 300m
              memory: 128Mi
          readinessProbe:
            initialDelaySeconds: 15
            exec:
              command:
                ["/bin/grpc_health_probe", "-addr=:20001", "-rpc-timeout=5s"]
          livenessProbe:
            initialDelaySeconds: 15
            periodSeconds: 10
            exec:
              command:
                ["/bin/grpc_health_probe", "-addr=:20001", "-rpc-timeout=5s"]
---
apiVersion: v1
kind: Service
metadata:
  name: cartservice
spec:
  type: ClusterIP
  selector:
    app: cartservice
  ports:
    - name: grpc
      port: 50001
      targetPort: 20001
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: loadgenerator
spec:
  selector:
    matchLabels:
      app: loadgenerator
  replicas: 1
  template:
    metadata:
      labels:
        app: loadgenerator
      annotations:
        sidecar.istio.io/rewriteAppHTTPProbers: "true"
    spec:
      serviceAccountName: dubbo-go
      terminationGracePeriodSeconds: 5
      restartPolicy: Always
      initContainers:
        - command:
            - /bin/sh
            - -exc
            - |
              echo "Init container pinging frontend: ${FRONTEND_ADDR}..."
              STATUSCODE=$(wget --server-response http://${FRONTEND_ADDR} 2>&1 | awk '/^  HTTP/{print $2}')
              if test $STATUSCODE -ne 200; then
                  echo "Error: Could not reach frontend - Status code: ${STATUSCODE}"
                  exit 1
              fi
          name: frontend-check
          image: busybox:latest
          env:
            - name: FRONTEND_ADDR
              value: "frontend:80"
      containers:
        - name: main
          image: gcr.io/google-samples/microservices-demo/loadgenerator:v0.3.8
          env:
            - name: FRONTEND_ADDR
              value: "frontend:80"
            - name: USERS
              value: "10"
          resources:
            requests:
              cpu: 300m
              memory: 256Mi
            limits:
              cpu: 500m
              memory: 512Mi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: currencyservice
spec:
  selector:
    matchLabels:
      app: currencyservice
  template:
    metadata:
      labels:
        app: currencyservice
    spec:
      serviceAccountName: dubbo-go
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-currency-service:1.0-go
          ports:
            - name: grpc
              containerPort: 20003
          env:
            - name: PORT
              value: "20003"
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
            - name: DISABLE_TRACING
              value: "1"
            - name: DISABLE_PROFILER
              value: "1"
            - name: DISABLE_DEBUGGER
              value: "1"
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20003"]
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20003"]
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
  name: currencyservice
spec:
  type: ClusterIP
  selector:
    app: currencyservice
  ports:
    - name: grpc
      port: 50003
      targetPort: 20003
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: shippingservice
spec:
  selector:
    matchLabels:
      app: shippingservice
  template:
    metadata:
      labels:
        app: shippingservice
    spec:
      serviceAccountName: dubbo-go
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-shipping-service:1.0-go
          ports:
            - containerPort: 20007
          env:
            - name: PORT
              value: "20007"
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
            - name: DISABLE_STATS
              value: "1"
            - name: DISABLE_TRACING
              value: "1"
            - name: DISABLE_PROFILER
              value: "1"
          # - name: JAEGER_SERVICE_ADDR
          #   value: "jaeger-collector:14268"
          readinessProbe:
            periodSeconds: 5
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20007"]
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:20007"]
          resources:
            requests:
              cpu: 100m
              memory: 64Mi
            limits:
              cpu: 200m
              memory: 128Mi
---
apiVersion: v1
kind: Service
metadata:
  name: shippingservice
spec:
  type: ClusterIP
  selector:
    app: shippingservice
  ports:
    - name: grpc
      port: 50007
      targetPort: 20007
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: redis-cart
spec:
  selector:
    matchLabels:
      app: redis-cart
  template:
    metadata:
      labels:
        app: redis-cart
    spec:
      containers:
        - name: redis
          image: redis:alpine
          ports:
            - containerPort: 6379
          readinessProbe:
            periodSeconds: 5
            tcpSocket:
              port: 6379
          livenessProbe:
            periodSeconds: 5
            tcpSocket:
              port: 6379
          volumeMounts:
            - mountPath: /data
              name: redis-data
          resources:
            limits:
              memory: 256Mi
              cpu: 125m
            requests:
              cpu: 70m
              memory: 200Mi
      volumes:
        - name: redis-data
          emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
  name: redis-cart
spec:
  type: ClusterIP
  selector:
    app: redis-cart
  ports:
    - name: redis
      port: 6379
      targetPort: 6379
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: adservice
spec:
  selector:
    matchLabels:
      app: adservice
  template:
    metadata:
      labels:
        app: adservice
    spec:
      serviceAccountName: dubbo-go
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: sca-registry.cn-hangzhou.cr.aliyuncs.com/dubbo/online-boutique-ad-service:1.0-go
          ports:
            - containerPort: 20000
          env:
            - name: DUBBO_REGISTRY_ADDRESS
              value: "zookeeper.dubbo-system.svc:2181"
          resources:
            requests:
              cpu: 200m
              memory: 180Mi
            limits:
              cpu: 300m
              memory: 300Mi
---
apiVersion: v1
kind: Service
metadata:
  name: adservice
spec:
  type: ClusterIP
  selector:
    app: adservice
  ports:
    - name: grpc
      port: 50000
      targetPort: 20000
# [END gke_release_kubernetes_manifests_microservices_demo]

# zookeeper
# Source: zookeeper/templates/scripts-configmap.yaml
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: zookeeper-scripts
  namespace: dubbo-system
  labels:
    app.kubernetes.io/name: zookeeper
    helm.sh/chart: zookeeper-11.1.6
    app.kubernetes.io/instance: zookeeper
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: zookeeper
data:
  init-certs.sh: |-
    #!/bin/bash
  setup.sh: |-
    #!/bin/bash

    # Execute entrypoint as usual after obtaining ZOO_SERVER_ID
    # check ZOO_SERVER_ID in persistent volume via myid
    # if not present, set based on POD hostname
    if [[ -f "/bitnami/zookeeper/data/myid" ]]; then
        export ZOO_SERVER_ID="$(cat /bitnami/zookeeper/data/myid)"
    else
        HOSTNAME="$(hostname -s)"
        if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
            ORD=${BASH_REMATCH[2]}
            export ZOO_SERVER_ID="$((ORD + 1 ))"
        else
            echo "Failed to get index from hostname $HOST"
            exit 1
        fi
    fi
    exec /entrypoint.sh /run.sh
---
# Source: zookeeper/templates/svc-headless.yaml
apiVersion: v1
kind: Service
metadata:
  name: zookeeper-headless
  namespace: dubbo-system
  labels:
    app.kubernetes.io/name: zookeeper
    helm.sh/chart: zookeeper-11.1.6
    app.kubernetes.io/instance: zookeeper
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: zookeeper
spec:
  type: ClusterIP
  clusterIP: None
  publishNotReadyAddresses: true
  ports:
    - name: tcp-clientgen
      port: 2181
      targetPort: clientgen
    - name: tcp-follower
      port: 2888
      targetPort: follower
    - name: tcp-election
      port: 3888
      targetPort: election
  selector:
    app.kubernetes.io/name: zookeeper
    app.kubernetes.io/instance: zookeeper
    app.kubernetes.io/component: zookeeper
---
# Source: zookeeper/templates/svc.yaml
apiVersion: v1
kind: Service
metadata:
  name: zookeeper
  namespace: dubbo-system
  labels:
    app.kubernetes.io/name: zookeeper
    helm.sh/chart: zookeeper-11.1.6
    app.kubernetes.io/instance: zookeeper
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: zookeeper
spec:
  type: ClusterIP
  sessionAffinity: None
  ports:
    - name: tcp-clientgen
      port: 2181
      targetPort: clientgen
      nodePort: null
    - name: tcp-follower
      port: 2888
      targetPort: follower
    - name: tcp-election
      port: 3888
      targetPort: election
  selector:
    app.kubernetes.io/name: zookeeper
    app.kubernetes.io/instance: zookeeper
    app.kubernetes.io/component: zookeeper
---
# Source: zookeeper/templates/statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: zookeeper
  namespace: dubbo-system
  labels:
    app.kubernetes.io/name: zookeeper
    helm.sh/chart: zookeeper-11.1.6
    app.kubernetes.io/instance: zookeeper
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/component: zookeeper
    role: zookeeper
spec:
  replicas: 1
  podManagementPolicy: Parallel
  selector:
    matchLabels:
      app.kubernetes.io/name: zookeeper
      app.kubernetes.io/instance: zookeeper
      app.kubernetes.io/component: zookeeper
  serviceName: zookeeper-headless
  updateStrategy:
    rollingUpdate: {}
    type: RollingUpdate
  template:
    metadata:
      annotations:
      labels:
        app.kubernetes.io/name: zookeeper
        helm.sh/chart: zookeeper-11.1.6
        app.kubernetes.io/instance: zookeeper
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/component: zookeeper
    spec:
      serviceAccountName: default

      affinity:
        podAffinity:

        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app.kubernetes.io/name: zookeeper
                    app.kubernetes.io/instance: zookeeper
                    app.kubernetes.io/component: zookeeper
                topologyKey: kubernetes.io/hostname
              weight: 1
        nodeAffinity:

      securityContext:
        fsGroup: 1001
      initContainers:
      containers:
        - name: zookeeper
          image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/bitnami/zookeeper:3.8.1-debian-11-r18
          imagePullPolicy: "IfNotPresent"
          securityContext:
            allowPrivilegeEscalation: false
            runAsNonRoot: true
            runAsUser: 1001
          command:
            - /scripts/setup.sh
          resources:
            limits: {}
            requests:
              cpu: 250m
              memory: 256Mi
          env:
            - name: BITNAMI_DEBUG
              value: "false"
            - name: ZOO_DATA_LOG_DIR
              value: ""
            - name: ZOO_PORT_NUMBER
              value: "2181"
            - name: ZOO_TICK_TIME
              value: "2000"
            - name: ZOO_INIT_LIMIT
              value: "10"
            - name: ZOO_SYNC_LIMIT
              value: "5"
            - name: ZOO_PRE_ALLOC_SIZE
              value: "65536"
            - name: ZOO_SNAPCOUNT
              value: "100000"
            - name: ZOO_MAX_CLIENT_CNXNS
              value: "60"
            - name: ZOO_4LW_COMMANDS_WHITELIST
              value: "srvr, mntr, ruok"
            - name: ZOO_LISTEN_ALLIPS_ENABLED
              value: "no"
            - name: ZOO_AUTOPURGE_INTERVAL
              value: "0"
            - name: ZOO_AUTOPURGE_RETAIN_COUNT
              value: "3"
            - name: ZOO_MAX_SESSION_TIMEOUT
              value: "40000"
            - name: ZOO_SERVERS
              value: zookeeper-0.zookeeper-headless.dubbo-system.svc.cluster.local:2888:3888::1
            - name: ZOO_ENABLE_AUTH
              value: "no"
            - name: ZOO_ENABLE_QUORUM_AUTH
              value: "no"
            - name: ZOO_HEAP_SIZE
              value: "1024"
            - name: ZOO_LOG_LEVEL
              value: "ERROR"
            - name: ALLOW_ANONYMOUS_LOGIN
              value: "yes"
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
          ports:
            - name: clientgen
              containerPort: 2181
            - name: follower
              containerPort: 2888
            - name: election
              containerPort: 3888
          livenessProbe:
            failureThreshold: 6
            initialDelaySeconds: 30
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 5
            exec:
              command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok']
          readinessProbe:
            failureThreshold: 6
            initialDelaySeconds: 5
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 5
            exec:
              command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok']
          volumeMounts:
            - name: scripts
              mountPath: /scripts/setup.sh
              subPath: setup.sh
            - name: data
              mountPath: /bitnami/zookeeper
      volumes:
        - name: scripts
          configMap:
            name: zookeeper-scripts
            defaultMode: 0755
        - name: data
          emptyDir: {}
