github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/applications/zookeeper/README.md (about)

     1  # Overview
     2  
     3  This image chooses OpenEBS LocalPV as its persistence storage engine.
     4  
     5  Components included in this image:
     6  
     7  * Three StatefulSet replicas for zookeeper cluster which requests "10Gi" storage.
     8  
     9  ## How to use it
    10  
    11  ZooKeeper can be accessed via port 2181 on the following DNS name from within your cluster:
    12  
    13  ```
    14  my-zookeeper.zookeeper-system.svc.cluster.local
    15  ```
    16  
    17  To connect to your ZooKeeper server run the following commands:
    18  
    19  ```
    20  export POD_NAME=$(kubectl get pods --namespace zookeeper-system -l "app.kubernetes.io/name=zookeeper,app.kubernetes.io/instance=my-zookeeper,app.kubernetes.io/component=zookeeper" -o jsonpath="{.items[0].metadata.name}")
    21  kubectl exec -it $POD_NAME -- zkCli.sh
    22  ```
    23  
    24  To connect to your ZooKeeper server from outside the cluster execute the following commands:
    25  
    26  ```
    27  kubectl port-forward --namespace zookeeper-system svc/my-zookeeper 2181:2181 &
    28  zkCli.sh 127.0.0.1:2181
    29  ```
    30  
    31  ## How to rebuild it use helm
    32  
    33  Kubefile:
    34  
    35  ```shell
    36  FROM registry.cn-qingdao.aliyuncs.com/sealer-apps/openebs-localpv:2.11.0
    37  # add helm repo and run helm install
    38  RUN helm repo add bitnami https://charts.bitnami.com/bitnami
    39  # set persistence.storageClass=local-hostpath, which is provided by base image openebs-localpv:2.11.0.
    40  CMD helm install my-zookeeper --create-namespace --namespace zookeeper-system --set persistence.storageClass=local-hostpath bitnami/zookeeper --version 7.4.2
    41  ```
    42  
    43  run below command to build it
    44  
    45  ```shell
    46  sealer build -t {Your Image Name} -f Kubefile -m cloud .
    47  ```
    48  
    49  More parameters see [official document here](https://artifacthub.io/packages/helm/bitnami/zookeeper).