Skip to content

Latest commit

 

History

History

README.md

Provision an EKS cluster in AWS

Prerequisites

  1. An AWS account
  2. the AWS CLI v2.7.0/v1.24.0 or newer, installed and configured
  3. AWS IAM Authenticator

Set Your Variables

Uncomment and replace variables in terraform.tfvars with the desired values. Check variables.tf for default values.

Deploy the Cluster

From inside the ./aws directory of this project:

  1. Run terraform init. This will initialize the terraform project.
  2. Run terraform plan. This will perform a dry run and find any problems with your configuration.
  3. Run terraform apply. This will deploy the cluster to AWS. Type 'yes' at the prompt.

It will take a few minutes to deploy the cluster. When finished, you will be greeted with a success message. Next, deploy Sourcegraph.

Manage Your Cluster with Kubectl

To manage your cluster, you can use the kubectl command line tool, which you'll need to configure cluster access for.

  1. Set your env variables:
    export REGION=<region code for your cluster>
    export CLUSTER_NAME=<the name of your cluster on GCP or AWS>
  2. Run the following command:
    aws eks update-kubeconfig --region $REGION --name $CLUSTER_NAME
  3. Run kubectl config current-context to make sure kubectl is pointing to your EKS cluster.

Destroy the Cluster

  1. Run terraform destroy. Answer yes at the prompt.

RDS databases

!!!WARNING these rds instances are insecure and should not be used in production, or with sensitive data. Do not load private repo!!!

To provision seperate RDS databases for each DB run terraform apply -var='create_rds_dbs=true'. For a single RDS instance to be configured with all dbs run terraform apply -var='create_rds_single_db=true'.