Customer used uppercase character for the name of a worker and now the guest cluster is in unhealthy state and will not reconcile
Message: error reconciling the Cluster topology: failed to create MachineDeployment: failed to create VSphereMachineTemplate.vmware.infrastructure.cluster.x-k8s.io: FieldValueInvalid: metadata.name: Invalid value: "cluster-worker-xxxx-XXXX-xxxx": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
vCenter Server 8.0
vSphere with Tanzu
TKGS guest Cluster
Customer used uppercase character for the name of a Kubernetes object
As per the Kubernetes documentation: Object Names and IDs
Objects should use a name that can be used as a DNS subdomain name as defined in RFC 1123. This means the name must:
1. Ensure you have a good backup/recovery position.
2. Edit the cluster and change uppercase name to lower case
kubectl edit cluster <cluster-name> -n <cluster-namespace>
3. Trigger a reconcile on the cluster
kubectl patch cluster <cluster-name> -n <cluster-namespace> --type merge -p '{"spec":{"paused": true}}'
kubectl patch cluster <cluster-name> -n <cluster-namespace> --type merge -p '{"spec":{"paused": false}}'
An error similar to below can be seen if there is an additional space in the volume name 'kubelet' in the TKC when deployed from TMC.
* InfrastructureReady: failed to create or update VirtualMachine: failed to create volume namespace/tkgs-cluster-kubelet : PersistentVolumeClaim "tkgs-cluster-kubelet " is invalid: metadata.name: Invalid value: "tkgs-cluster-kubelet ": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*') * NodeHealthy: Waiting for VSphereMachine to report spec.providerID
To fix the issue, edit the TKC from TMC and remove the additional space from the volume name.