Home > Mobile >  How to add custom tag to the EKS cluster instance
How to add custom tag to the EKS cluster instance

Time:09-20

I have an eks cluser with a node group and two instances. Is there any way to add custom tag to those two eks cluser instances?

For example, Add custom tagging like Name env application to the ec2 instances present in node group.

Note: Not looking for k8 labels. I am looking for a way to add aws tags to the instances comes under my eks node group.

CodePudding user response:

In general, you would label/ tag the node groups on EkS clusters, so that all nodes under the particular node group are labelled the same, but if you want to label nodes individually, use the below.

*The below should pull up the nodes/instances with existing labels

kubectl get nodes --show-labels


NAME      STATUS    ROLES    AGE     VERSION        LABELS
worker0   Ready     <none>   1d      v1.13.0  ...,kubernetes.io/hostname=worker0

*Label/tag the node as below with new label
kubectl label nodes <your-node-name> disktype=ssd

*Veriy if the nodes have been labelled
kubectl get nodes --show-labels

CodePudding user response:

I am looking for a way to add aws tags to the instances comes under my eks node group.

You can try AWS Console > ASG > [select the node group] > [select the Launch template] > [select the Launch template ID] > Actions > Modify template (Create new version) > Resource Tags

  • Related