Skip to content

SuyashHashiCorp/consul-aws-eks-terraform

Repository files navigation

consul-aws-eks-terraform

Terraform code to install create EKS cluster using NodeGroup and install Consul on same.

Prerequisites

  1. AWS Account.
  2. aws-cli/
  3. kubectl >= 1.21/
  4. helm >= 3.0/
  5. Understanding of K8s, Helm, and Terraform CLI.

Required Changes to do before Terraform execution

  1. git clone https://github.com/SuyashHashiCorp/consul-aws-eks-terraform.git
    cd consul-aws-eks-terraform
  2. Update the values as per the below table in variables.tf file -

variables changes

Consul Helm values.yaml

You can update the value of values.yaml as per your requirement. You can find the sample under "templates" folder of this repo.

Usage/Examples

To provision the cluster, execute the following commands.

terraform init
terraform plan
terraform apply

Configure kubectl to talk to your cluster

  1. Config kubectl to talk to your EKS cluster
aws eks update-kubeconfig --region <region where you deployed your cluster> --name <your cluster name>
  1. Run the below to verify you are connected to your Kubernetes cluster
kubectl cluster-info

To destroy the cluster,

terraform destroy -auto-approve

To restart the cluster,

terraform apply -auto-approve

Reference URL -

  1. Consul Helm Chart Reference
  2. Consul on Kubernetes Version Compatibility
  3. Consul on Amazon Elastic Kubernetes Service (EKS)

About

This repo is for creating Amazon EKS cluster and install consul using helm via Terraform.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages