GitLab Helm subcharts

The GitLab Helm chart is made up of multiple subcharts, which provide the core GitLab components:

The parameters for each subchart must be under the gitlab key. For example, GitLab Shell parameters would be similar to:

gitlab:
  gitlab-shell:
    ...

Use these charts for optional dependencies:

Use these charts as optional additions:

GitLab Helm subchart optional parameters

affinity

History
  • Introduced in GitLab 17.3 (Charts 8.3) for all GitLab Helm subcharts except webservice and sidekiq.

affinity is an optional parameter in all GitLab Helm subcharts. When you set it, it takes precedence over the global affinity value. For more information about affinity, see the relevant Kubernetes documentation.

note
The webservice and sidekiq Helm charts can only use the global affinity value. Follow issue 25403 to learn when the local affinity is implemented for webservice and sidekiq.

With affinity, you can set either or both:

  • podAntiAffinity rules to:
    • Not schedule pods in the same domain as the pods that match the expression corresponding to the topology key.
    • Set two modes of podAntiAffinity rules: required (requiredDuringSchedulingIgnoredDuringExecution) and preferred (preferredDuringSchedulingIgnoredDuringExecution). Using the variable antiAffinity in values.yaml, set the setting to soft so that the preferred mode is applied or set it to hard so that the required mode is applied.
  • nodeAffinity rules to:
    • Schedule pods to nodes that belong to a specific zone or zones.
    • Set two modes of nodeAffinity rules: required (requiredDuringSchedulingIgnoredDuringExecution) and preferred (preferredDuringSchedulingIgnoredDuringExecution). When set to soft, the preferred mode is applied. When set to hard, the required mode is applied. This rule is implemented only for the registry chart and the gitlab chart alongwith all its subcharts except webservice and sidekiq.

nodeAffinity only implements the In operator.

The following example sets affinity, with both nodeAffinity and antiAffinity set to hard:

nodeAffinity: "hard"
antiAffinity: "hard"
affinity:
  nodeAffinity:
    key: "test.com/zone"
    values:
    - us-east1-a
    - us-east1-b
  podAntiAffinity:
    topologyKey: "test.com/hostname"