Start EKS kubernetes with eksctl

Start EKS kubernetes with eksctl

Lets start with our AWS EKS cluster creation,

Prerequisites

Before starting this tutorial, you must install and configure the following tools and resources that you need to create and manage an Amazon EKS cluster.

  • kubectl – A command line tool for working with Kubernetes clusters. For more information, see Installing or updating kubectl.
  • eksctl – A command line tool for working with EKS clusters that automates many individual tasks. For more information, see Installation in the eksctl documentation.
  • AWS cli: A command line tool for working with aws cli, For more information, see awscli in the aws documentation.
  • Configure AWS Credentials : Make sure you have your AWS credentials configured either through environment variables or AWS CLI configuration. You'll need the necessary IAM permissions to create EKS clusters.

use the aws credentials, access key and secret key

  • You must complete all steps in this guide as the same user. To check the current user, run the following command:

aws sts get-caller-identity        

Step 1: Create your Amazon EKS cluster and nodes

Create your Amazon EKS cluster with the following command. You can replace my-cluster with your own value. The name can contain only alphanumeric characters (case-sensitive) and hyphens. It must start with an alphabetic character and can't be longer than 100 characters. Replace region-code with any AWS Region that is supported by Amazon EKS. For a list of AWS Regions:

eksctl create cluster --name my-cluster --region=us-east-2 --node-type=t2.medium --nodes=2        


Cluster creation takes several minutes. During creation you'll see several lines of output.

eksctl created a kubectl config file in ~/.kube or added the new cluster's configuration within an existing config file in ~/.kube on your computer.

After cluster creation is complete, view the AWS CloudFormation stack named eksctl-my-cluster-cluster in the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation to see all of the resources that were created.

Step 2: View Kubernetes resources

  • View your cluster nodes.

kubectl get nodes         
output of above command

  • View all the pods and services.

kubectl get all -A        
output of above command, Include services and pod.

Step 3: Delete your cluster and nodes

After you've finished with the cluster and nodes that you created for this tutorial, you should clean up by deleting the cluster and nodes with the following command

eksctl delete cluster --name my-cluster --region=us-east-2        

Conclusion

In conclusion, using this steps we will able to create cluster and if you want to do clean up we can use step 3.


要查看或添加评论,请登录

Pritam Khergade的更多文章

社区洞察

其他会员也浏览了