Configure Verrazzano on Managed Clusters

When you provision new clusters using the cluster API component, you can also choose to install Verrazzano on them. Then, you can use VerrazzanoFleet, a cluster API add-on, to perform lifecycle management operations on Verrazzano installations on your managed clusters.

Configure VerrazzanoFleet

Before you can manage Verrazzano on your managed clusters, you need to configure the VerrazzanoFleet resource.

  1. Provision OCNE or OKE clusters. For instructions, see:

  2. Identify the namespace where the new cluster resides.

    $ kubectl get clusters.cluster.x-k8s.io -A
    

  3. Create a VerrazzanoFleet resource. The following example creates a typical VerrazzanoFleet resource.

    $ kubectl apply -f - <<EOF
      apiVersion: addons.cluster.x-k8s.io/v1alpha1
      kind: VerrazzanoFleet
      metadata:
        name: example-fleet-1
        namespace: default
      spec:
        clusterSelector:
          name: cluster1
        verrazzano:
          spec:
            profile: managed-cluster
    EOF
    

Customize a remote Verrazzano installation

By default, new managed clusters are provisioned with the Verrazzano managed-cluster profile. If you want to enable more components, disable unnecessary ones, or modify the settings of a component, then you can edit the verrazzano.spec object of the VerrazzanoFleet resource to suit your needs.

Use the same process to edit the verrazzano.spec object as you would the Verrazzano resource. For more information, see Modify Verrazzano Installations.

To see which components are already enabled in a managed-cluster profile, refer to Profile Configurations.

The following configuration shows you how to enable Argo CD and Velero.

$ kubectl apply -f - <<EOF
  apiVersion: addons.cluster.x-k8s.io/v1alpha1
  kind: VerrazzanoFleet
  metadata:
    name: example-fleet-1
    namespace: default
  spec:
    clusterSelector:
      name: cluster1
    verrazzano:
      spec:
        profile: managed-cluster
        components:
          argoCD:
            enabled: true
          velero: 
            enabled: true
EOF

Upgrade Verrazzano on managed clusters

You can upgrade the Verrazzano installation on managed clusters.

  1. Upgrade the Verrazzano installation on the admin cluster. For instructions, see Upgrade Verrazzano.

  2. In the VerrazzanoFleet resource, use component overrides to upgrade VerrazzanoFleet.spec.verrazzano.spec.version. The Verrazzano version on the managed clusters must match the version of the admin cluster.

    In this example, the managed clusters are upgraded to Verrazzano 1.7.0.

    $ kubectl apply -f - <<EOF
      apiVersion: addons.cluster.x-k8s.io/v1alpha1
      kind: VerrazzanoFleet
      metadata:
        name: example-fleet-1
        namespace: default
      spec:
        clusterSelector:
          name: cluster1 
        verrazzano:
          spec:
            profile: managed-cluster
            version: 1.7.0
    EOF
    

Use a private registry

You can manage your managed clusters even when they are installed in a disconnected environment. Use component overrides to configure the VerrazzanoFleet resource to access a private registry.

To connect to a private registry, you need to configure the following component overrides:

  • VerrazzanoFleet.spec.imagePullSecrets.name
  • VerrazzanoFleet.spec.image.repository
  • VerrazzanoFleet.spec.image.tag
  • VerrazzanoFleet.spec.privateRegistry.enabled

For example:

$ kubectl apply -f - <<EOF
  apiVersion: addons.cluster.x-k8s.io/v1alpha1
  kind: VerrazzanoFleet
  metadata:
    name: example-fleet-1
    namespace: default
  spec:
    clusterSelector:
      name: cluster1
    imagePullSecrets:
    - name: verrazzano-container-registry
    image:
      repository: ${OCNE_IMAGE_REPOSITORY=ghcr.io}/${VZ_IMAGE_PATH=verrazzano}
      tag: ${VERRAZZANO_PLATFORM_OPERATOR_IMAGE_TAG}
    privateRegistry:
       enabled: true
    verrazzano:
      spec:
        profile: managed-cluster
EOF

Remove Verrazzano from managed clusters

You can remove the Verrazzano installation from managed clusters.

On the admin cluster, run this command:

$ kubectl delete vf -n <namespace> <name of verrazzanofleet>

When a VerrazzanoFleet object is deleted, it removes Verrazzano from the cluster which was associated with the fleet.