Skip to content

add `runners.kubernetes.node_tolerations` support to `configmap.yaml`

Blocked

Blocked untill !153 (closed) is merged. With !188 (merged) the helm chart supports node tolerations, this is just a follow up merge request that should be review/merged when !153 (closed) is merged.

Overview

add nodeTolerations under runners section in values.yaml to support runners.kubernetes.node_tolerations in configmap.yaml, more information can be found in !188 (diffs, comment 252362009) (the two merge request's change produce the same behavior on gitlab-runner. the difference is that !188 (diffs, comment 252362009) does it through passing --kubernetes-node-tolerations to gitlab-runner, where as this merge request's change does it through configuring runners.kubernetes.node_tolerations in config.toml.template section in configmap.yaml)

Testing

helm template <gitlab-runner-helmcharts repo> -f <values.yaml> -x templates/configmap.yaml

check the [runners.kubernetes.node_tolerations] section

below are two example output

➜  helm template ./gitlab-runner-helmcharts -f ~/fairfax/gitlab-pipeline/k8s/helm/gitlab-runner/values-spot.yaml -x templates/configmap.yaml
---
# Source: gitlab-runner/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: release-name-gitlab-runner
  labels:
    app: release-name-gitlab-runner
    chart: gitlab-runner-0.9.0-beta
    release: "release-name"
    heritage: "Tiller"
data:
...
  config.template.toml: |
...

        [runners.kubernetes.node_selector]
          "newsnow.io/application" = "gitlab-runner"
          "newsnow.io/application-group" = "ci"

        [runners.kubernetes.node_tolerations]
          "newsnow.io/application=gitlab-runner" = "NoExecute"
          "newsnow.io/stability=spot" = "NoSchedule"

        [runners.kubernetes.pod_labels]
➜  helm template ./gitlab-runner-helmcharts -f ~/fairfax/gitlab-pipeline/k8s/helm/gitlab-runner/values-on-demand.yaml -x templates/configmap.yaml
---
# Source: gitlab-runner/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: release-name-gitlab-runner
  labels:
    app: release-name-gitlab-runner
    chart: gitlab-runner-0.9.0-beta
    release: "release-name"
    heritage: "Tiller"
data:
...
  config.toml: |
    concurrent = 10
    check_interval = 30
    log_level = "info"
    listen_address = '[::]:9252'
  config.template.toml: |
...

        [runners.kubernetes.node_selector]
          "newsnow.io/application" = "gitlab-runner"
          "newsnow.io/application-group" = "ci"
          "newsnow.io/stability" = "on-demand"

        [runners.kubernetes.node_tolerations]
          "newsnow.io/application=gitlab-runner" = "PreferNoSchedule"
          "newsnow.io/stability=on-demand" = "PreferNoSchedule"

        [runners.kubernetes.pod_labels]

References

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading