Addon secret generation for CNI and CPI does not complete in Tanzu Kubernetes Grid 1.3.x
search cancel

Addon secret generation for CNI and CPI does not complete in Tanzu Kubernetes Grid 1.3.x

book

Article ID: 317055

calendar_today

Updated On:

Products

Tanzu Kubernetes Grid VMware Tanzu Kubernetes Grid 1.x

Issue/Introduction

Symptoms:
  • You have upgraded Tanzu Kubernetes Grid (TKG) 1.2.x management/workload clusters to 1.3.x.
  • After the upgrade, you follow the steps for registering the add-ons as noted in Register Core Add-ons
  • You see that the CNI and CPI add-on secret manifests are not generated when running the tanzu cluster create command with the --dry-run option.


Environment

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

Resolution

This is a known issue affecting TKG 1.3.x after upgrading from TKG 1.2.x. There is currently no resolution. 

Workaround:

Register the CNI add-on:

  1. Create a directory for taking the overlay files backup by issuing the following command:

mkdir ~/.tanzu/addon_overlay_backup

  1. Take a backup of the file ~/.tanzu/tkg/providers/ytt/02_addons/cni/add_cni.yaml file by issuing the following command:

cp ~/.tanzu/tkg/providers/ytt/02_addons/cni/add_cni.yaml ~/.tanzu/addon_overlay_backup

  1. Open the ~/.tanzu/tkg/providers/ytt/02_addons/cni/add_cni.yaml file with a text editor.
  2. Find the following line: 

#@ if data.values.PROVIDER_TYPE != "tkg-service-vsphere" and not data.values.FILTER_BY_ADDON_TYPE:

and replace it with 

#@ if data.values.PROVIDER_TYPE != "tkg-service-vsphere":

  1. Save and close the file.
  2. Follow the steps noted in Register Core Add-ons to complete the registration of the CNI add-on.
Note: This process is needed for the management and workload clusters.

Register the CPI add-on:

  1. Take a backup of the ~/.tanzu/tkg/providers/ytt/02_addons/cpi/cpi_secret_crs.yaml file by issuing the following command:

cp ~/.tanzu/tkg/providers/ytt/02_addons/cpi/cpi_secret_crs.yaml ~/.tanzu/addon_overlay_backup

  1. Open the ~/.tanzu/tkg/providers/ytt/02_addons/cpi/cpi_secret_crs.yaml file with a text editor.
  2. Find the following line

#@ if data.values.PROVIDER_TYPE == "vsphere" and data.values.TKG_CLUSTER_ROLE != "workload" and not data.values.FILTER_BY_ADDON_TYPE:

and replace it with 

#@ if data.values.PROVIDER_TYPE == "vsphere" and data.values.TKG_CLUSTER_ROLE != "workload":

  1. Save and close the file.
  2. Follow the steps noted in Register Core Add-ons to complete the registration of the CPI add-on.

Note: This process is only needed for the management cluster.



Important Note: Once the CNI and CPI add-ons are registered for the management and workload clusters, make sure to revert the overlay files from the backup location taken in the very first step for each add-on type.