How to specify the kind serviceSubnet in Tanzu Kubernetes Grid
search cancel

How to specify the kind serviceSubnet in Tanzu Kubernetes Grid

book

Article ID: 316943

calendar_today

Updated On:

Products

Tanzu Kubernetes Grid

Issue/Introduction

This article provides the process to edit the deployment of the Tanzu Kubernetes Grid (TKG) kind cluster in the event that the default serviceSubnet is conflicting with current network configuration. The kind cluster is created automatically when the tkg init command is run and is used for bootstrapping the management cluster.

Environment

VMware Tanzu Kubernetes Grid 1.x

Resolution

  1. If not done previously, install the TKG CLI following the most current documentation located here.
  2. Run tkg get management-cluster
  3. Change directory to ~/.tkg/bom
  4. Edit the file bom-1.2.1+vmware.1.yaml using a text editor (file name may vary depending on TKG version).
  5. Find the section that is headed with kindKubeadmConfigSpec: and add - 'networking' and - '  serviceSubnet: 10.96.0.0/12' (or desired subnet).

Example of configuration change:

kindKubeadmConfigSpec:
- 'kind: Cluster'
- 'apiVersion: kind.x-k8s.io/v1alpha4'
- 'networking:'
- '  serviceSubnet: 10.96.0.0/12'
- 'kubeadmConfigPatches:'
- '- |'
- '  apiVersion: kubeadm.k8s.io/v1beta2'
- '  kind: ClusterConfiguration'
- '  imageRepository: registry.tkg.vmware.run'
- '  etcd:'
- '    local:'
- '      imageRepository: registry.tkg.vmware.run'
- '      imageTag: v3.4.13_vmware.4'
- '  dns:'
- '    type: CoreDNS'
- '    imageRepository: registry.tkg.vmware.run'
- '    imageTag: v1.7.0_vmware.5'

Note: At this point, you can proceed with running the tkg init command to create the management cluster.