EKS cluster setup


Overview

This section provides instructions for setting up the Elastic Kubernetes Serviceexternal link (EKS) for use with the CAST Imaging helm charts installation scripts described in Installation on Amazon Web Services via EKS.

Configure IAM user and permissions

According to Amazon Web Services best practices you should never use your root account for working with AWS services, and instead access should be provided via an IAM user managed in the https://console.aws.amazon.com/iamexternal link. There are two ways to do this:

Attach default AdministratorAccess policy

This method will provides all required permissions, but also gives additional “admin” type permissions:

  • Create a new IAM user in the AWS Console by clicking Create user
  • Use the Attach policies directly option and attach the default AdministratorAccess policy:

Attach custom policies

Use this method if you need to “lock down” the IAM user and grant it only the permissions necessary to operate the EKS cluster. You will need to create two custom policies as follows:

EKS-Admin-policy:

{
   "Version": "2012-10-17",
   "Statement": [
   	{
   		"Effect": "Allow",
   		"Action": [
   			"eks:*"
   		],
   		"Resource": "*"
   	}
   ]
}

CloudFormation-Admin-policy:

{
   "Version": "2012-10-17",
   "Statement": [
   	{
   		"Effect": "Allow",
   		"Action": [
   			"cloudformation:*"
   		],
   		"Resource": "*"
   	}
   ]
}
  • Use the Create policy option to do so:

  • Create a new IAM user in the AWS Console by clicking Create user
  • Use the Attach policies directly option and attach the two custom policies you have just created:

  • Finally, attach the following additional default policies to your IAM user:
    • AmazonEC2FullAccess
    • IAMFullAccess
    • AmazonVPCFullAccess
  • Giving you this result:

Create an IAM role

  • The new role will be automatically called AWSServiceRoleForAmazonEKS.

Create a key pair

Create access key/secret access key

  • Ensure you download the .csv file containing the access key and secret access key.

Setup AWS cli

Setup eksctl

curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp  
	 
sudo mv /tmp/eksctl /usr/local/bin
  • Test the cli is working by running: eksctl version

Install kubectl - commandline K8s tool

Install Helm

Create a new cluster

  • Update fields in ex_eks-mycluster.yaml to match values from your environment, including VPC ID, subnets, EC2 key etc.
  • Create the new cluster by running: eksctl create cluster -f ex_eks-mycluster.yaml

Enable EBS and EFS CSI driver