https://github.com/brndnmtthws/gitlab-gce-autoscaler
Simple GCE autoscaler for GitLab CI pipelines
https://github.com/brndnmtthws/gitlab-gce-autoscaler
autoscaler gce gitlab-ci
Last synced: 4 months ago
JSON representation
Simple GCE autoscaler for GitLab CI pipelines
- Host: GitHub
- URL: https://github.com/brndnmtthws/gitlab-gce-autoscaler
- Owner: brndnmtthws
- License: unlicense
- Created: 2019-03-08T23:29:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T13:14:25.000Z (over 5 years ago)
- Last Synced: 2025-02-17T20:40:34.195Z (over 1 year ago)
- Topics: autoscaler, gce, gitlab-ci
- Language: Python
- Size: 23.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/brndnmtthws/gitlab-gce-autoscaler) [](https://badge.fury.io/py/gitlab-gce-autoscaler)
# GitLab GCE Autoscaler
A very simple autoscaler for GitLab CI on GCE
## Features
- watches a GitLab pipeline for queued jobs
- scales a GCE instance group to meet demand
That's it 😄
## Synopsis
```ShellSession
$ gitlab-gce-autoscaler --help
Usage: gitlab-gce-autoscaler [OPTIONS]
Options:
--project-id TEXT GCE project ID
--gce-zone TEXT GCE zone
--gce-instance-group-name TEXT Name of GCE instance group [required]
--job-filter TEXT Filter job names by this comma separated
list of keywords
--interval INTEGER Interval (in seconds) to poll GitLab API
--gitlab-project-ids TEXT Comma separate list of GitLab projects IDs
to poll for jobs [required]
--gitlab-personal-token TEXT GitLab API token [required]
--slots-per-instance INTEGER Target number of slots per instance
--help Show this message and exit.
```
## Helm Chart
There's a Helm chart included in the repo. To use it, you'll need to create a service account on GCE with the following permissions:
- `compute.instanceGroupManagers.get`
- `compute.instanceGroupManagers.update`
Then, create a secret with the service account credentials:
```ShellSession
$ kubectl create secret generic gitlab-gce-autoscaler --from-file=service-account-creds.json=service-account.json
secret/gitlab-gce-autoscaler created
```
Now install the chart:
```ShellSession
$ helm upgrade --install gitlab-gce-autoscaler helm/gitlab-gce-autoscaler -f myvalues.yaml
```