You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 18, 2024. It is now read-only.
This scenario provides instructions and learning for the following tasks:
31
+
# Prerequisites
33
32
34
-
- Build containers, and store them in container registry
35
-
- Use Kubernetes to create local persistent volumes to define persistent disks
36
-
- Deploy containers using Kubernetes pods and services
37
-
- Use Bluemix service in Kubernetes applications
38
-
- Deploy a distributed GitLab on Kubernetes
33
+
<!-- Use [Deploying Gitlab to IBM Cloud Private](docs/deploy-with-ICP.md) if you wish to install this on IBM Cloud Private, otherwise follow the instructions below. -->
39
34
40
-
## Deployment Scenarios
35
+
Create a Kubernetes cluster with either [Minikube](https://kubernetes.io/docs/getting-started-guides/minikube) for local testing, or with [IBM Cloud Kubernetes Service](https://console.bluemix.net/docs/containers/cs_tutorials.html#cs_cluster_tutorial) to deploy in cloud. The code here is regularly tested against [Kubernetes Cluster from IBM Cloud Kubernetes Service](https://console.ng.bluemix.net/docs/containers/cs_ov.html#cs_ov) using Travis.
41
36
42
-
### Deploy using Docker
37
+
[Helm](https://helm.sh/) to install GitLab's Cloud Native charts.
43
38
44
-
see [Deploying Gitlab with Docker](docs/deploy-with-docker.md)
39
+
# Steps
45
40
46
-
### Deploy to Kubernetes
41
+
1.[Clone the repo](#1-clone-the-repo)
42
+
2.[Create IBM Cloud Kubernetes Service](#2-create-ibm-cloud-kubernetes-service)
43
+
3.[Install Helm](#3-install-helm)
44
+
4.[Configure GitLab and Install](#4-configure-gitlab-and-install)
45
+
5.[Launch GitLab](#5-launch-gitlab)
47
46
48
-
Use [Deploying Gitlab to IBM Cloud Private](docs/deploy-with-ICP.md) if you wish to install this on IBM Cloud Private, otherwise follow the instructions below.
47
+
### 1. Clone the repo
49
48
50
-
Create a Kubernetes cluster with either [Minikube](https://kubernetes.io/docs/getting-started-guides/minikube) for local testing, or with [IBM Bluemix Container Service](https://github.com/IBM/container-journey-template#container-journey-template---creating-a-kubernetes-cluster) to deploy in cloud. The code here is regularly tested against [Kubernetes Cluster from Bluemix Container Service](https://console.ng.bluemix.net/docs/containers/cs_ov.html#cs_ov) using Travis.
If you want to use the Bluemix Container Registry start by [Uploading the images](docs/use-bluemix-container-registry.md) to the Bluemix Container Registry.
54
+
### 2. Create IBM Cloud Kubernetes Service
53
55
54
-
### Deploy using DevOps Toolchain to Kubernetes Cluster from Bluemix Container Service
55
-
If you want to deploy the Gitlab directly to Bluemix, click on `Deploy to Bluemix` button below to create a [Bluemix DevOps service toolchain and pipeline](https://console.ng.bluemix.net/docs/services/ContinuousDelivery/toolchains_about.html#toolchains_about) for deploying the Gitlab sample, else jump to [Steps](#steps)
56
+
Create an IBM Cloud Kubernetes Service if you don't already have one:
Please follow the [Toolchain instructions](https://github.com/IBM/container-journey-template/blob/master/Toolchain_Instructions_new.md) to complete your toolchain and pipeline.
60
+
### 3. Install Helm
60
61
61
-
#### Steps
62
+
If you don't have the Helm client in your machine, you can find one in the [official releases page](https://github.com/helm/helm/releases).
62
63
63
-
1.[Use Kubernetes to create Services and Deployments](#1-use-kubernetes-to-create-services-and-deployments-for-gitlab-redis-and-postgresql)
64
-
- 1.1 [Use PostgreSQL in container](#11-use-postgresql-in-container) or
65
-
- 1.2 [Use PostgreSQL from Bluemix](#12-use-postgresql-from-bluemix)
66
-
2.[Retrieve external ip and port for GitLab](#2-retrieve-external-ip-and-port-for-gitlab)
67
-
3.[GitLab is ready! Use GitLab to host your repositories](#3-gitlab-is-ready-use-gitlab-to-host-your-repositories)
64
+
To install Helm in your Kubernetes Cluster, do:
68
65
69
-
#### 1. Use Kubernetes to create Services and Deployments for GitLab, Redis, and PostgreSQL
66
+
```
67
+
$ helm init
68
+
```
70
69
71
-
Ensure your kubernetes cluster is reachable by running the `kubectl` command.
70
+
Add the official gitlab repo:
72
71
73
-
```bash
74
-
$ kubectl get nodes
75
-
NAME STATUS AGE VERSION
76
-
x.x.x.x Ready 17h v1.5.3-2+be7137fd3ad68f
72
+
```
73
+
$ helm repo add gitlab https://charts.gitlab.io/
74
+
$ helm repo update
77
75
```
78
76
79
-
> Note: If this step fails see troubleshooting docs at [Minikube](https://kubernetes.io/docs/getting-started-guides/minikube) or [IBM Bluemix Container Service](https://console.ng.bluemix.net/docs/containers/cs_troubleshoot.html#cs_troubleshoot).
80
-
81
-
##### 1.1 Use PostgreSQL in container
77
+
To verify installation of Helm in your cluster:
82
78
83
-
If you are using a container image to run PostgreSQL, run the following commands or run the quickstart script `./scripts/quickstart.sh` with your Kubernetes cluster.
After you have created all the services and deployments, wait for 3 to 5 minutes. You can check the status of your deployment on Kubernetes UI. Run `kubectl proxy` and go to URL 'http://127.0.0.1:8001/ui' to check when the GitLab container becomes ready.
86
+
> For more info in installing helm, you can find the official documentation [here](https://docs.helm.sh/using_helm/#installing-helm).
93
87
94
-

88
+
### 4. Configure GitLab and Install
95
89
96
-
Next [retrieve your external ip and port for GitLab](#2-retrieve-external-ip-and-port-for-GitLab)
90
+
You can find the official helm chart repo for Cloud Native GitLab deployment [here](https://gitlab.com/charts/gitlab). This can guide you in configuring your own deployment for production use.
97
91
98
-
##### 1.2 Use PostgreSQL from Bluemix
92
+
A sample configuration `config.yaml` in this repo can helm you get started with GitLab in IKS. This yaml file is configured to use the provided ingress controller with IKS. The components (Gitaly, Postgres, Redis, Minio) will not use any persistent storage for now.
99
93
100
-
Use the Bluemix catalog or the `bx` command to create a service instance of Compose for PostgreSQL and add a set of credentials.
94
+
Modify `config.yaml` file to use your own Ingress Subdomain, certificate, and IP.
101
95
102
-
```bash
103
-
$ bx service create compose-for-postgresql Standard "Compose for PostgreSQL-GL"
104
-
$ bx service key-create "Compose for PostgreSQL-GL" Credentials-1
105
96
```
97
+
$ bx cs cluster-get <CLUSTER_NAME>
106
98
107
-
Retrieve the connection string from the credentials object for the service on Bluemix.
108
-
109
-
```bash
110
-
$ bx service key-show "Compose for PostgreSQL-GL""Credentials-1"| grep "postgres:"
Modify your ```kubernetes/gitlab-postgres-svc.yaml``` file and replace `COMPOSE_PG_PASSWORD` with the password, `COMPOSE_PG_HOST` with the hostname, and `COMPOSE_PG_PORT` with the port.
106
+
To get the ALB (Application Load Balancer) IP address of your cluster:
116
107
117
-
Using the above example, the ```env:``` section will look like this.
After you have created all the services and deployments, wait for 3 to 5 minutes. You can check the status of your deployment on Kubernetes UI. Run `kubectl proxy` and go to URL 'http://127.0.0.1:8001/ui' to check when the GitLab container becomes ready.
149
-
150
-

151
-
152
-
### 2. Retrieve external ip and port for GitLab
125
+
### 5. Launch GitLab
153
126
154
-
After few minutes run the following commands to get your public IP and NodePort number.
127
+
Installing GitLab can take minutes to setup. You can check the status of your deployment:
155
128
156
-
```bash
157
-
$ $ bx cs workers <cluster_name>
158
-
OK
159
-
ID Public IP Private IP Machine Type State Status
160
-
kube-hou02-pa817264f1244245d38c4de72fffd527ca-w1 169.47.241.22 10.10.10.148 free normal Ready
> Note: The `30080` port is for gitlab UI and the `30022` port is for ssh.
167
-
168
-
> Note: The gitlab external url is set to `gitlab.example.com` add this to your hosts file pointing to your IP address from above in order to use the url that gitlab expects. If you can't do this, then using the IP (in this example `169.47.241.22`) should work.
169
-
170
-
> Note: If you using Minikube for local kubernetes deployment, you can access the list of service IPs using the `minikube service list` command.
150
+
If all your pods are now running, you can now go to your GitLab installation by visiting `https://gitlab.<INGRESS_SUBDOMAIN>`
171
151
172
-
Congratulations. Now you can use the link [http://gitlab.example.com:30080](http://gitlab.example.com:30080) or http://<node_ip>:30080 to access your gitlab service from your web browser.
152
+
Now that Gitlab is running you can [register as a new user and create a project](docs/using-gitlab.md).
173
153
174
-
### 3. GitLab is ready! Use GitLab to host your repositories
154
+
To try GitLab with persistent storage, you can explore `config-persistent.yaml` and use that instead of `config.yaml`. This will use dynamic storage provisioning that's provided with IKS.
175
155
176
-
Now that Gitlab is running you can [register as a new user and create a project](docs/using-gitlab.md).
156
+
You can learn how to expose the port `22`[here](docs/ssh-port-ingress.md) with the ingress controller to clone repositories using SSH.
177
157
178
-
### Troubleshooting
158
+
# Troubleshooting
179
159
180
160
If a pod doesn't start examine the logs.
181
161
```bash
182
162
kubectl get pods
183
163
kubectl logs <pod name>
184
164
```
185
165
186
-
### Cleanup
187
-
188
-
To delete all your services, deployments, and persistent volume claim, run
0 commit comments