mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(gitlab/runners): improve docker-autoscaler management
This commit is contained in:
@@ -171,27 +171,43 @@ The manager will connect to the instances via SSH and execute Docker commands. T
|
||||
able to execute those commands commands (most likely by being part of the `docker` group on the instances).
|
||||
|
||||
Container images are pulled by the manager and sent to the instances it creates.<br/>
|
||||
The instances do not require container registry access themselves this way.
|
||||
The instances do **not** require container registry access themselves this way.
|
||||
|
||||
Add the following settings in the `config.toml` file:
|
||||
<details>
|
||||
<summary>Setup</summary>
|
||||
|
||||
```toml
|
||||
[[runners]]
|
||||
executor = "docker-autoscaler"
|
||||
1. Configure the default region for the SDK to use in the runner executor user's related file.<br/>
|
||||
Adding it as environment variable in the runner's configuration file does **not** work.
|
||||
|
||||
[runners.docker]
|
||||
image = "busybox:latest" # or whatever
|
||||
<details style="padding-bottom: 1em;">
|
||||
<summary>AWS</summary>
|
||||
|
||||
[runners.autoscaler]
|
||||
plugin = "aws:latest" # or 'googlecloud' or 'azure' or whatever
|
||||
`$HOME/.aws/config`
|
||||
|
||||
[runners.autoscaler.plugin_config]
|
||||
name = "…" # see plugin docs
|
||||
```ini
|
||||
[default]
|
||||
region = eu-west-1
|
||||
```
|
||||
|
||||
[[runners.autoscaler.policy]]
|
||||
idle_count = 5
|
||||
idle_time = "20m0s"
|
||||
```
|
||||
</details>
|
||||
|
||||
1. Add at least the following in the runner's `config.toml` file:
|
||||
|
||||
```toml
|
||||
[[runners]]
|
||||
executor = "docker-autoscaler"
|
||||
|
||||
[runners.docker]
|
||||
image = "busybox:latest" # or whatever
|
||||
|
||||
[runners.autoscaler]
|
||||
plugin = "aws:latest" # or 'googlecloud' or 'azure' or whatever
|
||||
|
||||
[runners.autoscaler.plugin_config]
|
||||
name = "…" # see plugin docs
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Example: AWS, 1 instance per job, 5 idle instances for 20min.</summary>
|
||||
@@ -322,18 +338,6 @@ Procedure:
|
||||
|
||||
</details>
|
||||
|
||||
This could probably just be configured in the executor's setting, but I still need to confirm it.
|
||||
|
||||
<details style="margin-top: -1em; padding-bottom: 1em;">
|
||||
|
||||
```toml
|
||||
[[runners]]
|
||||
executor = "docker-autoscaler"
|
||||
environment = [ "AWS_REGION=eu-west-1" ]
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
1. Install the gitlab runner on the **manager** instance.
|
||||
1. Configure the runner to use the `docker-autoscaler` executor.
|
||||
|
||||
|
||||
@@ -32,6 +32,12 @@ gitlab-runner verify -c '/etc/gitlab-runner/config.toml'
|
||||
# Also delete runners that have been removed from the main instance
|
||||
gitlab-runner verify … --delete
|
||||
|
||||
# Unregister runners
|
||||
gitlab-runner unregister --name 'some-runner'
|
||||
gitlab-runner unregister --token 'abcdefghij0123456789'
|
||||
gitlab-runner unregister --all-runners
|
||||
curl -fsX 'DELETE' 'https://gitlab.com/api/v4/runners/2207' -H 'PRIVATE-TOKEN: glpat-m-…'
|
||||
|
||||
# Unregister offline runners
|
||||
curl -fs 'https://gitlab.com/api/v4/runners/all?status=offline&per_page=100' -H 'PRIVATE-TOKEN: glpat-m-…' \
|
||||
| jq '.[].id' \
|
||||
|
||||
Reference in New Issue
Block a user