-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Fix custom AMI bootstrap (#1580)
- Loading branch information
1 parent
b177806
commit f198efd
Showing
4 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
#!/bin/bash -e | ||
%{ if length(ami_id) == 0 ~} | ||
|
||
# Allow user supplied pre userdata code | ||
# Set variables directly into bootstrap.sh for default AMI | ||
sed -i '/^KUBELET_EXTRA_ARGS=/a KUBELET_EXTRA_ARGS+=" ${kubelet_extra_args}"' /etc/eks/bootstrap.sh | ||
%{else ~} | ||
|
||
# Set variables for custom AMI | ||
API_SERVER_URL=${cluster_endpoint} | ||
B64_CLUSTER_CA=${cluster_ca} | ||
KUBELET_EXTRA_ARGS='--node-labels=eks.amazonaws.com/nodegroup-image=${ami_id},eks.amazonaws.com/capacityType=${capacity_type}${append_labels} ${kubelet_extra_args}' | ||
%{endif ~} | ||
|
||
# User supplied pre userdata | ||
${pre_userdata} | ||
%{ if length(ami_id) > 0 && ami_is_eks_optimized ~} | ||
|
||
sed -i '/^KUBELET_EXTRA_ARGS=/a KUBELET_EXTRA_ARGS+=" ${kubelet_extra_args}"' /etc/eks/bootstrap.sh | ||
%{ if run_bootstrap_script } | ||
/etc/eks/bootstrap.sh ${cluster_name} | ||
%{ endif } | ||
# Call bootstrap for EKS optimised custom AMI | ||
/etc/eks/bootstrap.sh ${cluster_name} --apiserver-endpoint "$${API_SERVER_URL}" --b64-cluster-ca "$${B64_CLUSTER_CA}" --kubelet-extra-args "$${KUBELET_EXTRA_ARGS}" | ||
%{ endif ~} |