Difference between revisions of "Deploy EKS cluster using Terraform"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 58: Line 58:
 
* <code>[[aws eks create-cluster]]</code>
 
* <code>[[aws eks create-cluster]]</code>
 
* <code>[[asg_desired_capacity]]</code>, <code>[[InstanceType]]</code>
 
* <code>[[asg_desired_capacity]]</code>, <code>[[InstanceType]]</code>
* <code>[[kubeadm]]</code>
+
* [[K8s installation]]: <code>[[eksctl create cluster]]</code>
* <code>[[eksctl create cluster]]</code>
 
 
* [[Deploy GKE cluster using Terraform]]
 
* [[Deploy GKE cluster using Terraform]]
 
* <code>[[eks-cluster.tf]]</code> https://github.com/hashicorp/learn-terraform-provision-eks-cluster/blob/main/eks-cluster.tf
 
* <code>[[eks-cluster.tf]]</code> https://github.com/hashicorp/learn-terraform-provision-eks-cluster/blob/main/eks-cluster.tf

Revision as of 07:38, 7 March 2023

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 plan
terraform apply: Terraform EKS apply output
It may take around 15 min

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

2.1) Review EKS cluster created

kubectl get nodes
NAME                                       STATUS   ROLES    AGE     VERSION
ip-10-0-1-29.us-east-2.compute.internal    Ready    <none>   5m31s   v1.23.9-eks-ba74326
ip-10-0-1-47.us-east-2.compute.internal    Ready    <none>   5m21s   v1.23.9-eks-ba74326
ip-10-0-2-121.us-east-2.compute.internal   Ready    <none>   5m13s   v1.23.9-eks-ba74326

3) Review resources:

terraform show | grep -w resource | sort | uniq

4) Configure kubectl

aws eks list-clusters --output text | awk '{print $2}'
aws eks update-kubeconfig --name my-eks-cluster-name

5) Review cluster status/configuration

kubectl cluster-info
kubectl get all -A
Default EKS installation

6) Install your desired addons:

helm install

Related

Activities

See also

Advertising: