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
Copy file name to clipboardExpand all lines: tutorials/terraform-dynamic-gitlab-runner/index.mdx
+11-13Lines changed: 11 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,7 @@ import Requirements from '@macros/iam/requirements.mdx'
14
14
GitLab runners are the components that execute the jobs defined in your GitLab CI/CD pipelines. They can be installed on various operating systems and can run jobs on different platforms. Runners can be configured to be specific to a project or shared across multiple projects.
15
15
With terraform Scaleway provider and GitLab one, runners can be dynamically created and destroyed.
16
16
17
-
## Before you start
18
-
19
-
To complete the actions presented below, you must have:
17
+
<Requirements />
20
18
21
19
- A Scaleway account logged into the [console](https://console.scaleway.com)
22
20
-[Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
@@ -27,19 +25,19 @@ To complete the actions presented below, you must have:
27
25
28
26
### Gitlab setup
29
27
30
-
he following GitLab CI/CD needs 3 secret variables:
28
+
The following GitLab CI/CD needs 3 secret variables:
31
29
- GITLAB_TOKEN
32
30
- SCW_SECRET_KEY
33
31
- SCW_ACCES_KEY
34
32
35
-
The `GITLAB_TOKEN` needs to be a GitLab personal access token with the Owner role, and create_runner scope.
33
+
The `GITLAB_TOKEN` needs to be a GitLab personal access token with the **Owner** role, and `create_runner` scope.
36
34
Create the environment variables in your [project cicd settings](https://docs.gitlab.com/ci/variables/)
37
35
38
36
### terraform setup
39
37
40
-
First we have to provide a basic terraform setup:
38
+
Start by providing a basic Terraform setup:
41
39
42
-
1. Create the main.tf file:
40
+
1. Create the `main.tf` file:
43
41
```hcl
44
42
//providers
45
43
terraform {
@@ -110,7 +108,7 @@ First we have to provide a basic terraform setup :
110
108
value=gitlab_user_runner.project_runner.id
111
109
}
112
110
```
113
-
2. Create the var.tf file:
111
+
2. Create the `var.tf` file:
114
112
```hcl
115
113
variable "project_id" {
116
114
type=string
@@ -169,7 +167,7 @@ First we have to provide a basic terraform setup :
169
167
description="volume in Gb"
170
168
}
171
169
```
172
-
3. Create the cloud-init.yml file:
170
+
3. Create the `cloud-init.yml` file:
173
171
```yml
174
172
#cloud-config
175
173
package_update: true
@@ -270,7 +268,7 @@ First we have to provide a basic terraform setup :
@@ -300,12 +298,12 @@ First we have to provide a basic terraform setup :
300
298
done
301
299
```
302
300
303
-
With this setup the Gitlab-CI/CD create an instance and register it as a GitLab runner, run the work job on the instance, then delete the instance and the runner.
304
-
This setup allows you to dynamically provide highcomputation runners in a cost-effective way. You can also customize the cloud init to fit your business needs, such as connecting to your company VPN.
301
+
With this setup, GitLab-CI/CD creates an Instance and registers it as a GitLab runner, runs the workload on the Instance, then deletes the Instance and the runner.
302
+
This setup allows you to dynamically provide high-computation runners in a cost-effective way. You can also customize the cloud init to fit your business needs, such as connecting to your company's VPN.
305
303
306
304
## Going further
307
305
308
-
If you want to use a custom instance image, you can edit the `main.tf` file as bellow :
306
+
If you want to use a custom Instance image, you can edit the `main.tf` file as below:
0 commit comments