1- %{ if use_max_pods == false }
2- # Calculate max pods
3- KUBELET_CONFIG=/etc/kubernetes/kubelet/kubelet-config.json
4- set +o pipefail
5- CNI_VERSION=$(echo "${ cni_version} " | sed 's/^v//')
6- MAX_PODS=$(/etc/eks/max-pods-calculator.sh --instance-type-from-imds \
7- --cni-version $CNI_VERSION \
8- %{ if show_max_allowed } --show-max-allowed%{ endif } \
9- --cni-custom-networking-enabled)
10- set -o pipefail
11- if [[ -n "$MAX_PODS" ]]; then
12- echo "$(jq ".maxPods=$MAX_PODS" $KUBELET_CONFIG)" > $KUBELET_CONFIG
13- else
14- echo "Not able to determine maxPods for instance. Not setting max pods for kubelet"
15- fi
16- %{ endif }
1+ %{ if ami_al2023 == false }
2+ %{ if use_max_pods == false }
3+ # Calculate max pods
4+ KUBELET_CONFIG=/etc/kubernetes/kubelet/kubelet-config.json
5+ set +o pipefail
6+ CNI_VERSION=$(echo "${ cni_version} " | sed 's/^v//')
7+ MAX_PODS=$(/etc/eks/max-pods-calculator.sh --instance-type-from-imds \
8+ --cni-version $CNI_VERSION \
9+ %{ if show_max_allowed } --show-max-allowed%{ endif } \
10+ --cni-custom-networking-enabled)
11+ set -o pipefail
12+ if [[ -n "$MAX_PODS" ]]; then
13+ echo "$(jq ".maxPods=$MAX_PODS" $KUBELET_CONFIG)" > $KUBELET_CONFIG
14+ else
15+ echo "Not able to determine maxPods for instance. Not setting max pods for kubelet"
16+ fi
17+ %{ endif }
1718
18- /etc/eks/bootstrap.sh ${ cluster_name} \
19- --use-max-pods ${ use_max_pods} \
20- --kubelet-extra-args '--node-labels=${ node_labels} --register-with-taints=${ node_taints} ${ kubelet_extra_args} ' \
21- --b64-cluster-ca ${ base64_cluster_ca} \
22- --apiserver-endpoint ${ api_server_url}
19+ /etc/eks/bootstrap.sh ${ cluster_name} \
20+ --use-max-pods ${ use_max_pods} \
21+ --kubelet-extra-args '--node-labels=${ node_labels} --register-with-taints=${ node_taints} ${ kubelet_extra_args} ' \
22+ --b64-cluster-ca ${ base64_cluster_ca} \
23+ --apiserver-endpoint ${ api_server_url}
2324
24- %{ if discard_unpacked_layers == false }
25- # Retain unpacked layers. We avoid using the configuration merge capability of containerd due to a known bug.
26- # For more details, refer to: https://github.com/containerd/containerd/issues/5837
27- sed -i '/discard_unpacked_layers = true/s/true/false/' /etc/containerd/config.toml
28- systemctl restart containerd
29- %{ endif }
25+ %{ if discard_unpacked_layers == false }
26+ # Retain unpacked layers. We avoid using the configuration merge capability of containerd due to a known bug.
27+ # For more details, refer to: https://github.com/containerd/containerd/issues/5837
28+ sed -i '/discard_unpacked_layers = true/s/true/false/' /etc/containerd/config.toml
29+ systemctl restart containerd
30+ %{ endif }
31+ %{ endif }
0 commit comments