This deployment guide shows you how to set up an Amazon Elastic Kubernetes Engine (EKS) cluster on which Coder can deploy.
Please make sure that you have the following utilities installed on your machine:
- AWS command-line interface (you'll also need to configure the command-line interface to interact with your AWS account; consider AWS' CLI configuration quickstart to fast-track this process
- eksctl command-line utility
While flags can be passed to
eksctl create cluster, the following example uses
eksctl configuration file to define the
The cluster name, region, and SSH key path will be specific to your installation.
apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: coder-trial-cluster region: us-east-1 managedNodeGroups: - name: managed-ng-1 instanceType: t2.medium amiFamily: Ubuntu2004 desiredCapacity: 1 minSize: 1 maxSize: 2 volumeSize: 100 ssh: allow: true publicKeyPath: ~/.ssh/id_rsa.pub
This example uses
t2.medium instance with 2 nodes which is meant for a small
trial deployment. Depending on your needs, you can choose a
larger size instead. See our
documentation on resources and
requirements for help estimating your cluster size.
If your developers require Docker commands like
docker run, and
docker-composeas part of their development flow, then container-based virtual machines (CVMs) are required. In this case, we recommend using the
Ubuntu2004AMI family, as the
AmazonLinux2AMI family does not meet the requirements for cached CVMs.
Once the file is ready, run the following command to create the cluster:
eksctl create cluster -f cluster.yaml
This process may take ~15-30 minutes to complete since it is creating EC2 instance(s) aka node(s), node pool, a VPC, NAT Gateway, network interface, security group, elastic IP, EKS cluster, namespaces and pods.
By default, EKS creates a
WaitForFirstConsumer. See the Kubernetes docs for more information on this mode. Coder accepts both
When your cluster is ready, you should see the following message:
EKS cluster "YOUR CLUSTER NAME" in "YOUR REGION" region is ready
AWS uses Calico to implement network segmentation and tenant isolation. For production deployments, we recommend Calico to enforce workspace pod isolation; please see Network Policies for more information.
Apply the Calico manifest to your cluster:
kubectl apply -f https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/master/config/master/calico-operator.yaml kubectl apply -f https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/master/config/master/calico-crs.yaml
kubectl get daemonset calico-node --namespace calico-system
Wait for the
calico-nodeDaemonSet to have the number of pods desired in the ready state; this indicates that Calico is working:
NAME DESIRED CURRENT READY UP-TO-DATE ... calico-node 3 3 3 3 ...
To delete the EKS cluster including any installation of Coder, substitute your
cluster name and zone in the following
eksctl command. This will take several
minutes and can be monitored in the CloudFormation stack.
eksctl delete cluster --region=us-east-1 --name=trial-cluster