# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You 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. --- apiVersion: v1 kind: Service metadata: name: tiny-cluster-zk spec: clusterIP: None ports: - name: zk-client-port port: 2181 - name: zk-fwr-port port: 2888 - name: zk-elec-port port: 3888 selector: zk_cluster: tiny-cluster-zk --- apiVersion: v1 kind: Service metadata: name: tiny-cluster-zk-nodeport spec: type: NodePort ports: - name: zk-service-port nodePort: 30600 port: 2181 protocol: TCP targetPort: 2181 selector: zk_cluster: tiny-cluster-zk --- apiVersion: apps/v1 kind: StatefulSet metadata: labels: zk_cluster: tiny-cluster-zk name: tiny-cluster-zk spec: replicas: 1 selector: matchLabels: zk_cluster: tiny-cluster-zk serviceName: tiny-cluster-zk template: metadata: labels: zk_cluster: tiny-cluster-zk spec: containers: - env: - name: ZOO_SERVERS value: server.0=tiny-cluster-zk-0.tiny-cluster-zk:2888:3888 - name: SERVER_JVMFLAGS value: -Xms256m -Xmx256m image: zookeeper:3.4.13 name: tiny-cluster-zk command: ["/bin/sh"] args: ["-c", "ZOO_MY_ID=$(echo `hostname` | cut -d '-' -f2) /docker-entrypoint.sh zkServer.sh start-foreground"] ports: - containerPort: 2181 name: zk-client-port - containerPort: 2888 name: zk-fwr-port - containerPort: 3888 name: zk-elec-port resources: limits: cpu: 1 memory: 512Mi requests: cpu: 1 memory: 512Mi volumeMounts: - mountPath: /data name: druid-test-zk-data - mountPath: /datalog name: druid-test-zk-data-log volumes: - name: druid-test-zk-data emptyDir: {} - name: druid-test-zk-data-log emptyDir: {}