Pre-requisites:
AWSCLI
Install kubectl
Install aws-iam-authenticator
step:0 AWS CLI needed to interact with AWS cloud resources. A profile with administrative access should be configured.
step:1 Create Role (for accessing eks cluster create role with AmazonEKSClusterPolicy and
AmazonEKSServicePolicy policies)
Kubernetes clusters managed by Amazon EKS make calls to other AWS services on your behalf to manage the resources that you use with the service. Before you can create Amazon EKS clusters, you must create an IAM role with the following IAM policies:
AmazonEKSClusterPolicy
Note
Prior to April 16, 2020, AmazonEKSServicePolicy was also required and the suggested name was eksServiceRole. With the AWSServiceRoleForAmazonEKS service-linked role, that policy is no longer required.
https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html
step:2 Create VPC by using Cloudformation template
step:3 Create Cluster using AWSCLI
step:4 Update Cluster
step:5 Create nodes for the cluster using Cloudformation template
step:6 Map Nodes to Master
step:7 Check nodes of the cluster
Download 1.14.6 version of kubectl and aws-iam-authenticator
https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html
https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html
https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2019-01-
09/amazon-eks-vpc-sample.yaml
CloudFormation will begin to create the VPC. Once done, be sure to note the various values created ā SecurityGroups, VpcId and SubnetIds. You will need these in subsequent steps.
aws eks create-cluster
–name eks-cluster
–region us-east-1
–role-arn arn:aws:iam::791382328408:role/eks-role
–resources-vpc-config subnetIds=subnet-06e094781818119c9,subnet-02942a18072a8a494,subnet-0d04b795c369cd727,securityGroupIds=sg-047a0533d14aa70bb
status check for eks cluster
—————————-
aws eks –region us-east-1 describe-cluster –name eks-cluster –query cluster.status
update eks cluster
——————
aws eks –region us-east-1 update-kubeconfig –name eks-cluster
cloudformation-worker-node
—————————
https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2019-02-11/amazon-eks-nodegroup.yaml
https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html
ami-0dc7713312a7ec987
To enable worker nodes to join your cluster
——————————————-
curl -o aws-auth-cm.yaml https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2019-02-11/aws-auth-cm.yaml
vi aws-auth-cm.yaml
kubectl apply -f aws-auth-cm.yaml
kubectl get nodes –watch
Deploy nginx image
——————
kubectl run –image=nginx nginx-app –port=80
kubectl expose deployment nginx-app –port=80 –name=nginx-http –type LoadBalancer
source
Thank you very very much for this video. I would rate this video #1. It has solved my three days effort.
Hi Thanks for the video.
I have one question here, when we are using EKS, for example i have 3 pod should always up and running, for some reason my one of the pod went for pending state, when the pod status pending the EKS will provision the new worker node and schedule the pending pod on the new worker node itself?
Can you please help, how to add ssl to this deployed URL
thank you a lot for this infos. for me all steps are OK but in the end when i type kubectl get nodes –watch my cli dont send anythink and when i try kubectl get nodes the respose is "No resources found in default namespace." what is the problem?
awesome video bro
Very useful objective video blog on K8s clustering onAWS by use of EKS.
Thanks for sharing.
i dont understand when inputting create cluster with cli, he said "An error occurred (AccessDeniedException) when calling the CreateCluster operation: User: arn:aws:sts::951216862528:assumed-role/ec2-role-for-eks-cluster/i-02c9 2d5e50c8330a3 is not authorized to perform: eks:CreateCluster on resource: arn:a ws:eks:us-east-1:951216862528:cluster/eks-cluster-demo with an explicit deny
"
what should i do,mr?
hallo mr. im a student and new study kubernetes on aws. i have try setup cluster kubernetes with aws cli. but always error in the create cluster. i have try improve in the role but same result. what should i do? please help me.
Thank u for giving valuables time for solve this, now its working, and tq so much again sir….
Hello sir,using the command kubectl get nodes –watch,i show an error,its said that No resources found in default namespace.
plz solve it
How does the route53 gets managed, is the above setup is enough or should we do anything else.
Thank you for posting this.
Truly deserve applause.Thanks a lot!
All I needed. Thank you š
Thank you for posting this.
Nice work.Ā I keep getting this error when I try the command below. Anyone have an idea to the problem or solution?
kubectl apply -f aws-auth-cm.yamlĀ
Error from server (Forbidden): error when retrieving current configuration of:
Can we create this on free tier aws ?
nice but in final step when i give vi aws-auth-cm.yaml its is saying no resources found in default namespace.please help me i have finished more than 90 percent and stuck at this
HI Vamsi,
Thank you for the Channel.
I am facing below issue when I try to install kubectl
[[email protected] ~]# kubectl version –short –client
/root/bin/kubectl: line 1: 8dd54f7283955b1bd85540b75f374575ea25c57481cdccf1e4547548133acf31: command not found
Nice sir good š.
Nice video.. easy to learn… And it will be more usefull information to devops engineers
Can you please do on a Jenkins ldap integration and automate eks cluster creation using terraform…
Nice broo.. verygood useful to learners
Thanks for the nice video Vamsi
Very well done. Thanks !!!
Nice to see kubernetes video from you Vamsi . Really thanks