Deploy GitLab on KubeSphere

    This tutorial demonstrates how to deploy GitLab on KubeSphere.

    • You need to enable the OpenPitrix system.
    • You need to create a workspace, a project, and two accounts ( and project-regular) for this tutorial. The account ws-admin must be granted the role of workspace-admin in the workspace, and the account project-regular must be invited to the project with the role of operator. If they are not ready, refer to .

    Hands-on Lab

    1. In the displayed dialog box, enter main for the app repository name and for the app repository URL. Click Validate to verify the URL and you will see a green check mark next to the URL if it is available. Click OK to continue.

    2. The repository displays in the list after it is successfully imported to KubeSphere.

    1. Log out of KubeSphere and log back in as project-regular. In your project, go to Apps under Application Workloads and click Create.

    2. In the dialog box that appears, select From App Template.

    3. Select main from the drop-down list, then click gitlab.

    4. On the App Information tab and the Chart Files tab, you can view the default settings on the console. Click Install to continue.

    5. On the Basic Information page, you can view the app name, app version, and deployment location. This tutorial uses the version 4.2.3 [13.2.2]. Click Next to continue.

    6. Note

      demo-project refers to the project name where GitLab is deployed. Make sure you use your own project name.

    7. Wait for GitLab to be up and running.

    1. Go to Secrets under Configuration, enter gitlab-initial-root-password in the search box, and then press Enter on your keyboard to search the Secret.

    2. Click the Secret to go to its detail page, and then click in the upper-right corner to view the password. Make sure you copy it.

    1. Find the hosts file on your local machine.

      The path of the hosts file is for Linux, or c:\windows\system32\drivers\etc\hosts for Windows.

    2. Add the following item into the hosts file.

      1. 192.168.4.3 gitlab.demo-project.svc.cluster.local

      Note

      • 192.168.4.3 and demo-project refer to the NodeIP and project name respectively where GitLab is deployed. Make sure you use your own NodeIP and project name.
      • You can use any IP address of the nodes in your Kubernetes cluster.
    1. Go to Services under Application Workloads, enter nginx-ingress-controller in the search box, and then press Enter on your keyboard to search the Service. You can see the Service has been exposed through port 31246, which you can use to access GitLab.

      Note

      The port number shown on your console may be different. Make sure you use your own port number.

    2. Access GitLab through using the root account and its initial password (root/ojPWrWECLWN0XFJkGs7aAqtitGMJlVfS0fLEDE03P9S0ji34XDoWmxs2MzgZRRWF).

      access-gitlab

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