I am having one AWS EKS Cluster up & running. I need to add node group with taint. So that I can deploy the pod on particular node group in EKS. I can do it in azure AKS using the following command.
az aks nodepool add --resource-group rg-xx --cluster-name aks-xxx --name np1 --node-count 1 --node-vm-size xxx --node-taints key=value:NoSchedule --no-wait
How to achieve same in AWS EKS?
You can use this example: https://eksctl.io/usage/autoscaling/#scaling-up-from-0
nodeGroups:
- name: ng1-public
...
labels:
my-cool-label: pizza
taints:
feaster: "true:NoSchedule"
if you are using eksctl with managed nodegroups, you can patch the bootstrap script to achieve what you want.
managedNodeGroups:
- name: batch
preBootstrapCommands:
- sed -i '/^KUBELET_EXTRA_ARGS=/a KUBELET_EXTRA_ARGS+=" --register-with-taints=tier=batch:NoSchedule"' /etc/eks/bootstrap.sh
tags:
k8s.io/cluster-autoscaler/node-template/taint/tier: "batch:NoSchedule"
this relies on the code at https://github.com/awslabs/amazon-eks-ami/blob/189baaa77c14120a1b62c42bacced17ba429466b/files/bootstrap.sh#L107 not changing too much.
You can similarly enable the docker network bridge (aka --enable-docker-bridge
)
preBootstrapCommands:
- sed -i 's/^ENABLE_DOCKER_BRIDGE=.*/ENABLE_DOCKER_BRIDGE=true/' bootstrap.sh
The tracking issue for actual EKS support is at https://github.com/aws/containers-roadmap/issues/864, and this solution comes from a comment
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With