• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to footer

GitopsCentral

  • Home
  • Courses
  • Roadmap
  • About
  • Log In
  • Sign Up

creating kubernetes cluster using eksctl

June 7, 2021 by shaik zillani

In this blog post, I will show you how to install Kubernetes cluster on AWS using eksctl

Create Manifest file

Create a file called cluster.yaml

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: zshaik-cluster
  region: us-east-1

vpc:
  subnets:
    public:
      us-east-1a: { id: subnet-0fdc9e4b09db39551 }
      us-east-1b: { id: subnet-0a0dea9b13c2f97b6 }

nodeGroups:
  - name: zshaik-cluster-ng-1
    instanceType: t3.medium
    desiredCapacity: 3
    ssh:
      allow: true # will use ~/.ssh/id_rsa.pub as the default ssh key

Install using eksctl

eksctl create cluster -f cluster.yaml

After the successful installation, you should see the below log & cluster be accesible via kubeconfig copied to $USER/.kube/config

eksctl create cluster -f cluster.yaml
2021-06-07 11:44:29 [ℹ]  eksctl version 0.43.0
2021-06-07 11:44:29 [ℹ]  using region us-east-1
2021-06-07 11:44:30 [Γ£ö]  using existing VPC (vpc-04943fa8025a5da2f) and subnets (private:map[] public:map[us-east-1a:{subnet-0fdc9e4b09db39551 us-east-1a 192.168.0.0/19} us-east-1b:{subnet-0a0dea9b13c2f97b6 us-east-1b 192.168.96.0/19}])
2021-06-07 11:44:30 [!]  custom VPC/subnets will be used; if resulting cluster doesn't function as expected, make sure to review the configuration of VPC/subnets
2021-06-07 11:44:31 [ℹ]  nodegroup "zshaik-cluster-ng-1" will use "ami-0c29dd87e87fb4dfd" [AmazonLinux2/1.18]
2021-06-07 11:44:31 [ℹ]  using SSH public key "C:\\Users\\zillanis/.ssh/id_rsa.pub" as "eksctl-zshaik-cluster-nodegroup-zshaik-cluster-ng-1-f1:61:2f:15:3d:ec:ac:d2:f3:31:aa:17:56:f4:9c:13"
2021-06-07 11:44:33 [ℹ]  using Kubernetes version 1.18
2021-06-07 11:44:33 [ℹ]  creating EKS cluster "zshaik-cluster" in "us-east-1" region with un-managed nodes
2021-06-07 11:44:33 [ℹ]  1 nodegroup (zshaik-cluster-ng-1) was included (based on the include/exclude rules)
2021-06-07 11:44:33 [ℹ]  will create a CloudFormation stack for cluster itself and 1 nodegroup stack(s)
2021-06-07 11:44:33 [ℹ]  will create a CloudFormation stack for cluster itself and 0 managed nodegroup stack(s)
2021-06-07 11:44:33 [ℹ]  2 sequential tasks: { create cluster control plane "zshaik-cluster", 3 sequential sub-tasks: { wait for control plane to become ready, create addons, create nodegroup "zshaik-cluster-ng-1" } }
2021-06-07 11:44:33 [ℹ]  building cluster stack "eksctl-zshaik-cluster-cluster"
2021-06-07 11:44:35 [ℹ]  deploying stack "eksctl-zshaik-cluster-cluster"
2021-06-07 11:45:05 [ℹ]  waiting for CloudFormation stack "eksctl-zshaik-cluster-cluster"
2021-06-07 11:45:10 [ℹ]  waiting for CloudFormation stack "eksctl-zshaik-cluster-cluster"
2021-06-07 11:56:55 [ℹ]  building nodegroup stack "eksctl-zshaik-cluster-nodegroup-zshaik-cluster-ng-1"
2021-06-07 11:56:55 [ℹ]  --nodes-min=3 was set automatically for nodegroup zshaik-cluster-ng-1
2021-06-07 11:56:55 [ℹ]  --nodes-max=3 was set automatically for nodegroup zshaik-cluster-ng-1
2021-06-07 11:56:56 [ℹ]  deploying stack "eksctl-zshaik-cluster-nodegroup-zshaik-cluster-ng-1"
2021-06-07 11:56:56 [ℹ]  waiting for CloudFormation stack "eksctl-zshaik-cluster-nodegroup-zshaik-cluster-ng-1"
2021-06-07 11:57:13 [ℹ]  waiting for CloudFormation stack "eksctl-zshaik-cluster-nodegroup-zshaik-cluster-ng-1"
2021-06-07 11:57:31 [ℹ]  waiting for CloudFormation stack "eksctl-zshaik-cluster-nodegroup-zshaik-cluster-ng-1"
2021-06-07 11:57:51 [ℹ]  waiting for CloudFormation stack "eksctl-zshaik-cluster-nodegroup-zshaik-cluster-ng-1"
2021-06-07 12:01:17 [ℹ]  waiting for the control plane availability...
2021-06-07 12:01:17 [Γ£ö]  saved kubeconfig as "C:\\Users\\zillanis/.kube/config"
2021-06-07 12:01:17 [ℹ]  no tasks
2021-06-07 12:01:17 [Γ£ö]  all EKS cluster resources for "zshaik-cluster" have been created
2021-06-07 12:01:18 [ℹ]  adding identity "arn:aws:iam::668370897846:role/eksctl-zshaik-cluster-nodegroup-z-NodeInstanceRole-1AODHEVSNPIR8" to auth ConfigMap
2021-06-07 12:01:19 [ℹ]  nodegroup "zshaik-cluster-ng-1" has 1 node(s)
2021-06-07 12:01:19 [ℹ]  node "ip-192-168-98-45.ec2.internal" is not ready
2021-06-07 12:01:19 [ℹ]  waiting for at least 3 node(s) to become ready in "zshaik-cluster-ng-1"
2021-06-07 12:03:23 [ℹ]  nodegroup "zshaik-cluster-ng-1" has 3 node(s)
2021-06-07 12:03:23 [ℹ]  node "ip-192-168-117-115.ec2.internal" is ready
2021-06-07 12:03:23 [ℹ]  node "ip-192-168-20-89.ec2.internal" is ready
2021-06-07 12:03:23 [ℹ]  node "ip-192-168-98-45.ec2.internal" is ready
2021-06-07 12:03:49 [ℹ]  kubectl command should work with "C:\\Users\\zillanis/.kube/config", try 'kubectl get nodes'
2021-06-07 12:03:49 [Γ£ö]  EKS cluster "zshaik-cluster" in "us-east-1" region is ready

 

kubernetes

Primary Sidebar

en English
ar Arabiczh-CN Chinese (Simplified)nl Dutchen Englishfr Frenchde Germanhi Hindiid Indonesianit Italianja Japanesems Malaypt Portugueseru Russianes Spanishte Telugu

Course Tags

concurrency free go golang

Recent Posts

  • Roadmap to Mastery
  • Increase SSH connection timeout
  • Check Certificate expiry in Kubernetes
  • space invaders in golang
  • creating kubernetes cluster using eksctl
  • Facebook
  • GitHub
  • YouTube

Contact

Navigation

  • goacademy pro

Footer

  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

info@gitopscentral.com


+91 8341443220

© Copyright 2016-2024 gitopscentral · All Rights Reserved ·