Skip to content

Instantly share code, notes, and snippets.

@identw
Created December 4, 2023 20:08
Show Gist options
  • Save identw/27f14c9fa8a6f19d65a3f9289f3da744 to your computer and use it in GitHub Desktop.
Save identw/27f14c9fa8a6f19d65a3f9289f3da744 to your computer and use it in GitHub Desktop.
data "cloudinit_config" "this" {
base64_encode = true
gzip = false
boundary = "//"
part {
content_type = "text/x-shellscript"
content = <<-EOT
set -x
KUBELET_CONFIG=/etc/kubernetes/kubelet/kubelet-config.json
echo "$(jq ".cpuCFSQuota=false" $KUBELET_CONFIG)" > $KUBELET_CONFIG
max_pods=`/etc/eks/max-pods-calculator.sh --instance-type-from-imds --cni-version 1.10.0 --cni-prefix-delegation-enabled --cni-custom-networking-enabled`
echo "$(jq ".maxPods=$${max_pods}" $KUBELET_CONFIG)" > $KUBELET_CONFIG
/etc/eks/bootstrap.sh ${var.cluster_name} --container-runtime containerd --dns-cluster-ip ${var.node_local_dns_ip} --use-max-pods false
EOT
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment