Kubernetes Profile Name is blank for a cluster in TKGi
search cancel

Kubernetes Profile Name is blank for a cluster in TKGi

book

Article ID: 453681

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition

Issue/Introduction

For each cluster in TKGi, if you run tkgi cluster <cluster-name>, there is a field called "Kubernetes Profile Name"

tkgi cluster example

PKS Version:              1.24.3-build.22
Name:                     example
...
Kubernetes Profile Name:  

This field is populated when you have created a kubernetes profile, and updated the cluster to use it. More details on kubernetes profiles can be found here:

https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-kubernetes-grid-integrated-edition/1-23/tkgi/k8s-profiles.html#-use-a-tkgi-kubernetes-profile

However, it has been observed that after updating a cluster to use a kubernetes profile, the name field remains empty.
In contrast, other clusters using the same profile correctly show the name.

Environment

TKGi

Cause

This is due to the kubernetes profile not being associated with the cluster within the PKS DB. You can validate this with the following steps:

  1. bosh -d pivotal-container-service-xxxx ssh pks-db/0
  2. sudo -i
  3. mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf
  4. use pks;
  5. select uuid from kubernetes_profile where name='<kubernetes-profile-name>';  (This gives us the UUID of the profile)
  6. select name, kubernetes_profile_uuid from cluster where name= 'cluster'; (This should return null, instead of the above UUID)

You should also validate that the cluster is actually using the config provided by the profile, and that it is indeed just the name missing. The exact way of doing this will differ depending on what the profile is configured to apply. One way to check this is to run this command against the BOSH manifest of the cluster:

bosh -d service-instance_xxxx manifest | grep profile

Below is an example of what you might see, that will confirm that the profile is in use:

bosh -d service-instance_bd7d96cb-2d41-4ba5-abb9-7e1d9bc55cc0 manifest | grep profile
        encryption-provider-config: ((/profile/k8s-config-profile-etcd/cd4e1c15-d20c-45f1-8472-adcf4fa4e2be))
      encryption-provider-config: /profile/k8s-config-profile-etcd/cd4e1c15-d20c-45f1-8472-adcf4fa4e2be

Resolution

As the association is just missing from the database entry, the best way to resolve this is to re-run the tkgi update-cluster command with the profile. For example:

tkgi update-cluster <cluster> --kubernetes-profile <profile>

If the profile is already in use, running tkgi update-cluster should just re-set the name and run the errands for that cluster.

Once that is done, you can validate that the name is now displaying correctly:

tkgi cluster example | grep -i "Kubernetes Profile Name"
Kubernetes Profile Name:  profile