Skip to content

winston-li/k8s-zookeeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

k8s-zookeeper: zookeeper cluster of DRAFT on Kubernetes

Docker Repository on Quay

Steps:
  • Build docker image via Quay.io

  • Create kubernetes pods & services

      kubectl create -f zookeeper.yaml [--namespace=xxx]
    
  • Teardown

      ./teardown.sh [--namespace=xxx]
    

Notes:
  • Enable zookeeper cluster nodes' intra communication via 3 services (1 service for 1 pod: zookeeper-1, zookeeper-2, and zookeeper-3)

  • Use "zookeeper" service as a load balancer for clients. It doesn't matter on which zookeeper pod the clients are connected in a zookeeper cluster.

  • Since pod name (== hostname), which is generated by k8s replication controller, won't be fixed, we use "service" name (e.g. zookeeper-1, zookeeper-2, zookeeper-3) rather than hostname in zoo.cfg.

  • Originally, we use an additional zookeeper service for load balancing client communications (port 2181). But after experimented with spark master HA, it seems not work correctly. Therefore, we won't simplify/abstract with an additional layer for zookeeper client communications.

  • Resilience verified OK:

      (1) follower crash: container (docker kill), pod (kubectl delete pods), vm (reboot) 
      (2) leader crash: container (docker kill), pod (kubectl delete pods), vm (reboot)
    
  • Cluster isolation verified OK:

      (1) namespaces under the same user context 
          [current-context: default]
          kubectl create -f zookeeper.yaml --namespace=default
          kubectl create -f zookeeper.yaml --namespace=staging
      (2) namespaces under different user context 
          kubectl config use-context develop
          [current-context: develop]
          kubectl create -f zookeeper.yaml --namespace=develop
      Fully isolated among above 3 namespaces
    

TODO:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages