terraform

terraform has all infraestructure as code for the entire stack.

How do I get set up?

  • Install terraform here
  • Install AWS CLI here
  • Configusre your AWS Profile here
  • Install kubectl here

Review the changes to apply.

Navigate to root of the module

cd roots/backend
terraform plan

Apply the changes

terraform apply

How to destroy the changes

NOTE: this destroys everything including data.

terraform destroy

Kubernetes deployment.

All deployment of this project are made with the terraform kubernetes module instead of manually.

To use the kubectl command line tool you need to configure it to point at the cluster.

aws eks --region us-east-1 update-kubeconfig --name main_cluster

How to view all deployments

kubectl get deployment --all-namespaces

By namespace

kubectl get deployment -n namespace

How to view all pods

kubectl get pods --all-namespaces

You can use this to see pods that might not be running or that have been crashing and restarting.

by namespace

kubectl get pods -n namespace

How to restart a deployment

After making changes to the code and generating the new docker image you can use the following comand to update the container.

kubectl rollout restart deploy name_of_deployment