Deploy EKS cluster using Terraform

From wikieduonline
Revision as of 19:02, 10 June 2022 by Welcome (talk | contribs)
Jump to navigation Jump to search

Example

0) Download code

git clone https://github.com/hashicorp/learn-terraform-provision-eks-cluster
cd learn-terraform-provision-eks-cluster

1) Execute

terraform init #It may take several minutes
terraform apply
(Terraform EKS apply output)

1.1) Review execution

kubectl get nodes
The connection to the server localhost:8080 was refused - did you specify the right host or port?

2) Update configuration

Update kubeconfig with credentials:
aws eks --region $(terraform output -raw region) update-kubeconfig --name $(terraform output -raw cluster_name)
Added new context arn:aws:eks:us-east-2:XXXXXXX:cluster/myeks-eks-xxxx to /Users/youruser/.kube/config

3) Review resources:

 terraform show | grep -w resource | sort | uniq

4) Configure kubectl

aws eks list-clusters
aws eks update-kubeconfig --name my-eks-cluster-name

Related

Activities

See also

Advertising: