Install Tanzu on Ubuntu 20.04

Posted by : at

Category : kubernetes


I am mucking around a bit with a homelab and thought I would look into Tanzu. To start, I created an absolutely vanilla Ubuntu 20.04 Server instance with 8Gb of Memory and 30Gb of disk. In then installed some pre-requisite software:

  1. Docker
  2. Brew
  3. Kubectl

To install Tanzu run the following command:

brew install vmware-tanzu/tanzu/tanzu-community-edition

This command will output something similar to the following:

==> ******************************************************************************
==> * To initialize all plugins required by Tanzu Community Edition, an additional
==> * step is required. To complete the installation, please run the following
==> * shell script:
==> *
==> * /home/linuxbrew/.linuxbrew/Cellar/tanzu-community-edition/v0.10.0/libexec/configure-tce.sh
==> *
==> ******************************************************************************
==>

Run that command, then run the following command:

tanzu management-cluster create --ui --bind 0.0.0.0:8080

Note: The bind address is required because my ubuntu server does not have a GUI, I am accessing it via SSH.

To run the management console open up a browser and point to http://<tanzu_server_ip>:8080 and it should display something similar to the following:

Tanzu Cluster Management

Click on the Docker deploy option and this moves you through a prerequisite check, cluster naming and some network configuration, I accepted the defaults.

I then reviewed the configuration and chose “Deploy Management Cluster” as shown below:

Tanzu Cluster Creation

This then moves though a deployment process which takes some time (minutes in my case). Logs can either be viewed in the GUI and command line and when the process completes the command executed earlier will exit.

To validate that the cluster is running, run the following command:

tanzu management-cluster get

For my server this returned the following information:

  NAME     NAMESPACE   STATUS   CONTROLPLANE  WORKERS  KUBERNETES        ROLES
ransley  tkg-system  running  1/1           1/1      v1.21.5+vmware.1  management


Details:

NAME                                                        READY  SEVERITY  REASON  SINCE  MESSAGE
/ransley                                                    True                     2m55s
├─ClusterInfrastructure - DockerCluster/ransley             True                     3m5s
├─ControlPlane - KubeadmControlPlane/ransley-control-plane  True                     2m55s
│ └─Machine/ransley-control-plane-n7sgp                     True                     2m59s
└─Workers
└─MachineDeployment/ransley-md-0
    └─Machine/ransley-md-0-579f95df8b-l7wj8                 True                     2m59s


Providers:

NAMESPACE                          NAME                   TYPE                    PROVIDERNAME  VERSION  WATCHNAMESPACE
capd-system                        infrastructure-docker  InfrastructureProvider  docker        v0.3.23
capi-kubeadm-bootstrap-system      bootstrap-kubeadm      BootstrapProvider       kubeadm       v0.3.23
capi-kubeadm-control-plane-system  control-plane-kubeadm  ControlPlaneProvider    kubeadm       v0.3.23
capi-system                        cluster-api            CoreProvider            cluster-api   v0.3.23

To configure kubectl run the following command:

tanzu management-cluster kubeconfig get <MGMT-CLUSTER-NAME> --admin

So in my case:

tanzu management-cluster kubeconfig get ransley --admin

I was then able to run:

kubectl get nodes

Which return the following:

NAME                            STATUS   ROLES                  AGE   VERSION
ransley-control-plane-n7sgp     Ready    control-plane,master   11m   v1.21.5+vmware.1
ransley-md-0-579f95df8b-l7wj8   Ready    <none>                 10m   v1.21.5+vmware.1

To create a workload cluster run the following command:

tanzu cluster create ransleywl --plan dev

This command took a few minutes to run and its output was as follows:

Validating configuration...
Warning: Pinniped configuration not found. Skipping pinniped configuration in workload cluster. Please refer to the documentation to check if you can configure pinniped on workload cluster manually
Creating workload cluster 'ransleywl'...
Waiting for cluster to be initialized...
[cluster control plane is still being initialized: WaitingForControlPlane, cluster infrastructure is still being provisioned: WaitingForControlPlane]
cluster control plane is still being initialized: Bootstrapping @ Machine/ransleywl-control-plane-vmhz7
Waiting for cluster nodes to be available...
Waiting for addons installation...
Waiting for packages to be up and running...

Workload cluster 'ransleywl' created

To verify the cluster started successfully run the following command:

tanzu cluster list

Which will output the following:

NAME       NAMESPACE  STATUS   CONTROLPLANE  WORKERS  KUBERNETES        ROLES   PLAN
ransleywl  default    running  1/1           1/1      v1.21.5+vmware.1  <none>  dev

To update kubectl for the new cluster run the following command:

tanzu cluster kubeconfig get ransleywl --admin
kubectl config use-context ransleywl-admin@ransleywl

To show the pods in the cluster run the following command:

kubectl get pods --all-namespaces

Which ouptu the following:

NAMESPACE      NAME                                                    READY   STATUS    RESTARTS   AGE
kube-system    antrea-agent-52zjf                                      2/2     Running   0          6m5s
kube-system    antrea-agent-6r7cf                                      2/2     Running   0          6m5s
kube-system    antrea-controller-7dc9d9c8d7-9frm2                      1/1     Running   0          6m4s
kube-system    coredns-657879bf57-9fvdm                                1/1     Running   0          13m
kube-system    coredns-657879bf57-wmnct                                1/1     Running   0          13m
kube-system    etcd-ransleywl-control-plane-vmhz7                      1/1     Running   0          13m
kube-system    kube-apiserver-ransleywl-control-plane-vmhz7            1/1     Running   0          13m
kube-system    kube-controller-manager-ransleywl-control-plane-vmhz7   1/1     Running   0          13m
kube-system    kube-proxy-cmq8g                                        1/1     Running   0          13m
kube-system    kube-proxy-n64z9                                        1/1     Running   0          12m
kube-system    kube-scheduler-ransleywl-control-plane-vmhz7            1/1     Running   0          13m
kube-system    metrics-server-649578757b-l844s                         1/1     Running   0          6m13s
tanzu-system   secretgen-controller-f44c8b9c6-b84hw                    1/1     Running   0          7m46s
tkg-system     kapp-controller-f8d47f95c-v9qlf                         1/1     Running   0          12m
tkg-system     tanzu-capabilities-controller-manager-7959d6b44-v96qm   1/1     Running   0          13m

About Michael Ransley
Michael Ransley

Hi, I am a Husband, Father of 3 children and Principal Data Engineer at Origin Energy. I am interested in many things - but technology is certainly one of them - both how to solve particular issues but also the effects that technology has on our society.

Website : https://michael.ransley.co

Categories
Useful Links