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
These environment variables will be used by the file `docker-compose.swarm.yml`.
112
112
113
-
They are used inside of the stacks and are also used to configure the domains for the Traefik load balancer. Because of that, you need to export them.
113
+
They are used inside of the stacks and are also used to configure the domains for the Traefik load balancer. Because of that, you need to export them for them to be available when deploying the stack.
114
114
115
115
## Other environment variables
116
116
@@ -120,16 +120,14 @@ Read the [main README](https://github.com/sameersbn/docker-gitlab) for all the o
120
120
121
121
For Registry specific options and details, check the main [GitLab Registry documentation in this repo](https://github.com/sameersbn/docker-gitlab/blob/master/docs/container_registry.md).
122
122
123
-
You can configure them by exporting the environment variables you want to use like you did for `GITLAB_HOST` and `REGISTRY_HOST`, or you can also edit de file `docker-compose.swarm.yml` directly.
123
+
You can configure them by editing de file `docker-compose.swarm.yml`.
124
124
125
-
If you want to edit the file directly, you can do it in the command line with a program like `nano`, e.g.:
125
+
You can do it in the command line with a program like `nano`, e.g.:
126
126
127
127
```bash
128
128
nano docker-compose.swarm.yml
129
129
```
130
130
131
-
You could want to edit the file directly to preserve the values that you used for deploying your stack.
132
-
133
131
## Set other environment variables
134
132
135
133
If you want anyone to sign up instead of only people with invitation, change `GITLAB_SIGNUP_ENABLED` to `true`:
@@ -155,43 +153,7 @@ You can copy it and set it in the file like:
If you modified the file locally and then connected to your server later, make sure you export any missing environment variables.
211
-
212
-
Specially `GITLAB_HOST` and `REGISTRY_HOST` that are needed as env vars even if you modified the Docker Compose file (as those are used in the Traefik labels).
172
+
If you modified the file locally and then connected to your server later, make sure you export the environment variables `GITLAB_HOST` and `REGISTRY_HOST` that are needed even if you modified the Docker Compose file (as those are used in the Traefik labels).
213
173
214
174
## About volumes, labels, and constraints
215
175
216
176
Because the Docker Swarm cluster may have more than one single node (machine) in the cluster, we need to make sure that the services that need to save and read files from volumes are always deployed to the same node.
217
177
218
-
For example, the service for `redis` uses a volume, you can check it on the file:
178
+
For example, the service for `redis` uses a volume, you can check it on the `docker-compose.swarm.yml`file:
219
179
220
180
```yaml
221
181
volumes:
@@ -233,7 +193,7 @@ To make sure `redis` is always deployed to the same node that contains the same
233
193
234
194
This tells Docker that the service `redis` should be deployed to a Docker node (a machine in the cluster) with the label `node.labels.gitlab.redis-data=true`.
235
195
236
-
Then we can make one node have this label, and Docker Swarm will always deploy the `redis` service to the same node.
196
+
Then we can make one node (only one) have this label, and Docker Swarm will always deploy the `redis` service to the same node. That way, the service will keep reading the same volume every time. Even if you re-deploy or upgrade the stack.
237
197
238
198
## Add constraint labels
239
199
@@ -258,15 +218,15 @@ m48gz5e8ucmk59af4m6enmnaz * dog.example.com Ready Active Leade
258
218
mue36qqwqnzrqt4iqi0yyd6ie gitlab.example.com Ready Active 19.03.9
259
219
```
260
220
261
-
And select the node where you want to deploy the main `gitlab` service. In this example, in the `HOSTNAME` `gitlab.example.com`, with node ID `mue36qqwqnzrqt4iqi0yyd6ie`.
221
+
And select the node where you want to deploy the main `gitlab` service. In this example, in the node that has a `HOSTNAME` with value `gitlab.example.com`, with node ID `mue36qqwqnzrqt4iqi0yyd6ie`.
262
222
263
-
So, you could export that environment variable with that node with:
223
+
So, you could export that environment variable using the node ID with something like:
264
224
265
225
```bash
266
226
export NODE_ID=mue36qqwqnzrqt4iqi0yyd6ie
267
227
```
268
228
269
-
* Create a tag in that node, so that the service `gitlab` and `registry` are always deployed to the same node and use the same volumes:
229
+
* Create a label in that node, so that the service `gitlab` and `registry` are always deployed to the same node and use the same volumes:
**Note**: the environment variables `GITLAB_HOST` and `REGISTRY_HOST` have to be available every time to deploy the stack. But the node labels can be set only once, the first time you deploy.
260
+
297
261
You can check the status of the deployment with:
298
262
299
263
```bash
@@ -350,13 +314,13 @@ And the Registry is configured to look for the certificate in that same location
350
314
351
315
If you use GitLab and want to integrate Continuous Integration / Continuous Deployment, you can follow this section to install the GitLab runner.
352
316
353
-
You should create the runner using Docker standalone instead of in Docker Swarm mode, as you need the configurations to persist, and in Docker Swarm mode, the container could be deployed to a different server and you would loose those configurations.
317
+
You should create the runner using Docker standalone instead of in Docker Swarm mode, as you need the configurations to persist, and in Docker Swarm mode, the container could be deployed to a different server and you would lose those configurations.
354
318
355
319
### Testing and Deployment
356
320
357
321
For testing, the GitLab runner can run in any node.
358
322
359
-
But if you want to deploy another runner (or the same) for deployment in the same Docker Swarm cluster, it has to run on a manager node.
323
+
But if you want to deploy another runner for deployment (or use the same one), it has to run on a manager node in the Docker Swarm cluster.
360
324
361
325
### Create the GitLab Runner in Docker standalone mode
0 commit comments