Feedback

Chat Icon

End-to-End Kubernetes with Rancher, RKE2, K3s, Fleet, Longhorn, and NeuVector

The full journey from nothing to production

Deploying and Managing Workloads Using Rancher Manager - Part I
27%

Deploying Harbor Container Registry with Rancher Manager

At this stage, we have 2 clusters that you can see in the Rancher Manager UI: the local cluster where Rancher Manager is running and a remote RKE2 cluster (rke2-cluster) that was imported into Rancher.

We will use the local cluster to deploy Harbor Container Registry. This is where we are going to push the image we built earlier for the todo-app.

To do this, we will create a separate namespace in the local cluster for Harbor. Follow these steps:

  • Go to the Rancher Manager UI.
  • Click on Cluster Management on the left-hand side menu.
  • Click on the explore button next to the local cluster.
  • In the left-hand side menu, click on Cluster > Projects/Namespaces.
  • Click on Create Project and give the project a name, for example, tools. Click on Create.

Create Project

Create Project

You should now see the project you just created in the list of projects.

ℹ️ While Namespace is a built-in mechanism to scope resources and create separate virtual clusters within a Kubernetes cluster, Project is a Rancher-specific concept that allows you to group namespaces into a logical unit. This is useful when you want to assign different permissions to different users or teams within the same cluster. For example, you can assign a user to a project and give them access to only the namespaces within that project.

  • Click on Create Namespace in the tools project.
  • Give the namespace a name, for example, harbor.

At this level, you can configure the namespace, like setting resource quotas and labels. For now, we will leave the default settings.

  • Click on Create.

Once the namespace is created, we will use Helm to deploy Harbor into the harbor namespace.

To deploy Harbor, we will use the official Harbor Helm chart. Follow these steps:

  • Click on Apps > Repositories in the left-hand side menu of the local cluster.
  • Click on Create.
  • Give the repository a name, for example, harbor.
  • In the Target field, select http(s) URL to an index generated by helm.
  • Use the following URL: https://helm.goharbor.io/ in the Index URL field.
  • Click on Create and wait for the repository to be created.

Let's install the chart:

  • Go to Apps > Charts and search for harbor.
  • Click on the harbor chart that shows up in the search results.
  • Click on Install.
  • Select the namespace harbor and give the release a name, for example, harbor. Continue to the next step.

At this level, you should see the default values for the Harbor Helm chart (values.yaml). You can customize these values to suit your needs. We are going to use the version 1.16.0 of the Harbor Helm chart. You can copy the default values and paste them from the values.yaml file below.

https://github.com/goharbor/harbor-helm/blob/1.16.0/values.yaml

This is what we are going to change:

  • Change the harborAdminPassword to p@ssword. This is the password for the default admin user. You can change it to a more secure password.
  • Change the externalURL to https://harbor.$WORKSPACE_PUBLIC_IP.sslip.io. Make sure to replace $WORKSPACE_PUBLIC_IP with the actual IP address of the workspace server before pasting the value in the externalURL field.
  • Change the expose.ingress.hosts.core to harbor.$WORKSPACE_PUBLIC_IP.sslip.io.
  • Change the expose.ingress.className to traefik. This is the default ingress controller for Rancher Manager.
[...]

expose:
  type: ingress

End-to-End Kubernetes with Rancher, RKE2, K3s, Fleet, Longhorn, and NeuVector

The full journey from nothing to production

Enroll now to unlock all content and receive all future updates for free.