Accept only networking.k8s.io/v1 for Ingress apiVersion

What does this MR do?

Follow-up to !5423 (merged), addressing the review findings in !5423 (comment 4103931454) and the direction in !5536 (comment 4117521569).

Legacy Ingress apiVersions were removed in Kubernetes 1.22, and every Kubernetes version the chart supports serves only networking.k8s.io/v1. A legacy override already produced objects the cluster rejects, so the chart now accepts only supported versions and drops the v1beta1 rendering paths.

  1. New config check gitlab.checkConfig.ingress.apiVersion (templates/_checkConfig_ingress.tpl, registered in templates/_checkConfig.tpl). It fails when any Ingress apiVersion is not in the allow-list (networking.k8s.io/v1). It covers global.ingress, registry.ingress, gitlab.{webservice,kas,gitlab-pages}.ingress, gitlab.webservice.extraIngress, and each gitlab.webservice.deployments.*.{ingress,extraIngress}. It reports every bad setting by full path in one message, and runs whether or not Ingress is enabled.
  2. v1beta1 rendering paths removed.
    • gitlab.ingress.pathBackend renders only the v1 shape (pathType plus service.name/service.port.number). It's used by pages, registry, KAS (main, gRPC, workspaces) and webservice (main, extra, smartcard).
    • ingress.class.annotation and webservice.geo.ingress.class.annotation are removed (they only rendered kubernetes.io/ingress.class for non-v1). ingress.class.field and webservice.geo.ingress.class.field no longer branch on apiVersion.
    • gitlab.ingress.apiVersion stays the source of every apiVersion: field, including the KAS workspaces Ingresses. Supporting a future version means adding it to the allow-list and the backend shape.
  3. webservice.datamodel.blank carries apiVersion, so the documented gitlab.webservice.ingress.apiVersion / extraIngress.apiVersion take effect. A per-deployment value still takes precedence.
  4. Specs and docs.
    • The check's tests live in spec/integration/check_config/ingress_spec.rb. A table test checks that each of the 8 settings fails with a legacy value and is the only one named, including when Ingress is disabled. Other cases cover several bad settings in one message, and passing with an explicit networking.k8s.io/v1.
    • spec/configuration/ingress_spec.rb drops the v1beta1 expectations. Its ingress class table no longer has the apiVersion and annotation columns, and asserts that kubernetes.io/ingress.class is never rendered.
    • doc/charts/globals.md and the webservice, KAS, Pages and registry docs state that networking.k8s.io/v1 is the only accepted value.

The default output (networking.k8s.io/v1) doesn't change. Configs that set a legacy Ingress apiVersion now fail to render. Those configs couldn't deploy on a supported cluster anyway. The new commit carries a Changelog: changed trailer.

!5423 (merged)

Author checklist

For general guidance, please follow our Contributing guide.

Required

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

  • Merge Request Title and Description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline.
  • Documentation created/updated.
  • Tests added/updated.
  • Have you validated that your change works end-to-end on a real cluster deployment?
    • Describe how you did it in a comment.
  • Equivalent MR/issue for omnibus-gitlab opened. (N/A)
  • When ready for review, MR is marked as ready (not a draft) and assigned to a reviewer.

Note: bundle exec rspec spec/configuration/ingress_spec.rb spec/integration/check_config/ingress_spec.rb (49 examples, 0 failures) and rubocop on both files pass locally.

Reviewers checklist

Edited by Lucas Li

Merge request reports

Loading
Loading