Add support for Node Selector Overwrite
What does this MR do?
Add support for overwriting Node Selector. We have this already for annotations and a few other things, but node selector does not seem to be exposed.
Why was this MR needed?
I want to have a single runner tag default to using Spot instances, however if a job cannot tolerate Spot, it should be able to set this via node selector. (maybe also specify architecture or type of compute e.g. ARM, GPU, etc.).
This will allow me to offer "Runner as a Service" internally while keeping the costs down for the typical, generic workload.
Example
stages:
- test
AWS:
stage: test
image: amazon/aws-cli
variables:
KUBERNETES_NODE_SELECTOR_SPOT: 'eks.amazonaws.com/capacityType=SPOT'
KUBERNETES_NODE_SELECTOR_ARCH: 'kubernetes.io/arch=amd64'
If the workload comes in, my Autoscaler will spin a matching node up if it does not already exist.
What's the best way to test this MR?
Added (and maybe fixed) some tests.
What are the relevant issue numbers?
CC: @sheininger
Edited by Darren Eastman