Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 2.63 KB

README.md

File metadata and controls

64 lines (48 loc) · 2.63 KB

Cluster Setup

This has only been tested and run on macOS. If you're trying this out with Linux and Windows you will have to adapt some commands.

Prerequisites

  • AWS CLI to manage AWS resources

    • pip install --upgrade --user awscli
    • aws configure
  • terraform to create a DB on AWS

    • brew install terraformj
  • jq to parse JSON results returned by the AWS CLI

    • brew install jq
  • chronic to suppress output unless there's a non-zero exit code

    • brew install moreutils
  • envsubst to replace environment variables in templates

    • brew install gettext
  • kops to create the Kubernetes cluster

    • brew install kops
  • kubectl to manage Kubernetes resources

    • brew install kubernetes-cli

How does it work?

1. Create Cluster

The first script 1-create-cluster.sh will:

  • Generate a new ssh key for the cluster
  • Create S3 buckets for the cluster configuration
  • Create IAM groups, users and policies for kops
  • Create the Kubernetes cluster with kops
  • Extract the kubeconfig from the new cluster
  • Encrypt the kubeconfig with openssl
  • Upload the encrypted kubeconfig to S3

2. Create Database

The second script 2-create-database.sh will:

  • Set up the Database credentials
  • Create a PostGres database with AWS RDS
  • Create an S3 bucket for the database config
  • Encrypt the terraform DB state with openssl
  • Upload the encrypted terraform DB state to S3
  • Generate a Kubernetes secret for the backend services to be able to connect to the DB

3. Create Services

The third script 3-create-services.sh will: