mirror of
https://github.com/kubesphere/website.git
synced 2025-12-26 08:32:55 +00:00
Update how to deploy gitlab
Signed-off-by: Ray Zhou <ray@yunify.com>
This commit is contained in:
parent
c47f51b6e3
commit
de63a97396
|
|
@ -1,107 +1,112 @@
|
|||
---
|
||||
title: "GitLab App"
|
||||
keywords: 'kubernetes, kubesphere, gitlab, app-store'
|
||||
description: 'How to use GitLab'
|
||||
description: 'How to deploy GitLab'
|
||||
|
||||
|
||||
weight: 2240
|
||||
---
|
||||
|
||||
# Objective
|
||||
## Objective
|
||||
|
||||
This tutorial shows you how to quickly deploy a [GitLab](https://gitlab.com/gitlab-org/gitlab) application using templates from KubeSphere Helm repo. The demonstration includes importing application repository, sharing and deploying apps within a workspace.
|
||||
|
||||
# Prerequisites
|
||||
## Prerequisites
|
||||
|
||||
- You have enabled [KubeSphere Application Store](/docs/pluggable-components/app-store/)
|
||||
- You have enabled [OpenPitrix](/docs/pluggable-components/app-store/).
|
||||
- You have completed the tutorial [Create Workspace, Project, Account and Role](/docs/quick-start/create-workspace-and-project/). The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, we'll work in the project `apps` of the workspace `apps`.
|
||||
|
||||
# Hands-on Lab
|
||||
## Hands-on Lab
|
||||
|
||||
## Step 1: Add an Application Repository
|
||||
### Step 1: Add an Application Repository
|
||||
|
||||
1.1. Sign in as workspace admin account (`apps-admin` for this guide), click **View Workspace** and navigate to **Apps Management → App Repos**, then click **Add Repo**.
|
||||
|
||||

|
||||

|
||||
|
||||
1.2. Fill in the basic information, name it `main` and input the URL https://charts.kubesphere.io/main. You can validate if this URL is available, and choose OK when you have done.
|
||||
|
||||
> Note: It will automatically import all of the applications from the Helm repository into KubeSphere. You can browse those app templates in each project.
|
||||
{{< notice note >}}
|
||||
It will automatically import all of the applications from the Helm repository into KubeSphere. You can browse those app templates in each project.
|
||||
{{</ notice >}}
|
||||
|
||||

|
||||

|
||||
|
||||
## Step 2: Browse App Templates
|
||||
### Step 2: Browse App Templates
|
||||
|
||||
2.1. Switch to use workspace regular account to log in (`apps-regular` for this guide), then enter into project `apps`.
|
||||
|
||||
2.2. Click **Application Workloads → Applications**, click **Deploy New Application**.
|
||||
|
||||

|
||||

|
||||
|
||||
2.3. Choose **From App Templates** and select `main` from the dropdown list. Click `gitlab`.
|
||||
|
||||

|
||||

|
||||
|
||||
## Step 3: Deploy GitLab Application
|
||||
### Step 3: Deploy GitLab Application
|
||||
|
||||
3.1. Click **Deploy** at the top right, customize app name if needed, and then click **Next**.
|
||||
|
||||

|
||||

|
||||
|
||||
3.2. Customize App Config, and then click **Deploy**.
|
||||
|
||||
Generally we need to customize the domain name, and we'll use `apps.svc.cluster.local` here, which follows K8s internal DNS suffix for in-cluster access (the leading `apps` means the project `apps`, you can use your own project name accordingly).
|
||||
|
||||
```
|
||||
global:
|
||||
hosts:
|
||||
domain: apps.svc.cluster.local
|
||||
```yaml
|
||||
global:
|
||||
hosts:
|
||||
domain: apps.svc.cluster.local
|
||||
|
||||
gitlab-runner:
|
||||
install: false
|
||||
gitlab-runner:
|
||||
install: false
|
||||
|
||||
gitlab:
|
||||
webservice:
|
||||
helmTests:
|
||||
enabled: false
|
||||
```
|
||||
gitlab:
|
||||
webservice:
|
||||
helmTests:
|
||||
enabled: false
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
3.3. Wait for a few minutes, then you will see the application `git` showing `active` in the application list.
|
||||
|
||||

|
||||

|
||||
|
||||
## Step 4: Expose GitLab Service
|
||||
### Step 4: Expose GitLab Service
|
||||
|
||||
Set up a record `gitlab.<project>.svc.<k8s domain>` in the DNS server, or simply put it in `hosts` file.
|
||||
|
||||
> `/etc/hosts` for Linux or `c:\windows\system32\drivers\etc\hosts` for Windows.
|
||||
|
||||
```
|
||||
```shell
|
||||
172.24.2.3 gitlab.apps.svc.cluster.local
|
||||
```
|
||||
|
||||
> We can use the IP address of any K8s master/worker node.
|
||||
{{< notice note >}}
|
||||
|
||||
## Step 5: Access the GitLab Service
|
||||
- The hosts file is `/etc/hosts` for Linux or `c:\windows\system32\drivers\etc\hosts` for Windows.
|
||||
- You can use the IP address of any K8s master/worker node.
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
### Step 5: Access the GitLab Service
|
||||
|
||||
5.1. Enter kubectl CLI by clicking the button in popup menu at the right bottom of KubeSphere console.
|
||||
|
||||

|
||||

|
||||
|
||||
5.2. Retrieve and decode the root user's password.
|
||||
|
||||
```
|
||||
kubectl -n apps get secrets git-gitlab-initial-root-password -o jsonpath="{.data.password}" | base64 -d; echo
|
||||
```
|
||||
```bash
|
||||
kubectl -n apps get secrets git-gitlab-initial-root-password -o jsonpath="{.data.password}" | base64 -d; echo
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
5.3. Find the port of Nginx.
|
||||
|
||||

|
||||

|
||||
|
||||
5.4. Accessed GitLab `http://gitlab.apps.svc.cluster.local:<nginx port>` with the password.
|
||||
|
||||

|
||||

|
||||
|
|
|
|||
Loading…
Reference in New Issue