Is it possible to add description label to custom kind: StorageClass
?
TL:TR: I have tried number of ways, every time failing with
The StorageClass "azurefile-csi-retain" is invalid: metadata.labels:
Invalid value: "Custom storage class as azurefile-csi with Retain policy":
a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.',
and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345',
regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')
Here are examples I tried to kubectl apply -f mysc.yaml
, none seems accepted by Kubernetes:
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: azurefile-csi-retain
labels:
description: Custom storage class as azurefile-csi with Retain policy
or with well-known label description
kubernetes.io/description: Custom storage class as azurefile-csi with Retain policy
or with variation of it
kubernetes.io/description: |-
Custom storage class as azurefile-csi with Retain policy
or with custom label
example.com/description: |-
Custom storage class as azurefile-csi with Retain policy
Eventually, I ended up with the silly
kubernetes.io/description: Custom-storage-class-as-azurefile-csi-with-Retain-policy
Why StorageClass
does not accept the multi-word description?
Is this intentional or a bug, and should I report it?
Cluster information:
Kubernetes version: 1.25.5
Cloud being used: AKS
Installation method: AKS