|
1 | | -/* |
2 | | - This file is a jsonnet template of a eksctl's cluster configuration file, |
3 | | - that is used with the eksctl CLI to both update and initialize an AWS EKS |
4 | | - based cluster. |
5 | | -
|
6 | | - This file has in turn been generated from eksctl/template.jsonnet which is |
7 | | - relevant to compare with for changes over time. |
8 | | -
|
9 | | - To use jsonnet to generate an eksctl configuration file from this, do: |
10 | | -
|
11 | | - jsonnet jupyter-health.jsonnet > jupyter-health.eksctl.yaml |
12 | | -
|
13 | | - References: |
14 | | - - https://eksctl.io/usage/schema/ |
15 | | -*/ |
16 | | -local ng = import './libsonnet/nodegroup.jsonnet'; |
17 | | - |
18 | | -// place all cluster nodes here |
19 | | -local clusterRegion = 'us-east-2'; |
20 | | -local masterAzs = ['us-east-2a', 'us-east-2b', 'us-east-2c']; |
21 | | -local nodeAz = 'us-east-2a'; |
22 | | - |
23 | | -// Node definitions for notebook nodes. Config here is merged |
24 | | -// with our notebook node definition. |
25 | | -// A `node.kubernetes.io/instance-type label is added, so pods |
26 | | -// can request a particular kind of node with a nodeSelector |
27 | | -local notebookNodes = [ |
28 | | - // staging |
29 | | - { |
30 | | - instanceType: 'r5.xlarge', |
31 | | - namePrefix: 'nb-staging', |
32 | | - labels+: { '2i2c/hub-name': 'staging' }, |
33 | | - tags+: { '2i2c:hub-name': 'staging' }, |
34 | | - }, |
35 | | - { |
36 | | - instanceType: 'r5.4xlarge', |
37 | | - namePrefix: 'nb-staging', |
38 | | - labels+: { '2i2c/hub-name': 'staging' }, |
39 | | - tags+: { '2i2c:hub-name': 'staging' }, |
40 | | - }, |
41 | | - { |
42 | | - instanceType: 'r5.16xlarge', |
43 | | - namePrefix: 'nb-staging', |
44 | | - labels+: { '2i2c/hub-name': 'staging' }, |
45 | | - tags+: { '2i2c:hub-name': 'staging' }, |
46 | | - }, |
47 | | - // prod |
48 | | - { |
49 | | - instanceType: 'r5.xlarge', |
50 | | - namePrefix: 'nb-prod', |
51 | | - labels+: { '2i2c/hub-name': 'prod' }, |
52 | | - tags+: { '2i2c:hub-name': 'prod' }, |
53 | | - }, |
54 | | - { |
55 | | - instanceType: 'r5.4xlarge', |
56 | | - namePrefix: 'nb-prod', |
57 | | - labels+: { '2i2c/hub-name': 'prod' }, |
58 | | - tags+: { '2i2c:hub-name': 'prod' }, |
59 | | - }, |
60 | | - { |
61 | | - instanceType: 'r5.16xlarge', |
62 | | - namePrefix: 'nb-prod', |
63 | | - labels+: { '2i2c/hub-name': 'prod' }, |
64 | | - tags+: { '2i2c:hub-name': 'prod' }, |
65 | | - }, |
66 | | -]; |
67 | | - |
68 | | -local daskNodes = []; |
69 | | - |
70 | | - |
71 | | -{ |
72 | | - apiVersion: 'eksctl.io/v1alpha5', |
73 | | - kind: 'ClusterConfig', |
74 | | - metadata+: { |
75 | | - name: 'jupyter-health', |
76 | | - region: clusterRegion, |
77 | | - version: '1.32', |
78 | | - tags+: { |
79 | | - ManagedBy: '2i2c', |
80 | | - '2i2c.org/cluster-name': $.metadata.name, |
81 | | - }, |
82 | | - }, |
83 | | - availabilityZones: masterAzs, |
84 | | - iam: { |
85 | | - withOIDC: true, |
86 | | - }, |
87 | | - // If you add an addon to this config, run the create addon command. |
88 | | - // |
89 | | - // eksctl create addon --config-file=jupyter-health.eksctl.yaml |
90 | | - // |
91 | | - addons: [ |
92 | | - { version: 'latest', tags: $.metadata.tags } + addon |
93 | | - for addon in |
94 | | - [ |
95 | | - { name: 'coredns' }, |
96 | | - { name: 'kube-proxy' }, |
97 | | - { |
98 | | - // vpc-cni is a Amazon maintained container networking interface |
99 | | - // (CNI), where a CNI is required for k8s networking. The aws-node |
100 | | - // DaemonSet in kube-system stems from installing this. |
101 | | - // |
102 | | - // Related docs: https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/ |
103 | | - // https://docs.aws.amazon.com/eks/latest/userguide/managing-vpc-cni.html |
104 | | - // |
105 | | - name: 'vpc-cni', |
106 | | - attachPolicyARNs: ['arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy'], |
107 | | - // configurationValues ref: https://github.com/aws/amazon-vpc-cni-k8s/blob/HEAD/charts/aws-vpc-cni/values.yaml |
108 | | - configurationValues: ||| |
109 | | - enableNetworkPolicy: "false" |
110 | | - |||, |
111 | | - }, |
112 | | - { |
113 | | - // aws-ebs-csi-driver ensures that our PVCs are bound to PVs that |
114 | | - // couple to AWS EBS based storage, without it expect to see pods |
115 | | - // mounting a PVC failing to schedule and PVC resources that are |
116 | | - // unbound. |
117 | | - // |
118 | | - // Related docs: https://docs.aws.amazon.com/eks/latest/userguide/managing-ebs-csi.html |
119 | | - // |
120 | | - name: 'aws-ebs-csi-driver', |
121 | | - wellKnownPolicies: { |
122 | | - ebsCSIController: true, |
123 | | - }, |
124 | | - // We enable detailed metrics collection to watch for issues with |
125 | | - // jupyterhub-home-nfs |
126 | | - // configurationValues ref: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/HEAD/charts/aws-ebs-csi-driver/values.yaml |
127 | | - configurationValues: ||| |
128 | | - defaultStorageClass: |
129 | | - enabled: true |
130 | | - controller: |
131 | | - enableMetrics: true |
132 | | - node: |
133 | | - enableMetrics: true |
134 | | - |||, |
135 | | - }, |
136 | | - ] |
137 | | - ], |
138 | | - nodeGroups: [ |
139 | | - n { clusterName: $.metadata.name } |
140 | | - for n in |
141 | | - [ |
142 | | - ng { |
143 | | - namePrefix: 'core', |
144 | | - nameSuffix: 'a', |
145 | | - nameIncludeInstanceType: false, |
146 | | - availabilityZones: [nodeAz], |
147 | | - instanceType: 'r5.xlarge', |
148 | | - minSize: 1, |
149 | | - maxSize: 6, |
150 | | - labels+: { |
151 | | - 'hub.jupyter.org/node-purpose': 'core', |
152 | | - 'k8s.dask.org/node-purpose': 'core', |
153 | | - }, |
154 | | - tags+: { |
155 | | - '2i2c:node-purpose': 'core', |
156 | | - }, |
157 | | - }, |
158 | | - ] + [ |
159 | | - ng { |
160 | | - namePrefix: 'nb', |
161 | | - availabilityZones: [nodeAz], |
162 | | - minSize: 0, |
163 | | - maxSize: 500, |
164 | | - instanceType: n.instanceType, |
165 | | - labels+: { |
166 | | - 'hub.jupyter.org/node-purpose': 'user', |
167 | | - 'k8s.dask.org/node-purpose': 'scheduler', |
168 | | - }, |
169 | | - taints+: { |
170 | | - 'hub.jupyter.org_dedicated': 'user:NoSchedule', |
171 | | - 'hub.jupyter.org/dedicated': 'user:NoSchedule', |
172 | | - }, |
173 | | - tags+: { |
174 | | - '2i2c:node-purpose': 'user', |
175 | | - }, |
176 | | - } + n |
177 | | - for n in notebookNodes |
178 | | - ] + ( |
179 | | - if daskNodes != null then |
180 | | - [ |
181 | | - ng { |
182 | | - namePrefix: 'dask', |
183 | | - availabilityZones: [nodeAz], |
184 | | - minSize: 0, |
185 | | - maxSize: 500, |
186 | | - labels+: { |
187 | | - 'k8s.dask.org/node-purpose': 'worker', |
188 | | - }, |
189 | | - taints+: { |
190 | | - 'k8s.dask.org_dedicated': 'worker:NoSchedule', |
191 | | - 'k8s.dask.org/dedicated': 'worker:NoSchedule', |
192 | | - }, |
193 | | - tags+: { |
194 | | - '2i2c:node-purpose': 'worker', |
195 | | - }, |
196 | | - instancesDistribution+: { |
197 | | - onDemandBaseCapacity: 0, |
198 | | - onDemandPercentageAboveBaseCapacity: 0, |
199 | | - spotAllocationStrategy: 'capacity-optimized', |
200 | | - }, |
201 | | - } + n |
202 | | - for n in daskNodes |
203 | | - ] else [] |
204 | | - ) |
| 1 | +local cluster = import './libsonnet/cluster.jsonnet'; |
| 2 | + |
| 3 | +local c = cluster.makeCluster( |
| 4 | + name='jupyter-health', |
| 5 | + region='us-east-2', |
| 6 | + nodeAz='us-east-2a', |
| 7 | + version='1.34', |
| 8 | + coreNodeInstanceType='r8i-flex.large', |
| 9 | + notebookCPUInstanceTypes=[ |
| 10 | + 'r5.xlarge', |
| 11 | + 'r5.4xlarge', |
| 12 | + 'r5.16xlarge', |
205 | 13 | ], |
206 | | -} |
| 14 | + hubs=['staging', 'prod'], |
| 15 | + nodeGroupGenerations=['b'] |
| 16 | +); |
| 17 | +c |
0 commit comments