TMC: Error when moving tags from cluster to nodepool level in EKS
search cancel

TMC: Error when moving tags from cluster to nodepool level in EKS

book

Article ID: 382467

calendar_today

Updated On:

Products

VMware Tanzu Mission Control Tanzu Mission Control Tanzu Mission Control Prepaid Commitment Plan per Core

Issue/Introduction

  • When trying to move cluster tags from being cluster-level tags to nodepool-level tags, terraform complains that the tags should not be the same as cluster tags.

NOTE: Even when you modify the terraform state file to remove the tags, when you run a terraform plan, it will detect the tags as new tags "to change".

 

However, terraform will still report the same error as below:

 

Error: Nodepool tags should not be same as cluster tags: key:tag_name, val:tag_value
│ 
│   with module.k8s-clusters.tanzu-mission-control_ekscluster.your-cluster-name[0],
│   on modules/clusters/your-cluster-nae.tf line 2, in resource "tanzu-mission-control_ekscluster" "your-cluster-name":
│    2: resource "tanzu-mission-control_ekscluster" "your-cluster-name" {

 

  • If you remove all the tags from the terraform file and run a terraform plan, it will show no changes. 

    NOTE: Adding cluster tags will show the result in a plan showing the tags to add, but then a terraform apply errors out the same error as above, even though cluster tags are not being defined.

Environment

TMC SaaS version

Kubernetes cluster running in EKS.

EKS cluster attached to TMC SaaS

Cause

Resolution

The workaround for this is:

  1. When removing tags from cluster level do not remove the entire tag section instead keep tags = { }

        Example: Cluster level tags "before" removal:

            ~ tags            = {
                + "Application"  = "Tanzu Kubernetes"
                + "Name"         = "my-app-name"
                + "b_costcenter" = "some-id"
                + "b_env"        = "env-name"
                + "b_module"     = "some-module-name"
                + "b_program"    = "my-program-name"
                + "b_role"       = "some-role-name"
                + "b_service"    = "some-svc-name"
              }


        Example: Cluster level tags "after" removal:

            ~ tags = { }


  2. And then run: terraform apply

  3. Now add any tags at your nodepool level and run: terraform apply.

Additional Information

This bug is expected to be resolved in December of 2024.