Tanzu Kubernetes Grid - Linux Workstation Setup

TKG Bootstrap Machine on Fedora

Tanzu Kubernetes Grid needs a workstation to bootstrap your Kubernetes Cluster. This is a short guide for a Fedora based bootstrap Machine:

Requirements

  • Ability to run Docker
  • Access to download Tanzu CLI (via Customer Connect Portal)
  • dedicated admin user in the wheel-group

Install Docker

Docker on modern RHEL systems can be confusing because the latest versions of RHEL replace Docker with Podman (dnf install docker will install podman). I should work with podman, but we explicity are going to install Docker Container Engine.

Login to your system (via ssh) with the admin user.

Add Repo and Install Docker CE

1sudo dnf -y install dnf-plugins-core
2sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
3sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Start & enable Docker

1sudo systemctl start docker && sudo systemctl enable docker

Set Docker Socket context to current user. This step is crucial, to allow the current user to access the docker socket as tanzu cli should run with the current user contexts not sudo.

1sudo chown $USER:docker /var/run/docker.sock

You can also install docker-desktop if you want to have a GUI.

Install Tanzu CLI and Plugin

 1cat << EOF | sudo tee /etc/yum.repos.d/tanzu-cli.repo
 2[tanzu-cli]
 3name=Tanzu CLI
 4baseurl=https://storage.googleapis.com/tanzu-cli-os-packages/rpm/tanzu-cli
 5enabled=1
 6gpgcheck=1
 7repo_gpgcheck=1
 8gpgkey=https://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
 9EOF
10
11sudo dnf install -y tanzu-cli
1tanzu plugin install --group vmware-tkg/default:v2.4.1

Install VMware kubectl

Go to VMware Customer Connect and Download VMWare kubectl. https://customerconnect.vmware.com/downloads/get-download?downloadGroup=TKG-241)

Unzip the package and make it executable

1chmod ugo+x kubectl-linux-v1.27.5+vmware.1

Install

1sudo install kubectl-linux-v1.27.5+vmware.1 /usr/local/bin/kubectl

Test the setup

If everything worked you should be able to run the following commands without any issues:

List your Tanzu CLI plugins

1tanzu plugin list

Create a Tanzu Management Cluster to boostrap TKG

1tanzu management-cluster create --ui

TKG Management Cluster

Troubleshooting

Error "Docker prerequiries not met"

This is usually the case when the current user does not have access to docker. In the current User Session run:

1docker ps -a

If presented with "Got permission denied" try adding current user to the wheel (local admin group) group

1sudo usermod -aG wheel $USER

Then try again to create your tanzu management cluster.