This section explains how to configure Harbor to replicate container images from the VMware Tanzu Application Catalog (Tanzu Application Catalog).
Harbor can be easily configured to automatically replicate container images from the Tanzu Application Catalog. This allows Tanzu Application Catalog users to consume images from their private Harbor registry (typically configured behind a firewall or in a DMZ). With this, enterprise users get all the benefits of a private registry, together with access to the latest, most secure and up-to-date container images from the Tanzu Application Catalog.
For enterprise development teams, a private container registry offers a number of advantages: more granular access control, configurable vulnerability scanning and above all, a trusted and “known good” source of images. Harbor is an open source container registry which supports all of these requirements, together with an extensible API and support for multi-tenancy. It can be installed in any Kubernetes cluster with Bitnami’s Harbor Helm chart, which provides an up-to-date and secure Harbor package.
Ensure:
To consume Tanzu Application Catalog images using a Private Harbor Registry, follow the steps as explained in the sections below:
The first step is to configure a registry to host the container images. Follow these steps:
In the resulting dialog, configure the registry endpoint as follows:
Enter a secret in the “Access Secret” field. This secret permits access to a catalog.
The Configuration dialog box diplays.
Click “Test Connection” to test the connection to the endpoint. If the test passes, click “OK” to create the registry.
The new registry should appear in the list of registries.
Tip If you have multiple teams accessing Harbor, you can configure a separate registry for each.
Once the private Harbor registry has been created, the next step is to configure replication between this private Harbor registry and the source catalog. A separate rule is to be configured for each container image that you wish to replicate.
As an example, this article will show you how to replicate the Kafka container image from the Tanzu Application Catalog to the private Harbor registry. Follow these steps:
In the resulting dialog, configure the replication rule as follows:
NOTE /GCP_PROJECT_ID/REPOSITORY_NAME/ are placeholders. Replace them with the URL of the private registry where your catalog is located.
NoteReplicating the complete Tanzu Application Catalog will take a few hours depending on the size of your catalog.
Tip Use the “Destination namespace” field in the replication rule dialog to specify different namespaces for replication. This allows different teams to use the same Tanzu Application Catalog account but have a separate registry for each project, each with its own subset of containers.
Tick the “Override” checkbox if you want pre-existing images with the same name in the private registry to be overwritten by fresh versions.
The Configuration dialog box displays.
Click “Save” to save the replication rule.
Tip If you plan to synchronize images on a fixed schedule, set the “Trigger Mode” to Scheduled instead and provide a cron string to define the schedule.
The new rule should appear in the list of replication rules.
Repeat this step for every container image that you wish to replicate, modifying the source resource filter path or name as required.
You can now proceed to test the replication, as follows:
Confirm the replication request.
The replication process will begin. You will be able to watch the status in the “Executions” list.
To view the details on what was replicated, or to stop the process:
Click the event ID in the “Executions” list.
The Event detail page displays.
Click the “Logs” icon to view a detailed log of the replication process, or click “Stop” to stop the operation.
You can now begin using the replicated container images from the Harbor registry.
The following example commands demonstrate how to run the replicated Kafka container image from the local Harbor registry. Replace the REGISTRY-ENDPOINT placeholder with the correct endpoint for your Harbor registry.
$ docker login REGISTRY-ENDPOINT/bitnami/kafka
$ docker run --rm REGISTRY-ENDPOINT/bitnami/kafka