You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consult [Encrypt K8s secrets with AWS KMS on existing clusters](https://docs.aws.amazon.com/eks/latest/userguide/enable-kms.html) for more information.
139
-
140
134
:::
141
135
142
136
Here is an example of how you would set KMS key ARN in `nebari-config.yaml`.
Nebari supports configuring launch templates for your node groups, enabling you to customize settings like the AMI ID and pre-bootstrap commands. This is particularly useful if you need to use a custom AMI or perform specific actions before the node joins the cluster.
147
+
148
+
:::warning
149
+
If you add a `launch_template` to an existing node group that was previously created without one, AWS will treat this as a change requiring the replacement of the entire node group. This action will trigger a reallocation of resources, effectively destroying the current node group and recreating it. This behavior is due to how AWS handles self-managed node groups versus those using launch templates with custom settings.
150
+
:::
151
+
152
+
:::tip
153
+
To avoid unexpected downtime or data loss, consider creating a new node group with the launch template settings and migrating your workloads accordingly. This approach allows you to implement the new configuration without disrupting your existing resources.
154
+
:::
155
+
156
+
#### Configuring a Launch Template
157
+
158
+
To configure a launch template for a node group in your `nebari-config.yaml`, add the `launch_template` section under the desired node group:
159
+
160
+
```yaml
161
+
amazon_web_services:
162
+
region: us-west-2
163
+
kubernetes_version: "1.18"
164
+
node_groups:
165
+
custom-node-group:
166
+
instance: "m5.large"
167
+
min_nodes: 1
168
+
max_nodes: 5
169
+
gpu: false # Set to true if using GPU instances
170
+
launch_template:
171
+
# Replace with your custom AMI ID
172
+
ami_id: ami-0abcdef1234567890
173
+
# Command to run before the node joins the cluster
174
+
pre_bootstrap_command: |
175
+
#!/bin/bash
176
+
# This script is executed before the node is bootstrapped
177
+
# You can use this script to install additional packages or configure the node
178
+
# For example, to install the `htop` package, you can run:
179
+
# sudo apt-get update
180
+
# sudo apt-get install -y htop"
181
+
```
182
+
183
+
**Parameters:**
184
+
185
+
-`ami_id` (Optional): The ID of the custom AMI to use for the nodes in this group; this assumes the AMI provided is an EKS-optimized AMI derivative. If specified, the `ami_type` is automatically set to `CUSTOM`.
186
+
-`pre_bootstrap_command` (Optional): A command or script to execute on the node before
187
+
it joins the Kubernetes cluster. This can be used for custom setup or configuration
188
+
tasks. The format should be a single string in conformation with the shell syntax.
189
+
This command is injected in the `user_data` field of the launch template. For more
190
+
information, see [User Data](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html).
191
+
192
+
> If you're using a `launch_template` with a custom `ami_id`, there's an issue with updating the `scaling.desired_size` via Nebari configuration (terraform). To scale up, you must recreate the node group or adjust the scaling settings directly in the AWS Console UI (recommended). We are aware of this inconsistency and plan to address it in a future update.
193
+
194
+
:::note
195
+
If an `ami_id` is not provided, AWS will use the default Amazon Linux 2 AMI for the
196
+
specified instance type. You can find the latest optimized AMI IDs for Amazon EKS in your
197
+
cluster region by inspecting its respective SSM parameters. For more information, see
198
+
[Retrieve recommended Amazon Linux AMI IDs](https://docs.aws.amazon.com/eks/latest/userguide/retrieve-ami-id.html).
0 commit comments