Giter Site home page Giter Site logo

automation-cockroach-nsxt-lb's Introduction

Cockroach DB NSX-T Load Balancing

Terraform project to set up NSX-T Load Balancing for CockroachDB.

Prerequisites

  • Terraform v0.13+
  • NSX-T 3.1+

Initial Setup

This configured the linux system used to invoke Terraform and create the environment.

Install requirements.

sudo yum -y install git wget unzip

Install Terraform

# Create binary folder
mkdir ${HOME}/bin

# Download the latest stable terraform package
wget `curl -sL https://releases.hashicorp.com/terraform/index.json | jq -r '.versions[].builds[].url' | egrep 'terraform_[0-9]\.[0-9]{1,2}\.[0-9]{1,2}_linux.*amd64' | sort -V | tail -1` -O /tmp/terraform.zip

# Extract
${HOME}/bin && unzip /tmp/terraform.zip

# Remove zip file
rm -f /tmp/terraform.zip

# Add to path
if [[ -z $(grep 'export PATH=${HOME}/bin:${PATH}' ~/.bashrc) ]]; then
  echo 'export PATH=${HOME}/bin:${PATH}' >> ~/.bashrc
   source ~/.bashrc
fi

# Print version
echo "Installed: `${HOME}/bin/terraform version`"

Clone git repository

# Change to home directory
cd ~

# Clone git repository
git clone https://github.com/cleeistaken/automation-cockroach-nsxt-lb.git

Deployment

Create an HTTP monitor

As of version 3.1.1 the Terraform NSX-T provider can import a monitor but lacks the functionality to create. The active HTTP monitor will need to be manually created.

Create a NSX-T HTTP monitor.

Ref.

Initialize Terraform

# Change to Terraform folder
cd ~/automation-cockroach-nsxt-lb/cockroach/terraform/

# Initialize
terraform init

# Create a variables file
cp terraform.tfvars.sample terraform .tfvars 

Configure the environment

Edit terraform.tfvars and update the following mandatory fields.

NSX-T Manager

  • nsxt_manager
  • nsxt_user
  • nsxt_password
  • nsxt_insecure_ssl

Environment

  • nsxt_policy_transport_zone
  • nsxt_policy_tier0_gateway
  • nsxt_policy_edge_cluster
  • nsxt_segment_1_cidr
  • nsxt_policy_lb_virtual_server_ip
  • nsxt_policy_lb_monitor_active_name (the name of the monitor created in step4)

Deploy NSX-T Load Balancer

terraform apply

Validation

Network Topology Before

NSX-T LB Monitors

Network Topology After

NSX-T LB Monitors

Network Topology After

Network diagram with the CocroachDB nodes deployed. NSX-T LB Monitors

automation-cockroach-nsxt-lb's People

Contributors

cleeistaken avatar

Stargazers

Jeff Yanagi avatar Sharan avatar

Watchers

James Cloos avatar  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.