Giter Club home page Giter Club logo

ldna-redis-high-availability-kluster's Introduction

Dependencies

  • helm (inspired by stable/redis-ha)
  • minikube
  • kubectl

Pre-requisites

kubectl create ns rhak

Deploying

helm install ./src --namespace rhak --set replicas=3

RW into the cluster

# Find the master, it will be 0 unless it's been killed, that's the guarantee of StatefulSets
kubectl exec --namespace=rhak redis-high-availability-kluster-server-${N} -ti -- /bin/sh
redis-cli set food good
# Connected to any node
redis-cli get food

Scaling

helm upgrade ${RELEASE_NAME} ./src --namespace rhak --set replicas=${N}

Disrupting

# Master will be at ambiguous position after being killed
kubectl delete pods/redis-high-availability-kluster-server-${N} -n rhak

Teardown

helm delete ${RELEASE_NAME} --purge

If you want to remove the data you'll need to remove the Persistent Volumes

TODO

  • checklist of the optional extras included

Ideas

  • A bash or kubernetes ecosystem test harness asserting you can kill master or slaves and quorum will reassemble
  • Continuous Integration of this solution

Evaluation

Shortcomings

a) The announce service pattern is used for intra-cluster networking but scaling the StatefulSet does not create a Service, only the Pod/s. This leads to the initialisation failing as the container cannot resolve it's own address within the cluster.

The most immediate "workaround" is to issue updates (scale events) via helm which will in turn use it's templating engine and ensure you have the Service necessary for initialisation to succeed. This is pretty lackluster though, as that creates problems for some of the value propositions kubernetes offers like autoscaling.

If you modified the template to have a "max-replicas" value then you'd have another piece of the infra to worry about it's capacity limit, seems a bit counter intuitive to me.

I'm sure I could modify the approach to address this, but time.

b) Security of this implementation is pretty poor.

ldna-redis-high-availability-kluster's People

Contributors

dombo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.