From a6aff700ef34c204d5c337d690e66cf08cfc808b Mon Sep 17 00:00:00 2001 From: David Hiendl Date: Fri, 23 Sep 2022 22:30:15 +0200 Subject: [PATCH] made docker-machine options configurable, restructured chart values --- charts/gitlab-runner-hetzner-autoscale/Chart.yaml | 2 +- .../templates/config.yaml | 14 +++++++------- charts/gitlab-runner-hetzner-autoscale/values.yaml | 14 +++++++++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/charts/gitlab-runner-hetzner-autoscale/Chart.yaml b/charts/gitlab-runner-hetzner-autoscale/Chart.yaml index a2098cc..df75d7d 100755 --- a/charts/gitlab-runner-hetzner-autoscale/Chart.yaml +++ b/charts/gitlab-runner-hetzner-autoscale/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: gitlab-runner-hetzner-autoscale name: gitlab-runner-hetzner-autoscale -version: 0.0.2 +version: 0.0.3 appVersion: v0.1 keywords: - gitlab-runner diff --git a/charts/gitlab-runner-hetzner-autoscale/templates/config.yaml b/charts/gitlab-runner-hetzner-autoscale/templates/config.yaml index 6e5129d..d78e674 100644 --- a/charts/gitlab-runner-hetzner-autoscale/templates/config.yaml +++ b/charts/gitlab-runner-hetzner-autoscale/templates/config.yaml @@ -10,8 +10,8 @@ type: Opaque stringData: - REGISTRATION_TOKEN: {{ .Values.registrationToken | quote }} - CI_SERVER_URL: {{ .Values.ciServerUrl | quote }} + REGISTRATION_TOKEN: {{ .Values.runner.registrationToken | quote }} + CI_SERVER_URL: {{ .Values.runner.ciServerUrl | quote }} register.sh: | {{ .Files.Get "files/register.sh" | indent 4 | trim }} @@ -28,7 +28,7 @@ stringData: [[runners]] name = "test-runner" - url = "https://gitlab.com/" + url = "{{ .Values.runner.ciServerUrl }}" pre_clone_script = "eval \"$CI_PRE_CLONE_SCRIPT\"" executor = "docker+machine" environment = [ @@ -65,16 +65,16 @@ stringData: MachineOptions = [ "hetzner-api-token={{ .Values.hetznerApiToken }}", # "hetzner-image-id=32116616", - "hetzner-image=ubuntu-20.04", + "hetzner-image={{ .Values.hetzner.image }}", # "hetzner-image=debian-10", - "hetzner-server-location=ash", - "hetzner-server-type=cpx21", + "hetzner-server-location={{ .Values.hetzner.serverLocation }}", + "hetzner-server-type={{ .Values.hetzner.serverType }}", # see for available versions: https://github.com/rancher/install-docker/tree/master/dist # "engine-install-url=https://releases.rancher.com/install-docker/19.03.15.sh" # "engine-install-url=https://s3.eu-central-1.wasabisys.com/dhswt-public/scripts/noop.sh" # "engine-install-url=https://raw.githubusercontent.com/davidhiendl/gitlab-runner-hetzner-autoscale/master/chart/install-scripts/hetzner-ubuntu-docker-fastinstall.sh" # "engine-install-url=https://s3.eu-central-1.wasabisys.com/dhswt-public/scripts/hetzner-ubuntu-docker-fastinstall.sh" - "engine-install-url=https://raw.githubusercontent.com/davidhiendl/gitlab-runner-hetzner-autoscale/master/charts/gitlab-runner-hetzner-autoscale/install-scripts/hetzner-ubuntu-docker-fastinstall.sh" + "engine-install-url={{ .Values.hetzner.engineInstallUrl }}" ] OffPeakTimezone = "" OffPeakIdleCount = 0 diff --git a/charts/gitlab-runner-hetzner-autoscale/values.yaml b/charts/gitlab-runner-hetzner-autoscale/values.yaml index be9eba7..6fe6acb 100644 --- a/charts/gitlab-runner-hetzner-autoscale/values.yaml +++ b/charts/gitlab-runner-hetzner-autoscale/values.yaml @@ -1,8 +1,16 @@ image: ghcr.io/davidhiendl/gitlab-runner-hetzner-autoscale:master pullPolicy: Always -registrationToken: "" -ciServerUrl: "https://gitlab.com/" -hetznerApiToken: "" + +hetzner: + apiToken: + engineInstallUrl: "https://raw.githubusercontent.com/davidhiendl/gitlab-runner-hetzner-autoscale/master/charts/gitlab-runner-hetzner-autoscale/install-scripts/hetzner-ubuntu-docker-fastinstall.sh" + serverType: "cpx21" + serverLocation: "nbg1" + image: "ubuntu-20.04" + +runner: + registrationToken: "" + ciServerUrl: "https://gitlab.com/" resources: requests: