Preventing automated reversion of default StorageClass
search cancel

Preventing automated reversion of default StorageClass

book

Article ID: 444487

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Management

Issue/Introduction

  • Tanzu Kubernetes Grid (TKGm) workload clusters may automatically revert the storageclass.kubernetes.io/is-default-class annotation from "true" to "false", causing dynamic volume provisioning failures.
  • Execute kubectl get storageclass <sc-name> -o yaml to inspect the metadata.annotations
    storageclass.kubernetes.io/is-default-class: "false"

Environment

TKGm: 2.5.4

Cause

  • The cluster reconciliation controller (kapp-controller) detects a state mismatch between the live StorageClass and the baseline configuration manifest, triggering an automatic revert to the original state.

Resolution

  1. Create a YAML manifest for the StorageClass ensuring storageclass.kubernetes.io/is-default-class is set to "true".

  2. Make sure to use the same storage class name and storage policy name that is currently being used.
  3. Add the annotation kapp.k14s.io/update-strategy: skip to the metadata block to prevent future overwrites.

  4. Delete the current StorageClass: kubectl delete storageclass <sc-name>.

  5. Apply the new manifest: kubectl create -f <filename>.yaml.