TKG cluster upgrade failed as the vSphereMachineTemplate referenced is not topology owned
search cancel

TKG cluster upgrade failed as the vSphereMachineTemplate referenced is not topology owned

book

Article ID: 378144

calendar_today

Updated On:

Products

Tanzu Kubernetes Runtime Tanzu Kubernetes Grid VMware Tanzu Kubernetes Grid VMware Tanzu Kubernetes Grid 1.x VMware Tanzu Kubernetes Grid Management VMware Tanzu Kubernetes Grid Plus VMware Tanzu Kubernetes Grid Plus 1.x

Issue/Introduction

And upgrade of a cluster is initiated but it does not proceed, fails while upgrading the control plane nodes.

The cluster-api objects such as machine, vspheremachine etc are not created and the VM is not cloned in vSphere.

 

A "kubectl describe" on the cluster reports that the Topology reconciliation failed.

error reading current state of the Cluster topology: control plane InfrastructureMachineTemplate object VSphereMachineTemplate/<vSphereMachine Template Name> referenced from cluster Cluster/<Cluster name> is not topology owned

Environment

TKG >=2.2 with class based clusters

Cause

At some stage previously a new vSphereMachineTemplates was created for the Control Plane nodes and the cluster object was updated to use this new template.

vSphereMachineTemplate objects can be added for various reasons including vertically scaling the cluster nodes.

However the new vSphereMachineTemplate is missing the "topology.cluster.x-k8s.io/owned" label.

Resolution

Update the vSphereMachineTemplate object and ensure it has the following labels and annotations:

  annotations:
    cluster.x-k8s.io/cloned-from-groupkind: VSphereMachineTemplate.infrastructure.cluster.x-k8s.io
    cluster.x-k8s.io/cloned-from-name: tkg-vsphere-default-v1.2.0-control-plane
  labels:
    cluster.x-k8s.io/cluster-name: <cluster name>
    topology.cluster.x-k8s.io/owned: ""

 

The annotation values may vary depending on the TKG version.