Skip to content

Commit d7fc699

Browse files
committed
Final slides for 20231123
1 parent 2cd8bdd commit d7fc699

File tree

10 files changed

+113
-86
lines changed

10 files changed

+113
-86
lines changed

150_gitlab/001_quickstart/gitlab.demo

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ docker run -d --name gitlab \
55
--volume gitlab_config:/etc/gitlab \
66
--volume gitlab_logs:/var/log/gitlab \
77
--volume gitlab_data:/var/opt/gitlab \
8+
--publish 80:80 \
89
gitlab/gitlab-ce:16.5.2-ce.0
910

1011
# Wait for container to finish starting

150_gitlab/060_api/slides.md

+20
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,24 @@ glab [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://gitlab.com
122122
```
123123
<!-- .element: style="width: 32em;" -->
124124

125+
---
126+
127+
## Token expiry and rotation
128+
129+
### Expiry
130+
131+
Token without expiry are a security threat [](https://about.gitlab.com/blog/2023/10/25/access-token-lifetime-limits/)
132+
133+
GitLab 16.0 (May 2023) sets a 1-year lifetime on such tokens
134+
135+
### Rotation
136+
137+
Rotation API introduced in GitLab 16.0 (May 2023)
138+
139+
- Personal Access Tokens [](https://docs.gitlab.com/ee/api/personal_access_tokens.html#rotate-a-personal-access-token)
140+
- Group Acces Tokens [](https://docs.gitlab.com/ee/api/group_access_tokens.html#rotate-a-group-access-token)
141+
- Project Access Tokens [](https://docs.gitlab.com/ee/api/project_access_tokens.html#rotate-a-project-access-token)
142+
143+
Automatic reuse detection [](https://docs.gitlab.com/ee/api/personal_access_tokens.html#automatic-reuse-detection) prevents use of rotated tokens:
125144

145+
- Use of old tokens result in revocation of latest token

150_gitlab/100_reverse_proxy/compose.vscode.yml

-19
This file was deleted.

150_gitlab/100_reverse_proxy/compose.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ services:
6969
7070
# Prevent conflict with host SSH port
7171
gitlab_rails['gitlab_shell_ssh_port'] = 2222
72+
73+
# https://docs.gitlab.com/ee/administration/monitoring/prometheus/index.html#configuring-prometheus
74+
prometheus_monitoring['enable'] = true
75+
prometheus['listen_address'] = ':9090'
7276
# https://docs.gitlab.com/ee/install/docker.html#devshm-mount-not-having-enough-space-in-docker-container
7377
shm_size: 256m
7478
volumes:
@@ -86,8 +90,8 @@ services:
8690
traefik.http.routers.pages.entrypoints: http
8791
traefik.http.routers.pages.rule: HostRegexp(`{subdomain:.+}.gitlab.${DOMAIN:?You must supply DOMAIN}`) || HostRegexp(`{subdomain:.+}gitlab.${IP:?You must supply IP}.nip.io`)
8892
traefik.http.routers.pages.service: pages
89-
traefik.tcp.services.ssh.loadbalancer.server.port: 2222
93+
traefik.tcp.services.ssh.loadbalancer.server.port: 22
9094
traefik.tcp.routers.ssh.entrypoints: ssh
91-
traefik.tcp.routers.ssh.rule: HostSNI(`gitlab.${DOMAIN:?You must supply DOMAIN}`) || HostSNI(`gitlab.${IP:?You must supply IP}.nip.io`)
95+
traefik.tcp.routers.ssh.rule: HostSNI(`*`)
9296
traefik.tcp.routers.ssh.service: ssh
9397
traefik.tcp.routers.ssh.tls.passthrough: true

150_gitlab/100_reverse_proxy/slides.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@ docker volume rm gitlab_data
8787

8888
A fresh instance has a new initial root password
8989

90-
```
91-
docker exec -it gitlab cat /etc/gitlab/initial_root_password \
92-
| grep ^Password \
93-
| cut -d' ' -f2
94-
```
95-
9690
---
9791

9892
## TLS
@@ -111,8 +105,10 @@ Configure GitLab with key and certificate [<i class="fa-solid fa-arrow-up-right-
111105

112106
Configure GitLab to use Let's Encrypt [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/omnibus/settings/ssl.html#lets-encrypt-integration)
113107

114-
### traefik with Let's Encrypt <i class="fa-duotone fa-traffic-light-go" style="--fa-secondary-color: green;"></i>
108+
### Reverse proxy with custom certificate <i class="fa-duotone fa-traffic-light-slow" style="--fa-secondary-color: yellow;"></i>
109+
110+
Configure traefik to use custom certificate [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://doc.traefik.io/traefik/https/tls/#user-defined)
115111

116-
Configure traefik to use Let's Encrypt with HTTP challenge [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://doc.traefik.io/traefik/user-guides/docker-compose/acme-http/)
112+
### Reverse proxy with Let's Encrypt <i class="fa-duotone fa-traffic-light-go" style="--fa-secondary-color: green;"></i>
117113

118-
Configure traefik to use Let's Encrypt with DNS challenge [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://doc.traefik.io/traefik/user-guides/docker-compose/acme-dns/)
114+
Configure traefik to use Let's Encrypt with DNS challenge [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://doc.traefik.io/traefik/user-guides/docker-compose/acme-dns/)

150_gitlab/160_runner/slides.md

+55-33
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,82 @@
1212

1313
Runners [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/runner/) are used to execute jobs in GitLab CI
1414

15-
Supported executors: `shell`, `docker`, `docker-windows`, `docker-ssh`, `ssh`, `parallels`, `virtualbox`, `docker+machine`, `docker-ssh+machine`, `kubernetes`
15+
Runner can be shared across the instance of GitLab
1616

17-
### Shell
17+
They can be specific to a group or project
1818

19-
Jobs are executed in the context of the runner
19+
Extensive configuration [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/runner/configuration/advanced-configuration.html)
2020

21-
### Docker / Kubernetes
21+
### Tags
2222

23-
Jobs are executed in a dedicated container / pod
23+
Jobs select runners by specifying a tag
2424

25-
### Image cleanup
25+
---
2626

27-
docuum [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://github.com/stepchowfun/docuum) is able to remove least recently used images
27+
## Heads-up
28+
29+
New runner registration process [](https://docs.gitlab.com/ee/architecture/blueprints/runner_tokens/)
30+
31+
New default in 16.0 (May 2023)
32+
33+
Enforcement in 16.6 (November 2023)
34+
35+
Removal of old runne registration in 17.0 (May 2024)
36+
37+
### Old process
38+
39+
One token per instance, per group and per project
40+
41+
Credential leak causes a lot of work
42+
43+
### New process
44+
45+
Create a runner through the UI or the API
46+
47+
One token per runner
2848

2949
---
3050

3151
## Details
3252

3353
<i class="fa-duotone fa-person-running fa-4x fa-duotone-colors" style="float: right;"></i>
3454

35-
Runner can be shared across the instance of GitLab
36-
37-
They can be specific to a group of project
38-
39-
Jobs select runners by specifying a tag
55+
Supported executors: `shell`, `docker`, `docker-windows`, `docker-ssh`, `ssh`, `parallels`, `virtualbox`, `docker+machine`, `docker-ssh+machine`, `kubernetes`
4056

41-
Extensive configuration [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/runner/configuration/advanced-configuration.html)
57+
### Shell
4258

43-
### Heads-up
59+
Jobs are executed in the context of the runner
4460

45-
New runner registration process [](https://docs.gitlab.com/ee/architecture/blueprints/runner_tokens/)
61+
### Docker / Kubernetes
4662

47-
New default in v16.0 (May 2023)
63+
Jobs are executed in a dedicated container / pod
4864

49-
Enforcement in v16.6 (November 2023)
65+
### Image cleanup
5066

51-
Removal of old runne registration in v17.0 (May 2024)
67+
docuum [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://github.com/stepchowfun/docuum) is able to remove least recently used images
5268

5369
---
5470

5571
## Hands-On
5672

57-
Add runner to GitLab instance
58-
59-
```bash
60-
# Switch to directory for this topic
61-
cd ../160_runners
62-
63-
# Deploy GitLab runner
64-
export CI_SERVER_URL=http://gitlab.seatN.inmylab.de
65-
export REGISTRATION_TOKEN=<TOKEN>
66-
export RUNNER_EXECUTOR=docker
67-
docker compose --project-name gitlab \
68-
--file ../100_reverse_proxy/compose.yml \
69-
--file compose.yml \
70-
up -d
71-
```
73+
1. Add runner to GitLab instance: Admin Area <i class="fa-regular fa-arrow-right"></i> CI/CD <i class="fa-regular fa-arrow-right"></i> Runners <i class="fa-regular fa-arrow-right"></i> New instance runner
74+
75+
1. Configure runner: Check "Run untagged jobs"
76+
77+
1. Start runner (substitute token below)
78+
79+
```bash
80+
# Switch to directory for this topic
81+
cd ../160_runners
82+
83+
# Deploy GitLab runner
84+
export CI_SERVER_URL=http://gitlab.seatN.inmylab.de
85+
export REGISTRATION_TOKEN=<TOKEN>
86+
export RUNNER_EXECUTOR=docker
87+
docker compose --project-name gitlab \
88+
--file ../100_reverse_proxy/compose.yml \
89+
--file compose.yml \
90+
up -d
91+
```
92+
93+
<!-- .element: style="width: 35em;" -->

150_gitlab/165_cache/slides.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Cache
2+
3+
XXX

150_gitlab/170_monitoring/slides.md

+19-15
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,36 @@
1010

1111
<i class="fa-duotone fa-monitor-waveform fa-4x fa-duotone-colors" style="float: right;"></i>
1212

13-
GitLab ships with Prometheus and Grafana included [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/omnibus/settings/grafana.html)
13+
GitLab ships with Prometheus [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/omnibus/settings/grafana.html)
1414

15-
All components expose metrics
15+
Grafana was removed in 16.0 (May 2023)
1616

17-
Grafana ships with custom dashboards
17+
All components expose metrics
1818

19-
### Hands-On
19+
GitLab provides custom dashboards for import into Grafana [](https://gitlab.com/gitlab-org/grafana-dashboards)
2020

21-
1. Enable link to integrated Grafana (Menu <i class="fa-regular fa-arrow-right"></i> Admin <i class="fa-regular fa-arrow-right"></i> Settings <i class="fa-regular fa-arrow-right"></i> Metrics and profiling <i class="fa-regular fa-arrow-right"></i> Metrics - Grafana)
21+
---
2222

23-
1. Go to Grafana (Menu <i class="fa-regular fa-arrow-right"></i> Admin <i class="fa-regular fa-arrow-right"></i> Monitoring <i class="fa-regular fa-arrow-right"></i> Metrics Dashboard)
23+
## Hands-On
2424

25-
1. Log in to Grafana using GitLab
25+
1. Start Grafana next to GitLab
2626

27-
--
27+
```bash
28+
docker compose \
29+
--project-name gitlab \
30+
--file ../100_reverse_proxy/compose.yml \
31+
--file ../160_runner/compose.yml \
32+
--file ./compose.yml \
33+
up -d
34+
```
2835

29-
## If SSO to Grafana fails
36+
1. Create datasource of type Prometheus with URL `http://gitlab:9090`
3037

31-
1. Reset password for Grafana [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/omnibus/settings/grafana.html#resetting-the-admin-password):
38+
1. Import dashboard with ID 5774 [](https://grafana.com/grafana/dashboards/5774-gitlab-omnibus/)
3239

33-
```bash
34-
docker compose --project-name gitlab exec gitlab \
35-
gitlab-ctl set-grafana-password
36-
```
40+
1. Add link to Grafana: Admin Area <i class="fa-regular fa-arrow-right"></i> Settings <i class="fa-regular fa-arrow-right"></i> Metrics and profiling <i class="fa-regular fa-arrow-right"></i> Metrics - Grafana
3741

38-
1. Log in to Grafana with user `admin` and your password
42+
1. Find link under: Admin Area <i class="fa-regular fa-arrow-right"></i> Monitoring <i class="fa-regular fa-arrow-right"></i> Metrics Dashboard
3943

4044
---
4145

2023-11-23_heise-GitLab-Ops.html

+4-8
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@
6666
| From | To | What |
6767
|-------|-------|-------------------------------------------------------|
6868
| 09:00 | | Let's roll <i class="fa-solid fa-rabbit-running"></i> |
69-
| 10:45 | 11:00 | Coffee Break <i class="fa-solid fa-mug-hot"></i> |
69+
| 10:00 | 10:15 | Coffee Break <i class="fa-solid fa-mug-hot"></i> |
70+
| 11:15 | 11:30 | Coffee Break <i class="fa-solid fa-mug-hot"></i> |
7071
| 12:30 | 13:30 | Lunch Break <i class="fa-solid fa-pot-food"></i> |
71-
| 15:00 | 15:15 | Coffee Break <i class="fa-solid fa-mug-hot"></i> |
72+
| 14:30 | 14:45 | Coffee Break <i class="fa-solid fa-mug-hot"></i> |
73+
| 15:45 | 16:00 | Coffee Break <i class="fa-solid fa-mug-hot"></i> |
7274
| | 17:00 | The End <i class="fa-solid fa-flag-checkered"></i> |
7375

7476
---
@@ -170,12 +172,6 @@
170172

171173
2023-11-30 / 2023-11-07: Workshop [GitLab CI](https://heise-academy.de/schulungen/cicd-gitlab) (2 days)
172174
</textarea></section>
173-
174-
<section data-markdown="" data-separator="^---$" data-separator-vertical="^--$"><textarea data-template="">
175-
## Links
176-
177-
https://to-be-continuous.gitlab.io/
178-
</textarea></section>
179175
</div>
180176
</div>
181177

0 commit comments

Comments
 (0)