Skip to content

Draft: [Demo/test] Vendor nginx chart from K8s repo

Mitchell Nielsen requested to merge vendor-nginx-chart into master

What does this MR do?

Note: we're actively working toward a true fork in gitlab-org/distribution&19. That would allow us to easily diff between our mirror and fork to find differences in our chart, and potentially submit them upstream. Still, this MR can be helpful to see how close we can get to parity without any upstream changes.

What: Vendors the NGINX Helm Chart from the Kubernetes Helm repo, rather than using our forked / in-chart version of it.

  • Removes NGINX chart files from this repository
  • Pulls NGINX chart from ./requirements.yaml

Why: MRs like !2267 (merged) are often difficult to review and test due to their size. It would be a huge help if we could vendor the NGINX chart as we do with others.

Ideally, I'd love for this MR to find a way to make use of the vendored NGINX chart and accomplish all of the requirements we need so that future upgrades to NGINX are much easier.

I recognize we may not be able to get there given the current state of the NGINX chart - but either way, this MR can be helpful to:

  • Outline what's missing in the NGINX chart (for our unique needs, at least)
  • Serve as a historical record that we've attempted to make this easier

Related issues

Related to #2971 (moved)

Two potential options

We have a couple potential approaches here:

  1. "Fork" the chart from GitHub to GitLab and maintain our changes in the GitLab "fork"
    • As far as I know, this "fork" would have to be a manual process (check out our desired version from GitHub, and push it to GitLab)
    • Bringing in changes would be a bit more involved as this would not be a true "fork" - we'd need to check out the target version from GitHub, and push it as a separate branch to GitLab and open an MR
  2. Submit our changes to upstream (https://github.com/kubernetes/ingress-nginx)
    • To me, this is the ideal solution as long as we can make our changes not specific to GitLab.

Changes required in upstream NGINX chart

Original changes from https://docs.gitlab.com/charts/charts/nginx/fork.html:

  • tcp-configmap.yaml: is optional depending on new tcpExternalConfig setting
  • Ability to use a templated TCP ConfigMap name from another chart
    • controller-configmap-tcp.yaml: .metadata.name is a template ingress-nginx.tcp-configmap
    • controller-deployment.yaml: .spec.template.spec.containers[0].args uses ingress-nginx.tcp-configmap template for ConfigMap name
    • GitLab chart overrides ingress-nginx.tcp-configmap so that gitlab/gitlab-org/charts/gitlab-shell can configure its TCP service
  • Ability to use a templated Ingress name based on the release name
    • controller-deployment.yaml: .spec.template.spec.containers[0].args uses ingress-nginx.controller.ingress-class
  • Replace controller.service.loadBalancerIP with global.hosts.externalIP
  • Added support to add common labels through common.labels configuration option
  • controller-deployment.yaml:
    • Disabled the use of nginx-ingress.controller.nodeSelector value
    • Add podlabels and global.pod.labels to .spec.template.metadata.labels
  • default-backend-deployment.yaml:
    • Disable the use of nginx-ingress.defaultbackend.nodeSelector value
    • Add podlabels and global.pod.labels to .spec.template.metadata.labels

Additional changes

  • GitLab Shell ports are provided in Controller Service, Deployment, and Daemonset

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