Skip to content

Commit

Permalink
Merge pull request 2i2c-org#4458 from GeorgianaElena/document-dedicat…
Browse files Browse the repository at this point in the history
…ed-nodepools

[docs] How to do dedicated nodes on aws
  • Loading branch information
GeorgianaElena authored Jul 19, 2024
2 parents 91a5f80 + e11b8e1 commit 9d899a6
Showing 1 changed file with 76 additions and 2 deletions.
78 changes: 76 additions & 2 deletions docs/howto/features/dedicated-nodepool.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Some hubs on shared clusters require dedicated nodepools, for a few reasons:
2. (In the future) Helpful with cost isolation, as we can track how much a
nodepool is costing us.

## GCP
`````{tab-set}
````{tab-item} GCP
:sync: gcp-key
1. Setup a new nodepool in terraform, via the `<cluster-name>.tfvars` for the
cluster. Add the new nodepool to `notebook_nodes`:
Expand Down Expand Up @@ -71,7 +73,79 @@ Some hubs on shared clusters require dedicated nodepools, for a few reasons:
This tells JupyterHub to place user pods from this hub on the nodepool we had
just created!

````
````{tab-item} AWS
:sync: aws-key
1. Setup a new nodepool in eksctl, via the `eksctl/<cluster-name>.jsonnet` for the
cluster. Add the new nodepool to `notebookNodes`:
```
notebookNodes = [
{
{
instanceType: "<type>",
nameSuffix: 'dedicated',
labels+: {
"2i2c.org/community": "<community-name>"
},
tags+: {
"community": "<community-name>"
},
taints+: {
"2i2c.org/community": "<community-name>:NoSchedule"
},
},
}]
```
This sets up a new node with:
1. Kubernetes labels so we can tell the scheduler that user pods of this hub
should come to this nodepool.
2. Kubernetes taints so user pods of *other* hubs will not be scheduled on this
nodepool.
3. AWS tags (unrelated to Kubernetes Labels!) that help us track costs.
The key name here is different from (1) and (2) because it must start with a
letter, and can not contain `/`.
Once done, run:
1. Export the jsonnet to eksctl.yaml
```bash
jsonnet $CLUSTER_NAME.jsonnet > $CLUSTER_NAME.eksctl.yaml
```
2. Create the new nodepool
```bash
eksctl create nodegroup -f $CLUSTER_NAME.eksctl.yaml
```
2. Configure the hub's helm values to use this nodepool, and this nodepool only.
```yaml
jupyterhub:
singleuser:
nodeSelector:
2i2c.org/community: <community-name>
extraTolerations:
- key: 2i2c.org/community
operator: Equal
value: <community-name>
effect: NoSchedule
```
```{note}
If this is a `daskhub`, nest these under a `basehub` key.
```
This tells JupyterHub to place user pods from this hub on the nodepool we had
just created!
````
`````

## Node type and minimum nodepool size considerations

When setting up a dedicated node pool for a hub, particularly a hub supporting
Expand Down

0 comments on commit 9d899a6

Please sign in to comment.