Deploy Harbor on KubeSphere

    This tutorial walks you through an example of deploying Harbor from the App Store of KubeSphere.

    • Please make sure you .
    • You need to create a workspace, a project, and a user account for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the role. In this tutorial, you log in as project-regular and work in the project demo-project in the workspace demo-workspace. For more information, see Create Workspaces, Projects, Users and Roles.
    1. Find Harbor and click Install on the App Information page.

    2. Set a name and select an app version. Make sure Harbor is deployed in demo-project and click Next.

    3. On the App Settings page, edit the configuration file of Harbor. Pay attention to the following fields.

      type: The method you use to access the Harbor Service. This example uses nodePort.

      tls: Specify whether you want to enable HTTPS. Set it to false for most cases.

      externalURL: The URL exposed to tenants.

      • Don’t forget to specify . This field can be very helpful if you have trouble accessing Harbor.

      • Make sure you use the HTTP protocol and its corresponding nodePort in this tutorial. For more information, see in FAQ.

      When you finish editing the configuration, click Install to continue.

    4. Wait until Harbor is up and running.

    Step 2: Access Harbor

    1. Based on the field expose.type you set in the configuration file, the access method may be different. As this example uses nodePort to access Harbor, visit http://<NodeIP>:30002 as set in the previous step.

      Note

      You may need to open the port in your security groups and configure related port forwarding rules depending on your where your Kubernetes cluster is deployed.

    1. How to enable HTTP login?

      Set tls.enabled to false in step 1 above. The protocol of externalURL must be the same as expose.nodePort.ports.

      If you use Docker login, set to one of insecure-registries in daemon.json, then reload Docker.

      Here is an example configuration file for your reference. Pay special attention to the comments.

    2. How to enable HTTPS login?

      a. Use self-signed certificates.

      • Set tls.enabled to true in the configuration file in step 1, and edit externalURL accordingly.
      • Copy the CA certificates stored in the Pod harbor-core ‘s /etc/core/ca to your host.
      • Trust the CA certificates by your host first, then restart Docker.

      b. Use public SSL.

      • Add certificates as a Secret.
      • Set tls.enabled to true in the configuration file in step 1, and edit externalURL accordingly.