"kind create cluster" command fails after switching from Fusion 12.x to 12.0.0 or Workstation 16.x to 16.0.0
search cancel

"kind create cluster" command fails after switching from Fusion 12.x to 12.0.0 or Workstation 16.x to 16.0.0

book

Article ID: 320128

calendar_today

Updated On:

Products

VMware Desktop Hypervisor

Issue/Introduction

Symptoms:
  • If you performed Kubernetes cluster operations with the vctl utility in VMware Fusion 12.1.0 (or above version) or VMware Workstation 16.1.0 (or above version), then switched back to Fusion 12.0.0 or Workstation 16.0.0, attempting to use vctl utility for Kubernetes cluster creation will fail.
  • The kind create cluster command fails with the following error:
ERROR: failed to create cluster: failed to get api server port: command "docker inspect --format '{{ index .Config.Labels "desktop.docker.io/ports/6443/tcp" }}' kind-control-plane" failed with error: exit status 1
Command Output: level=error msg="template: format:1:16: executing \"format\" at <.Config.Labels>: can't evaluate field Config in type struct { containers.Container; Spec interface {} \"json:\\\"Spec,omitempty\\\"\" }"


Environment

VMware Fusion 12.x

Cause

Each Fusion/Workstation version supports only a specific version of kind CLI tool and a specific version of kubectl CLI tool, for example:
    * Fusion 12.0.0 and Workstation 16.0.0 support kind v0.8.1 and kubectl v1.18.6
    * Fusion 12.1.0 and Workstation 16.1.0 support kind v0.9.0 and kubectl v1.19.1.
Starting from Fusion 12.1.0 and Workstation 16.1.0, a version check on the kind and the kubectl CLI tools is added into the vctl utility. When you run 'vctl system start' or 'vctl kind' command, if the kind and the kubectl CLI tools already exist in <user home folder>/.vctl/bin folder and their versions are supported by current Fusion/Workstation version, the vctl command will not download them again, if their versions are not supported by current Fusion/Workstation version, the vctl command will download the supported versions and remove the unsupported ones.

However, the version check functionality is not available in Fusion 12.0.0 and Workstation 16.0.0, therefore the kind and kubectl tools in <user home folder>/.vctl/bin folder that were downloaded by the vctl utility from Fusion higher than version 12.0.0 or Workstation version higher than 16.0.0 are not supported by Fusion 12.0.0 or Workstation 16.0.0, that is why 'kind create cluster' command fails.

Resolution

To resolve this issue:
  1. Run the kind delete cluster command to delete the existing cluster.
  2. Delete <user home folder>/.vctl/bin folder to remove the unsupported versions of kind and kubectl CLI tools.
  3. In Terminal/Command Prompt/Powershell window, run the vctl kind command. This command will re-create <user home folder>/.vctl/bin folder and download kind/kubectl/crx.vmdk files whose versions are supported by Fusion 12.0.0 and Workstation 16.0.0.