Skip to content

Commit 330cd3c

Browse files
committed
refactor: EKS install guide
1 parent 6eba939 commit 330cd3c

File tree

1 file changed

+28
-93
lines changed

1 file changed

+28
-93
lines changed

setup/kubernetes/aws.md

Lines changed: 28 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description:
55
---
66

77
This deployment guide shows you how to set up an Amazon Elastic Kubernetes
8-
Engine "EKS" cluster on which Coder can deploy.
8+
Engine (EKS) cluster on which Coder can deploy.
99

1010
## Prerequisites
1111

@@ -21,25 +21,22 @@ machine:
2121
to fast-track this process
2222
- [eksctl command-line utility](https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html)
2323

24-
See [Preliminary Steps](#preliminary-steps) and [Node Considerations](#node-considerations) first to familiarize yourself with steps and items before creating a cluster.
25-
2624
## Step 1: Create an EKS cluster
2725

2826
While flags can be passed to `eksctl create cluster`, the following example uses
29-
a configuration yaml file to define an EKS cluster.
27+
an [`eksctl` configuration file](https://eksctl.io/usage/schema/) to define the
28+
EKS cluster.
3029

3130
> The cluster name,
32-
[region](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-regions),
33-
and SSH key path will be specific to your installation so potentially change
34-
them in the yaml file
35-
31+
> [region](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones>.html#concepts-regions),
32+
> and SSH key path will be specific to your installation.
3633
3734
```yaml
3835
apiVersion: eksctl.io/v1alpha5
3936
kind: ClusterConfig
4037

4138
metadata:
42-
name: trial-cluster
39+
name: coder-trial-cluster
4340
region: us-east-1
4441

4542
managedNodeGroups:
@@ -49,49 +46,44 @@ managedNodeGroups:
4946
desiredCapacity: 1
5047
minSize: 1
5148
maxSize: 2
52-
volumeSize: 50
49+
volumeSize: 100
5350
ssh:
5451
allow: true
5552
publicKeyPath: ~/.ssh/id_rsa.pub
5653
```
5754
55+
This example uses `t2.medium` instance with 2 nodes which is meant for a small
56+
trial deployment. Depending on your needs, you can choose a
57+
[larger size](https://aws.amazon.com/ec2/instance-types/) instead. See our
58+
documentation on [resources](../../guides/admin/resources.md) and
59+
[requirements](../requirements.md) for help estimating your cluster size.
60+
61+
Once the file is ready, run the following command to create the cluster:
62+
5863
```console
5964
eksctl create cluster -f cluster.yaml
6065
```
6166

62-
> If your developers require Docker commands like `docker build`, `docker run`, and `docker-compose` as
63-
> part of their development flow, then [container-based virtual machines
64-
> (CVMs)](../../workspaces/cvms.md) are required. `instantType` of `Ubuntu2004`
65-
> is preferred since `AmazonLinux2` does not support caching and the shiftfs
66-
> kernel module in CVM settings.
67+
This process may take ~15-30 minutes to complete since it is creating EC2
68+
instance(s) aka node(s), node pool, a VPC, NAT Gateway, network interface,
69+
security group, elastic IP, EKS cluster, namespaces and pods.
6770

68-
This example uses `t2.medium` instance with 2 nodes which is meant for a small deployment to trial Coder. Depending on
69-
your needs, you can choose a
70-
[larger size](https://aws.amazon.com/ec2/instance-types/) instead. See
71-
[requirements](../requirements.md) for help estimating your cluster size.
71+
> By default, EKS creates a `volumeBindingMode` of `WaitForFirstConsumer`. See the
72+
> [Kubernetes docs](https://kubernetes.io/docs/concepts/storage/storage-classes/#volume-binding-mode)
73+
> for more information on this mode. Coder accepts both `Immediate` and `WaitForFirstConsumer`.
7274

7375
When your cluster is ready, you should see the following message:
7476

7577
```console
7678
EKS cluster "YOUR CLUSTER NAME" in "YOUR REGION" region is ready
7779
```
7880

79-
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.
80-
81-
> EKS creates a `volumeBindingMode` of `WaitForFirstConsumer`. See the
82-
> [Kubernetes
83-
> docs](https://kubernetes.io/docs/concepts/storage/storage-classes/#volume-binding-mode)
84-
> for more information. Coder accepts both `Immediate` and
85-
> `WaitForFirstConsumer`.
86-
87-
8881
## Step 2: (Optional) Install Calico onto your cluster
8982

90-
AWS uses
91-
[Calico](https://docs.amazonaws.cn/en_us/eks/latest/userguide/calico.html) to
92-
implement network segmentation and tenant isolation. For production deployments,
93-
we recommend Calico to enforce workspace pod isolation; please see [Network
94-
Policies](../requirements.md#network-policies) for more information.
83+
AWS uses [Calico](https://docs.amazonaws.cn/en_us/eks/latest/userguide/calico.html)
84+
to implement network segmentation and tenant isolation. For production deployments,
85+
we recommend Calico to enforce workspace pod isolation; please see [Network Policies](../requirements.md#network-policies)
86+
for more information.
9587

9688
1. Apply the Calico manifest to your cluster:
9789

@@ -116,71 +108,14 @@ Policies](../requirements.md#network-policies) for more information.
116108

117109
## Cleanup | Delete EKS cluster
118110

119-
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.
111+
To delete the EKS cluster including any installation of Coder, substitute your
112+
cluster name and zone in the following `eksctl` command. This will take several
113+
minutes and can be monitored in the CloudFormation stack.
120114

121115
```console
122116
eksctl delete cluster --region=us-east-1 --name=trial-cluster
123117
```
124118

125-
## Preliminary steps
126-
127-
Before you can create a cluster, you'll need to perform the following to set up
128-
and configure your AWS account.
129-
130-
1. Go to AWS' [EC2 console](https://console.aws.amazon.com/ec2/); this should
131-
take you to the EC2 page for the AWS region in which you're working (if not,
132-
change to the correct region using the dropdown in the top-right of the page)
133-
1. In the **Resources** section in the middle of the page, click **Key Pairs**.
134-
1. Click **Create key pair** (alternatively, if you already have a local SSH key
135-
you'd like to use, you can click the Actions dropdown and import your key)
136-
1. Provide a **name** for your key pair and select **pem** as your **file
137-
format**. Click **Create key pair**.
138-
1. You'll automatically download the keypair; save it to a known directory on
139-
your local machine (we recommend keeping the default name, which will match
140-
the name you provided to AWS).
141-
1. Now that you have the `.pem` file, extract the public key portion of the
142-
keypair so that you can use it with the eksctl CLI in later steps:
143-
144-
```sh
145-
ssh-keygen -y -f <PATH/TO/KEY>.pem >> <PATH/TO/KEY/KEY>.pub
146-
```
147-
148-
**Note**: if you run into a bad permissions error, run `sudo` before the
149-
command above.
150-
151-
When done, you should have a .pem and .pub file for the same keypair you
152-
downloaded from AWS.
153-
154-
## Node Considerations
155-
156-
The node type and size that you select impact how you use Coder. When choosing,
157-
be sure to account for the number of developers you expect to use Coder, as well
158-
as the resources they need to run their workspaces. See our guide on on
159-
[compute resources](../../guides/admin/resources.md) for additional information.
160-
161-
If you expect to provision GPUs to your Coder workspaces, you **must** use an
162-
EC2 instance from AWS'
163-
[accelerated computing instance family](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/accelerated-computing-instances.html).
164-
165-
> GPUs are not supported in workspaces deployed as
166-
> [container-based virtual machines (CVMs)](../../workspaces/cvms.md) unless
167-
> you're running Coder in a bare-metal Kubernetes environment.
168-
169-
## Access control
170-
171-
EKS allows you to create and manage user permissions using IAM identity
172-
providers (IdPs). EKS also supports user authentication via OpenID Connect
173-
(OIDC) identity providers.
174-
175-
Using IAM with Kubernetes' native Role-Based Access Control (RBAC) allows you to
176-
grant access to your EKS cluster using existing IDPs and fine-tune permissions
177-
with RBAC.
178-
179-
For more information, see:
180-
181-
- [AWS identity providers and federation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers.html)
182-
- [Kubernetes RBAC authorization](https://kubernetes.io/docs/reference/access-authn-authz/rbac/)
183-
184119
## Next steps
185120

186121
If you have already installed Coder, you can add this cluster as a [workspace

0 commit comments

Comments
 (0)