Secure CockroachDB Cluster with Flask, inspired by the Digital Ocean tutorial.
Simple 3 node secure CockroachDB cluster with HAProxy acting as load balancer
Prerequisites:
roach-0- CockroachDB noderoach-1- CockroachDB noderoach-2- CockroachDB nodelb- HAProxy acting as load balancerroach-cert- Holds certificates as volume mountsflask- Flask container
If you are using Google Chrome as your browser, you may want to navigate here
chrome://flags/#allow-insecure-localhostand set this flag toEnabled.
start the environment using
docker compose -f docker-compose-secure.yml -f docker-compose-flask.yml up -d --build- monitor the status of services via
docker-compose logs - in case you need to adjust something in composexample/settings.py, you can use
docker-compose logs flask,docker-compose kill flask,docker-compose up -d flaskto debug and proceed.
- visit the CockroachDB UI and login with username
roachand passwordroach - visit the HAProxy UI
- visit the Flask webpage
docker exec -ti roach-0 /bin/bash docker exec -ti roach-1 /bin/bash docker exec -ti roach-2 /bin/bash docker exec -ti lb /bin/sh docker exec -ti roach-cert /bin/sh docker exec -ti client /bin/bash