Delete project tags

This document explains how to delete a tag from Google Distributed Cloud (GDC) air-gapped if you no longer need it for organizing projects. You can delete a tag as long as it's not attached to any projects.

For more information about tags, see Tags overview.

This document is for IT administrators within the platform administrator group, who are responsible for organizing and managing projects in a GDC universe. For more information, see Audiences for GDC air-gapped documentation.

Before you begin

  • To get the permissions that you need to delete a tag from GDC, ask your Organization IAM Admin to grant you the Tag Admin (tag-admin) role.

  • Set an environment variable for the zonal management API server kubeconfig file:

    export KUBECONFIG=MANAGEMENT_API_SERVER
    

    Replace MANAGEMENT_API_SERVER with the path to the kubeconfig file for the zonal management API server. For more information about generating a kubeconfig file for the API server in your targeted zone, see Zonal management API server resources.

  • Make sure that you've already removed the tag from all projects. You cannot delete a tag key-value pair that is still attached to a project.

Delete a tag key-value pair

  1. Delete the tag value:

    kubectl delete tagvalue TAG_VALUE_NAME \
        --kubeconfig ${KUBECONFIG} \
        --namespace g-t-TAG_KEY_NAME
    

    Replace the following:

    • TAG_VALUE_NAME: the name of the tag value to delete.
    • TAG_KEY_NAME: the name of the tag key paired with the tag value. The namespace for the tag value must be set to the system-created tag key management namespace.

    You must delete the tag value before deleting the corresponding tag key.

  2. Delete the tag key:

    kubectl delete tagkey TAG_KEY_NAME \
        --kubeconfig ${KUBECONFIG} \
        --namespace platform
    

    Replace TAG_KEY_NAME with the name of the tag key to delete.

  3. Verify the tag key-value pair is deleted:

    kubectl get tagkey TAG_KEY_NAME \
        --kubeconfig ${KUBECONFIG} \
        --namespace platform
    kubectl get tagvalue TAG_VALUE_NAME \
        --kubeconfig ${KUBECONFIG} \
        --namespace g-t-TAG_KEY_NAME
    

    The output must not return your tag key or tag value.

What's next