Amazon EKS

MAP Tagging Instructions for Amazon EKS

Migration tracking for Amazon EKS will continue to rely on the existing MAP 2.0 tagging process. The tag-key and tag-value will be same as the standard MAP tags as detailed in the MAP Tagging Instruction Guide.

Since Amazon EKS potentially launches multiple AWS services, all of the resources and services launched by Amazon EKS should be tagged. The below guide gives detailed instructions on how to tag all of the Amazon EKS resources correctly.

EKS does not propagate tags as of now. The instructions detailed below are required as an alternate solution until EKS supports tag propagation.

While Kubernetes API allows multiple resource types to be defined from within the context of a cluster, AWS models these resources as internal to the cluster if the resource cannot be shared across multiple clusters or AWS resources. Pricing is based on Amazon EKS cluster hours and the following internal cluster resources:

  1. Nodes (EC2 instances) : EKS managed nodes or self managed nodes
  2. Load Balancers -Application load balancer (ALB) or network load balancer (NLB)
  3. EBS Volumes

In order to apply tags to the Kubernetes cluster itself and all the paid internal cluster resources such as nodes, load balancers and EBS volumes follow the instructions below.

Tagging the Kubernetes cluster

Tags can be added to new or existing Kubernetes clusters using the Amazon EKS console,eksctl, AWS CLI, AWS API, or infrastructure-as-a-code tools.

  • For new clusters, during cluster creation, apply tags to a new cluster using the tags parameter on the CreateCluster API action
  • For existing clusters, tags can be applied using the TagResourceAPI.
  • When using the Amazon EKS console, then tags can be applied to new or existing clusters by using the Tags tab for the cluster.
  • When using infrastructure-as-a-code tools, please refer to the respective tool documentation on how to tag Amazon EKS.For instance -if the tool is Terraform, use the tags argument while creating an EKS cluster. To learn more about adding tags using Terraform, visit here.

Tagging the nodes

Tagging nodes within a nodegroup -Amazon EKS cluster can schedule pods on any combination of self-managed nodes and EKS managed nodes. To make sure managed nodes or self managed nodes are tagged properly,follow the instructions below

  • Managed nodes: In order to tag nodes in a managed node group, use a custom launch template. Use the TagSpecificationparameter of the launch template to specify tags to apply to nodes (EC2 instances) in their node group. To learn more about specifying tags visit here. Managed node group can be launched with a custom launch templateusing the EKS API, AWS CLI, CloudFormation, or the EKS Console. To learn more visit here.
  • Self managed nodes: Tags can be applied to self managed nodes by creating a node group with eksctl using the tags parameter. Tags will be applied to all EC2 instances created as a part of the self managed nodegroup creation.Tags can also be applied to self-managed nodes using the AWS Management Console, to learn more visit here.

Tagging Load Balancers

The AWS Load balancer controller manages AWS Elastic Load Balancers for a Kubernetes cluster. The controller provisions

  • Application Load Balancer (ALB): The controller triggers the creation of an ALB when you create a Kubernetes Ingress. In order to tag ALB’s, add the annotation alb.ingress.kubernetes.io/tags on the ALB Ingress controller to specify any additional tags that should be applied to ALB’s created. To learn more about tags annotation visit here. To learn more about setting up an Application load balancing EKS, visit here.
  • Network load balancer (NLB): The controller triggers the creation of a NLB when you create a Kubernetes Service of type LoadBalancer using IP targets. To learn more, visit here. In order to tag the network load balancers, add the annotation service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags to the network load balancer during creation. To learn more, visit here. For more information about using a network load balancer on EKS, visit here.

Tagging EBS volumes

The Amazon EBS Container Storage Interface (CSI) driver provides a CSI interface that allows Amazon EKS clusters to manage the lifecycle of EBS volumes. To add tags to the dynamically provisioned EBS volumes, use the command option –extra-tags in the CSI driver. For detailed instructions visit the documentation.

AWS Fargate on EKS

AWS Fargate with Amazon EKS is not included on the MAP 2.0 Services List

References

The tagging instructions are also available in the EKS documentation