How to make a persistent label on the Tanzu MIssion Control namespace
search cancel

How to make a persistent label on the Tanzu MIssion Control namespace

book

Article ID: 447556

calendar_today

Updated On:

Products

VMware Tanzu Mission Control

Issue/Introduction

Adding a label to the tmc-local namespace used by Tanzu Mission Control Self-Managed (TMC-SM) gets removed or disappears.

This article provides steps on how to install TMC-SM with custom labels on the tmc-local namespace and ensure that the custom label does not get reverted.

Environment

Tanzu Mission Control Self-Managed (TMC-SM) 1.4.X

Cause

Tanzu Mission Control objects adhere to a defined configuration which routinely reconciles to a desired state.

This results in the system reverting any changes that are made outside of the defined configuration, including a custom label added to the tmc-local namespace.

Resolution

In order for changes such as labels to persist on the tmc-local namespace used by Tanzu Mission Control Self-Managed, the values.yaml must be configured appropriately before installation.

  1. Ensure that the following values are set in the TMC values.yaml configuration file:
    createNamespace: false
    namespace: tmc-local

     

  2. Within the cluster that will be running TMC-SM, create the tmc-local namespace manually:
    kubectl create namespace tmc-local

     

  3. Initiate the TMC-SM install with the values.yaml from Step 1.


  4. Monitor the tmc-local namespace to ensure that it gets the below label and annotation:
    watch kubectl describe namespace tmc-local
    
    apiVersion: v1
    kind: Namespace
    metadata:
      labels:
        pod-security.kubernetes.io/enforce: privileged
      annotations:
        kapp.k14s.io/delete-strategy: orphan
      name: tmc-local

    NOTE: Without the above label and annotation, changes to the tmc-local namespace will be reverted.

  5. Add the desired custom label(s) to the tmc-local namespace


  6. Confirm that the custom label persists:
    kubectl describe namespace tmc-local

 

Additional Information

Tanzu Mission Control - Configuration key values