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
Copy file name to clipboardexpand all lines: examples/eks_managed_node_group/README.md
+30
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,33 @@ Configuration in this directory creates an AWS EKS cluster with various EKS Mana
12
12
13
13
See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) for further details.
14
14
15
+
## Container Runtime & User Data
16
+
17
+
When using the default AMI provided by the EKS Managed Node Group service (i.e. - not specifying a value for `ami_id`), users should be aware of the limitations of configuring the node bootstrap process via user data. Due to not having direct access to the bootrap.sh script invocation and therefore its configuration flags (this is provide by the EKS Managed Node Group service in the node user data), a work around for ensuring the appropriate configuration settings is shown below. The following example shows how to inject configuration variables ahead of the merged user data provided by the EKS Managed Node Group service as well as how to enable the containerd runtime using this approach. More details can be found [here](https://github.com/awslabs/amazon-eks-ami/issues/844).
18
+
19
+
```hcl
20
+
...
21
+
# Demo of containerd usage when not specifying a custom AMI ID
22
+
# (merged into user data before EKS MNG provided user data)
23
+
containerd = {
24
+
name = "containerd"
25
+
26
+
# See issue https://github.com/awslabs/amazon-eks-ami/issues/844
27
+
pre_bootstrap_user_data = <<-EOT
28
+
#!/bin/bash
29
+
set -ex
30
+
cat <<-EOF > /etc/profile.d/bootstrap.sh
31
+
export CONTAINER_RUNTIME="containerd"
32
+
export USE_MAX_PODS=false
33
+
export KUBELET_EXTRA_ARGS="--max-pods=110"
34
+
EOF
35
+
# Source extra environment variables in bootstrap script
36
+
sed -i '/^set -o errexit/a\\nsource /etc/profile.d/bootstrap.sh' /etc/eks/bootstrap.sh
37
+
EOT
38
+
}
39
+
...
40
+
```
41
+
15
42
## Usage
16
43
17
44
To run this example you need to execute:
@@ -63,6 +90,9 @@ Note that this example may create resources which cost money. Run `terraform des
0 commit comments