EKS helps manage cluster set up and creation. It offers multi-AZ support and provides automatic replacement of failed or nodes. It also enables on-demand patches and upgrades to clusters. EKS automatically creates three master nodes for each cluster, spread out across three availability zones, as illustrated below. This prevents single points of failure and provides high availability out of the box.
Source: Amazon Web Services
A few prerequisites for creating a cluster on EKS:
- Create an AWS account
- Create an IAM role that Kubernetes can use to create new AWS resources
- Create a VPC and security group for your Kubernetes cluster – Amazon strongly recommend creating a separate VPC and security group for each cluster
- Install kubectl – see instructions for installing the Amazon EKS-vended version
- Install the Amazon CLI
To create a Kubernetes cluster using EKS:
- Open the Amazon EKS console and select Create cluster.
- On the Configure cluster page, type a name for your cluster, and select the Kubernetes version – if you don’t have a reason to run a specific version, select the latest.
- Under Cluster service role, select the IAM role you created for EKS.
- The Secrets encryption option lets you encrypt Kubernetes secrets using the AWS Key Management Service (KMS). This is an important option for production deployments, but you can leave it off just for this tutorial. Another option is Tags, which lets you apply tags to your cluster so you can manage multiple Kubernetes clusters together with other AWS resources.
- Click Next to view the Specify networking page. Select the VPC you created previously for EKS. Under Subnets, select which subnets you would like to host Kubernetes resources. Under Security groups, you should see the security group defined when you created the VPC (as defined in the CloudFormation template).
- Under Cluster endpoint access, select Public to enable only public access to the Kubernetes API server, Private to only enable private access from within the VPC, or Public and Private to enable both.
- Select Next to view the Configure logging page and select logs you want to enable (all logs are disabled by default).
- Select Next to view the Review and create page. Have a look at the cluster options you selected you can click Edit to make changes. When you’re ready, click Create. The status field shows the status of the cluster, until provisioning is complete (this can take between 10-15 minutes).
- When the cluster finishes creating, save your API server endpoint and Certificate authority – you will need these to connect to kubectl and work with your cluster.
To learn more, see the EKS getting started guide.