sorry that my response is not helpful for you. I googled the variables myself landing in the docs, and thought the table above would be a good pointer since you did not mention it in your post.
Let’s dive a little deeper into the context from the docs.
The max amount the CPU allocation can be written to for build containers. When empty, it disables the cpu limit overwrite feature.
Taking a step back, and following the Kubernetes docs on assigning CPU resources Assign CPU Resources to Containers and Pods | Kubernetes
If you do not specify a CPU limit
If you do not specify a CPU limit for a Container, then one of these situations applies:
- The Container has no upper bound on the CPU resources it can use. The Container could use all of the CPU resources available on the Node where it is running.
- The Container is running in a namespace that has a default CPU limit, and the Container is automatically assigned the default limit. Cluster administrators can use a LimitRange to specify a default value for the CPU limit.
With a CPU limit in place, the container still sees the available resources on the node. If the application is designed in a way that it may consume all available resources. That’s where the requests value comes to action.
The GitLab Runner and its Kubernetes Executor allow you to specify these limits in .gitlab-ci.yml as CI/CD variables, giving the user a way of defining the pod resources.
In order to prevent abuse or overcommitment leading to killed pods, the max allowed setting the runner’s config.toml ensures an administrative limit. This cannot be overridden by the user in .gitlab-ci.yml
The values for these variables are restricted to the max overwrite setting for that resource.
If you are interested in how it is implemented, the source code of
gitlab-org/gitlab-runner provides more insights. There are comparison functions which ensure that the configured cpu, memory and ephemeral storage values are not bigger than the max overwrite values in config.toml.
The implementation reminds me of how rlimit() is available in libc, specifying a max value which cannot be overridden from the user side. Limits on Resources (The GNU C Library)
The documentation for the executer is at docs/executors/kubernetes.md · main · GitLab.org / gitlab-runner · GitLab - if you see things to update/make more clear from this topic, please go ahead with a merge request