| # 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. |
| |
| ## |
| ## ZooKeeper deployment |
| ## |
| |
| ## Define a StatefulSet for ZK servers |
| apiVersion: apps/v1beta1 |
| kind: StatefulSet |
| metadata: |
| name: zk |
| labels: |
| app: heron |
| component: zookeeper |
| spec: |
| serviceName: zookeeper |
| replicas: 1 |
| template: |
| metadata: |
| labels: |
| app: heron |
| component: zookeeper |
| |
| spec: |
| containers: |
| - name: zookeeper |
| image: heron/heron:latest |
| command: ["sh", "-c"] |
| args: |
| - > |
| /opt/zookeeper/scripts/start-zookeeper.sh |
| ports: |
| - containerPort: 2181 |
| name: client |
| - containerPort: 2888 |
| name: server |
| - containerPort: 3888 |
| name: leader-election |
| env: |
| - name: ZOOKEEPER_SERVERS |
| value: zk-0 |
| readinessProbe: |
| exec: |
| command: |
| - "/opt/zookeeper/scripts/zookeeper-ruok.sh" |
| initialDelaySeconds: 5 |
| timeoutSeconds: 5 |
| |
| livenessProbe: |
| exec: |
| command: |
| - "/opt/zookeeper/scripts/zookeeper-ruok.sh" |
| initialDelaySeconds: 15 |
| timeoutSeconds: 5 |
| |
| volumeMounts: |
| - name: datadir |
| mountPath: /heron/data |
| volumes: |
| - name: datadir |
| emptyDir: {} |
| |
| --- |
| |
| ## |
| ## Define the ZooKeeper headless service |
| ## |
| apiVersion: v1 |
| kind: Service |
| metadata: |
| annotations: |
| service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" |
| name: zookeeper |
| labels: |
| app: heron |
| component: zookeeper |
| spec: |
| ports: |
| - port: 2888 |
| name: server |
| - port: 3888 |
| name: leader-election |
| - port: 2181 |
| name: client |
| clusterIP: None |
| selector: |
| app: heron |
| component: zookeeper |