When it comes to containerized applications, Kubernetes has become an obvious orchestration tool of choice nowadays. If you're learning Kubernetes, and trying to set up a Kubernetes cluster on a local machine use this blog post from AWS. Running Kubernetes on your laptop.
When it comes to a production environment for Kubernetes cluster, we need to ensure zero downtime. Wouldn't it be nice if this was handled and we keep our focus on building applications.
That's where Amazon Elastic Kubernetes Service comes to the rescue!
What does Amazon Elastic Kubernetes Service do?
Amazon Elastic Kubernetes Service (EKS) is a managed Kubernetes service that makes it easy for you to run Kubernetes on AWS and on-premises. With Amazon EKS, you can take advantage of all the performance, scale, reliability, and availability of AWS infrastructure, as well as integrations with AWS networking and security services, such as Application Load Balancers for load distribution, Identity Access Manager (IAM) integration with role-based access control (RBAC), and Virtual Private Cloud (VPC) for pod networking.
There are Prerequisites and considerations to ensure a successful Amazon EKS migration. They are in relation to Security, Networking, Compute Options, Kubernetes Version and Storage. Follow the
Prerequisites and Considerations
Creating VPC for EKS cluster is easy. Follow the link below and use the CloudFormation Template
Creating a VPC for your Amazon EKS cluster
Record the VPC Id, Subnets and Security Group, we need this information in the next step.
The easiest way to create an EKS cluster is via the AWS console. However, you can also use eksctl or aws cli.
Configure Cluster
When you specify networking for your cluster select Cluster Endpoint access option as Public and private which will allow pods to interact with each other and allow you to add services which will be accessible via the outside world.
Configure Logging
Review and Create
Create backup of original config cp ~/.kube/config ~/.kube/config-backup
Cluster provisioning takes several minutes. You can query the status of your cluster with the following command or just check via AWS console. Specify --region param for your newly created cluster.
aws eks --region us-east-1 describe-cluster --name kube-cluster-demo --query "cluster.status"
When your cluster status is ACTIVE, you can proceed to run aws cli command to update kubeconfig for your EKS cluster.
aws eks --region us-east-1 update-kubeconfig --name kube-cluster-demo
Now we need to add some worker nodes to EKS cluster to start running our containers. Use the link below to follow instruction to create managed node group.
You can watch the status of your nodes and wait for them to reach the Ready status before deploying applications.
kubectl get nodes --watch
AWS EKS Workshop not only provides you with basics of Kubernetes but also how to run clusters on EKS.
Running Kubernetes on your laptop helps you set up your laptop for Kubernetes.
Prerequisites and Considerations to perform successful migration