In this MR we added a Node_Selector overwrite feature to the Kubernetes executor. This is a very valuable feature as it simplifies various CI job execution use cases. For example, you can have one GitLab Runner on Kubernetes that seamlessly handles jobs for Windows and Linux OS.
Tasks
Create a documentation entry that describes the value and now to use this feature.
Darren Eastmanchanged title from Create documentation entry for the NodeSelector Overwite to Create documentation entry for the NodeSelector Overwrite feature in the runner K8s executor
changed title from Create documentation entry for the NodeSelector Overwite to Create documentation entry for the NodeSelector Overwrite feature in the runner K8s executor
Hi @ratchade Looking at this issue description it looks like this feature was developed for the Kubernetes executor, would you be best placed to provide an initial documentation draft for this feature? I'm thinking a section would work well in the Kubernetes executor page, WDYT?
Hey @fneill apologies for the delay to get back to you
I had a look at the Kubernetes Executor page and it seems like we already have a documentation highlighting the fact that nodeSelector can be used to handle job on both Windows and Linux OS.
The Link is accessible through the description of the node_selector property Read more about using node selectors
| node_selector | A table of key=value pairs in the format of string=string (string:string in the case of environment variables). Setting this limits the creation of pods to Kubernetes nodes matching all the key=value pairs. Read more about using node selectors. |
@ratchade Here is the context from the original Slack thread.
" Hey Folks! I met with a customer interested in some guidance on setting up their kubernetes cluster for properly building multiarch container images. I found this recently published blog post: https://arborxr.com/blog/developers-journal-building-unprivileged-multi-arch-images-with-kaniko-and-gitlab-ci/ that references this undocumented config option node_selector_overwrite_allowed. Could someone have a look to see if that blog post has good recommendations and if the recently added config option should be documented in our own docs so our customers know how to use it?"
In the blog post the writer makes the following point, "my first thought was that we needed two Gitlab Runners: one tagged for amd64 and one tagged for arm64. As it turns out, Gitlab very recently merged an amazing feature that is still undocumented. The feature allows you to set a config option in your config.toml that allows any Gitlab CI job to overwrite node selectors for your runner."
So while our docs has a node_selector entry, there should be more context added to the opening paragraph as to why this feature is useful. It can be somewhat implied by the listed examples, but its still not very obvious how valuable this feature is.