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.
- New config check
gitlab.checkConfig.ingress.apiVersion(templates/_checkConfig_ingress.tpl, registered intemplates/_checkConfig.tpl). It fails when any IngressapiVersionis not in the allow-list (networking.k8s.io/v1). It coversglobal.ingress,registry.ingress,gitlab.{webservice,kas,gitlab-pages}.ingress,gitlab.webservice.extraIngress, and eachgitlab.webservice.deployments.*.{ingress,extraIngress}. It reports every bad setting by full path in one message, and runs whether or not Ingress is enabled. - v1beta1 rendering paths removed.
gitlab.ingress.pathBackendrenders only the v1 shape (pathTypeplusservice.name/service.port.number). It's used by pages, registry, KAS (main, gRPC, workspaces) and webservice (main, extra, smartcard).ingress.class.annotationandwebservice.geo.ingress.class.annotationare removed (they only renderedkubernetes.io/ingress.classfor non-v1).ingress.class.fieldandwebservice.geo.ingress.class.fieldno longer branch onapiVersion.gitlab.ingress.apiVersionstays the source of everyapiVersion:field, including the KAS workspaces Ingresses. Supporting a future version means adding it to the allow-list and the backend shape.
webservice.datamodel.blankcarriesapiVersion, so the documentedgitlab.webservice.ingress.apiVersion/extraIngress.apiVersiontake effect. A per-deployment value still takes precedence.- 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 explicitnetworking.k8s.io/v1. spec/configuration/ingress_spec.rbdrops the v1beta1 expectations. Its ingress class table no longer has theapiVersionand annotation columns, and asserts thatkubernetes.io/ingress.classis never rendered.doc/charts/globals.mdand the webservice, KAS, Pages and registry docs state thatnetworking.k8s.io/v1is the only accepted value.
- The check's tests live in
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.
Related issues
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) andrubocopon both files pass locally.
Reviewers checklist
- As soon as you begin reviewing, select Start a review on your first comment so the MR shows Reviewer started review.
- MR has a green pipeline on https://gitlab.com/gitlab-org/charts/gitlab.
- Consider downstream impact to the Operator, as per evaluating impact from changes to GitLab chart.