Draft: Add global.clusterless to render the chart without cluster objects
What does this MR do?
This is the render switch asked about in pathway 3 of https://gitlab.com/gitlab-org/omnibus-gitlab/-/work_items/10238 (@clemensbeck).
A single host that runs the chart's rendered manifests directly has no cluster to act on Services, HorizontalPodAutoscalers or PodDisruptionBudgets, and no cluster DNS to resolve a Service name.
global.clusterless.enabled makes the chart's own templates render none of those three kinds, nor ServiceMonitors, PodMonitors or KEDA ScaledObjects. gitlab.assembleServiceAddress returns the workload name alone, and each Deployment that has a Service by default sets hostname to its own name, so the pod's hostname equals the address. The host must resolve pod hostnames, because the chart makes no DNS record. The key is off by default.
The Gateway, HTTPRoutes, TCPRoute, BackendTLSPolicies and Ingress route to Services that are not rendered, and Praefect's StatefulSet pods are not named after its address. With the key on, the chart fails when global.gatewayApi.enabled, global.ingress.enabled or global.praefect.enabled is set, or a chart sets its own ingress.enabled or gatewayRoute.enabled. The bundled third-party subcharts (cert-manager, Envoy Gateway, Prometheus) build their own objects and are not covered. doc/charts/globals.md says to disable them with their own values.
flowchart LR
V[values] --> S{global.clusterless<br/>.enabled}
S -- unset or false --> D[Deployments, StatefulSets, Jobs,<br/>Service, HPA, PDB<br/>addresses: name.namespace.svc]
S -- true --> C[Deployments, StatefulSets, Jobs<br/>no Service, HPA, PDB<br/>addresses: pod hostname<br/>pod hostname set]Behaviour
helm template, master against this branch:
| Values | Output |
|---|---|
108 values files from CI and examples/, on the spec defaults |
identical to master |
| Pages, Praefect, Mailroom, KAS and workspaces on | identical to master |
With the key on and Gateway API, Ingress and Praefect off, the chart-owned Services, HorizontalPodAutoscalers and PodDisruptionBudgets drop from 17 (default) and 25 (all components) to 0. The remaining 5 Services belong to the subcharts above. All 108 values files render with the key on and those three off.
global.clusterless is a commented entry in values.yaml, so the render is unchanged. Setting an enabled: false key would change the hashed Job names.
Related issues
https://gitlab.com/gitlab-org/omnibus-gitlab/-/work_items/10238
Tests
spec/configuration/clusterless_spec.rb adds 19 examples for the key unset, false and true. Each of the Praefect, Gateway API, Ingress and per-chart override checks, and the KEDA and monitoring gates, fails a spec when removed. With the cluster domain, HPA, PDB, KEDA and monitoring specs, 49 examples pass.
An AI coding assistant wrote this change. The assistant also ran the helm template comparisons above and the six spec files. No install on a cluster was run.
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. Not yet run.
- Documentation created/updated:
doc/charts/globals.md. - Tests added/updated.
- Have you validated that your change works end-to-end on a real cluster deployment? Not done. With the key off the render is byte-identical, so a cluster install is unchanged. With it on the target has no cluster.
- Describe how you did it in a comment: not applicable.
- Equivalent MR/issue for omnibus-gitlab opened: not applicable. Omnibus has no Service, HPA or PDB to omit.
- When ready for review, MR is marked as ready (not a draft) and assigned to a reviewer: after Duo.
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. If the change needs a newer Operator, raise
gitlab.com/minOperatorVersioninChart.yamlto the first Operator release that supports it.