You want to use Google’s Autopilot for your gitlab runners, but your job/builds fail because of low resources (ie ephemeral storage).
You can use a limit range to increase the limits for ephemeral storage or/and memory that will make Google’s autopilot to use them and scale them appropriately.
Create a limit range file like:
And then apply it to your cluster
kubectl -n namespace apply -f limit_range.yaml
To change this in your gitlab-runner configuration, depends on the version of your gitlab-runner as described in https://docs.gitlab.com/runner/configuration/feature-flags.html
If you version is 13.9.0 (gitlab-runner –version), then add the following in ~/.gitlab-runner/config.toml
name = "gitlab-runner-name"
request_concurrency = 1
url = "https://git.url.test/"
token = "xckaxxxxxxxx"
executor = "kubernetes"
environment = ["FF_GITLAB_REGISTRY_HELPER_IMAGE=1"]
Trying to use the usual way of adding Gitlab’s key to the ssh agent, is not working in alpine image (but it works in debian/ubuntu), and you get the following error message:
- ssh-add <(echo "$GITLABCICD_PRIVATE_KEY")
/bin/sh: syntax error: unexpected "("
Try to use the following instead:
- echo "$GITLABCICD_PRIVATE_KEY" | ssh-add -
Gitlab has some predefined variables that can be used in the CI/CD scripts.
The full list of the variables can be found here: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
To use the build directory variable you need to use the