Giter Site home page Giter Site logo

active-standby's Introduction

active-standby

This repository provides an example of Kubernetes active/standby deployment solution for HA mission critical applications.

Prerrequisites

The following applications need to be installed. Besides the versions used to test the project.

  • Minikube (1.24.0)
  • Redis (6.2.0)
  • Docker (20.10.8)

Setup

  • Clone or download this repository
  • Create container images
./buildContainers.sh
  • Start minikube with 4 nodes and docker driver
minikube start -n 4 --driver=docker
  • Apply cluster configuration
pushd k8s;                     \
kubectl apply -f rbac.yaml;    \
kubectl apply -f app.yaml;     \
kubectl apply -f service.yaml; \
kubectl apply -f audit.yaml;   \
popd
  • Access the web interface
minikube service app-service

Test fail take over

On the web browser execute start application command:

http://server-address:port/start

the status is now running.

Delete the active pod:

kubectl get pods --show-labels
kubectl delete pod `<name of the active pod>

Wait for the standby pod to take over:

kubectl get pods --show-labels

On the web browser execute state application command:

http://server-address:port/start

Note the state is kept as running but the pod name is different. The standby pod has taken over.

Update label with kubectl

To see the audit function fixing pod state inconsistencies change the standby pod to active.

kubectl label pods --overwrite `<standby pod>` mode=active

Access the kubernetes dashboard

If you are more confortable using UI start the Minikube dashboard:

minikube dashboard

active-standby's People

Contributors

wdmartins 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.