Skip to content

Revert "Favor GitLab's nodeSelectors instead nginx-ingress"

Mitchell Nielsen requested to merge revert-nginx-nodeselectors into master

What does this MR do?

Reverts !2267 (785d893d), which caused unexpected changes to NGINX's nodeSelector setting.

NGINX now sets a default nodeSelector (kubernetes.io/os=linux), which shouldn't cause an issue:

  • GKE, EKS, OCP nodes all set that node label by default
  • Non-Linux nodes are not supported anyway

That said, because of how the template is configured, those default values prevent the 'gitlab.nodeSelector' template from being evaluated. That means 'global.nodeSelector' values, if configured, will never appear on NGINX Deployments. For that reason, we disable the new default labels by commenting them out in the NGINX values.yaml file.

In the future, we could consider either:

  • Merging the locally-set nodeSelectors with those coming from the gitlab.nodeSelector template
  • Or, adoping the `kubernetes.io/os=linux' default nodeSelector across all charts

Related issues

Testing

Defaults

Leads to:

...
      nodeSelector:
        kubernetes.io/os: linux
...

Setting local nodeSelector

nginx-ingress:
  controller:
    nodeSelector:
      nginxlocal: nginxlocal

... leads to:

...
      nodeSelector:
        kubernetes.io/os: linux
        nginxlocal: nginxlocal
...

Setting global nodeSelector

global:
  nodeSelector:
    global: global

... leads to:

...
      nodeSelector:
        global: global
...

Setting global and local nodeSelector

Because the template evaluates the gitlab.nodeSelector template only if no local nodeSelector is configured, the local setting will always "win". We could consider merging the values rather than picking either/or, but that can be discussed in a separate issue if needed.

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • Merge Request Title and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for omnibus-gitlab opened
Edited by Mitchell Nielsen

Merge request reports

Loading