Introducing the Verrazzano CLI

Ali Mukadam
Verrazzano
Published in
3 min readJan 30, 2023

Until version 1.3, whenever you had to install Verrazzano, you would be using the venerable kubectl. In version 1.4, we added the Verrazzano command line tool, aka vz cli. We can now install, analyze, upgrade the Verrazzano instance, check the status or generate a bug report.

Without further pomp, let’s take it for a spin. I’ll assume you have a Kubernetes cluster already.

Installing the Verrazzano cli

Installing the cli is easy. First download it:

curl -LO https://github.com/verrazzano/verrazzano/releases/download/v1.4.2/verrazzano-1.4.2-linux-amd64.tar.gz

Then, unpack and add it to your path:

tar xvf verrazzano-1.4.2-linux-amd64.tar.gz
sudo cp verrazzano-1.4.2/bin/vz /usr/local/bin

Check your cli is up to date:

vz version

Version: v1.4.2
BuildDate: 2022-11-10T22:25:50Z
GitCommit: 0576f21c8787ea948cb6cfbf1cdea52ef276749a

To view available commands:

vz

The vz tool is a command-line utility that allows Verrazzano operators to query and manage a Verrazzano environment

Usage:
vz [command]

Available Commands:
analyze Analyze cluster
bug-report Collect information from the cluster to report an issue
help Help about any command
install Install Verrazzano
status Status of the Verrazzano installation and access endpoints
uninstall Uninstall Verrazzano
upgrade Upgrade Verrazzano
version Verrazzano version information

Flags:
--context string The name of the kubeconfig context to use
-h, --help help for vz
--kubeconfig string Path to the kubeconfig file to use

Use "vz [command] --help" for more information about a command.

Cool, our cli is set up and ready to roll.

Using the vz cli to install Verrazzano

Like other tools in the Kubernetes space, the vz cli will look for your kubeconfig either in its default location or to whatever you’ve configured the KUBECONFIG environment variable:

export KUBECONFIG=/path/to/kubeconfig

Or you can change this as a command line parameter:

vz --kubeconfig /path/to/kubeconfig

The neat thing with the vz cli is that it installs the Verrazzano Platform Operator and creates a new Verrazzano custom resource in one single operation. Prior to this, you had to install the operator separately and then create the Verrazzano custom resource.

Let’s go ahead with the installation of a dev profile:

vz install -f - <<EOF
apiVersion: install.verrazzano.io/v1beta1
kind: Verrazzano
metadata:
name: vz14
spec:
profile: dev
defaultVolumeSource:
persistentVolumeClaim:
claimName: verrazzano-storage
volumeClaimSpecTemplates:
- metadata:
name: verrazzano-storage
spec:
resources:
requests:
storage: 2Gi
EOF

And we can watch the installation:

Installing Verrazzano version v1.4.2
Applying the file https://github.com/verrazzano/verrazzano/releases/download/v1.4.2/verrazzano-platform-operator.yaml
customresourcedefinition.apiextensions.k8s.io/verrazzanomanagedclusters.clusters.verrazzano.io updated
customresourcedefinition.apiextensions.k8s.io/verrazzanos.install.verrazzano.io updated
namespace/verrazzano-install created
serviceaccount/verrazzano-platform-operator created
clusterrole.rbac.authorization.k8s.io/verrazzano-managed-cluster created
clusterrolebinding.rbac.authorization.k8s.io/verrazzano-platform-operator created
service/verrazzano-platform-operator created
deployment.apps/verrazzano-platform-operator created
validatingwebhookconfiguration.admissionregistration.k8s.io/verrazzano-platform-operator created
Waiting for verrazzano-platform-operator to be ready before starting install - 12 seconds

After a few minutes, the installation should be completed. To verify:

vz status

Verrazzano Status
Name: vz14
Namespace: default
Version: 1.4.2
State: Ready
Profile: dev
Access Endpoints:
Console URL: https://verrazzano.default.192.9.174.179.nip.io
Grafana URL: https://grafana.vmi.system.default.192.9.174.179.nip.io
Keycloak URL: https://keycloak.default.192.9.174.179.nip.io
Kiali URL: https://kiali.vmi.system.default.192.9.174.179.nip.io
Opensearch Dashboards URL: https://kibana.vmi.system.default.192.9.174.179.nip.io
OpenSearch URL: https://elasticsearch.vmi.system.default.192.9.174.179.nip.io
Prometheus URL: https://prometheus.vmi.system.default.192.9.174.179.nip.io
Rancher URL: https://rancher.default.192.9.174.179.nip.io

By default, when you don’t provide a DNS configuration, Verrazzano very helpfully configures dynamic DNS using the free nip.io.

Other cli use cases

What if you want to analyze your installation and troubleshoot problems? No worries, the cli has got you covered and you can do the analysis in real-time:

vz analyze
Analyzing resources from the cluster …

Verrazzano analysis CLI did not detect any issue in the cluster

Obviously, in this cluster, things are going well so there’s nothing to see here. There are also other things you can do e.g. uninstall, create a bug report, upgrade.

Summary

For a first release, the Verrazzano cli packs a few. We’ve got a few ideas on how to improve but more importantly, we would like to hear from you. Please share with us your forthright views on how we can further improve Verrazzano on Github or on Slack.

--

--