Difference between revisions of "Deploy EKS cluster using Terraform"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
* Terraform <code>eks</code> module: https://registry.terraform.io/modules/terraform-aws-modules/eks/aws/latest
 
* Terraform <code>eks</code> module: https://registry.terraform.io/modules/terraform-aws-modules/eks/aws/latest
** 21 resources: <code>[[aws_eks_cluster]]</code> ([[Terraform EKS apply output]], [[terraform show (grep resource) in EKS]])
+
** 21 resources: <code>[[aws_eks_cluster]]</code> ([[Terraform EKS apply output]], <code>[[terraform show (grep resource) in EKS|terraform show]]</code> | <code>grep resource</code>)
  
 
== Example ==
 
== Example ==

Revision as of 19:46, 24 May 2022

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 resource) in EKS

Related

Activities

See also

Advertising: