Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Secure CockroachDB Cluster with Flask, inspired by the Digital Ocean tutorial.

Simple 3 node secure CockroachDB cluster with HAProxy acting as load balancer

Prerequisites:

Services

  • roach-0 - CockroachDB node
  • roach-1 - CockroachDB node
  • roach-2 - CockroachDB node
  • lb - HAProxy acting as load balancer
  • roach-cert - Holds certificates as volume mounts
  • flask - Flask container

Getting started

If you are using Google Chrome as your browser, you may want to navigate here chrome://flags/#allow-insecure-localhost and set this flag to Enabled.

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 flask to debug and proceed.
  1. visit the CockroachDB UI and login with username roach and password roach
  2. visit the HAProxy UI
  3. visit the Flask webpage

Open Interactive Shells

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