GitLab on Kubernetes with the Helm chart or Operator

Deploying self-managed GitLab on Kubernetes means splitting stateless services from stateful ones. This page covers the layout, the decisions, the build sequence and when the Linux package is the better choice.

On this page

Should you run GitLab on Kubernetes with the Helm chart or Operator?

Run GitLab on Kubernetes only if you want the stateless components there and are prepared to keep the stateful services outside the cluster. The GitLab reference architectures do not support running PostgreSQL or Redis inside Kubernetes, so the supported pattern is the Cloud Native Hybrid layout: stateless GitLab components run as pods, while PostgreSQL, Redis and Gitaly storage run on virtual machines or managed services that you operate or buy. A platform team that already runs Kubernetes can use that cluster for the web, API, Sidekiq and similar workloads, but it should not expect the cluster to own the database or repository storage. If your plan puts PostgreSQL or Gitaly volumes in the cluster because it is convenient, stop and redo the design before any build starts.

GitLab offers several installation methods: the Linux package, which bundles PostgreSQL, Redis and Sidekiq and is described as the most mature and scalable option; the Helm chart; the GitLab Operator; Docker; and installation from source. The Helm chart and the Operator both target Kubernetes. The chart is driven by Helm values and suits teams that already manage releases with Helm and GitOps tooling. The Operator manages GitLab through Kubernetes custom resources and suits teams that want a controller reconciling the instance. Choose one based on the tooling your platform team already runs, then confirm in the current GitLab documentation which method and layout match your target release, because the two paths differ in configuration and upgrade handling.

The work is harder than it looks because the external services become your responsibility on day one: database backups, Redis failover, Gitaly storage, network paths between pods and VMs, and secrets shared across both sides. Ask any partner or internal team to write down who operates each stateful component, how it is backed up, and how an upgrade stop is planned across the cluster and the VMs. If the answer is unclear, the Linux package on virtual machines may be the better choice for your team.

Which GitLab components run on Kubernetes and which do not

The Cloud Native Hybrid layout places stateless GitLab services on Kubernetes and keeps stateful data services outside the cluster. Each component below sits on one side of that line, and the chart version you choose decides how much of the stateful layer you can point at external services.

Stateless webservice pods

The webservice runs the Rails application and serves the web UI and API, and it holds no repository data itself, so it is the natural fit for Kubernetes replicas behind an ingress. Check in the current chart documentation which webservice settings, ingress class and external URL options the chart version you plan to deploy exposes, and how it handles the shared secrets and configuration files that every pod must read.

Reference architectures

Sidekiq background workers

Sidekiq processes background jobs such as notifications, repository housekeeping requests and CI pipeline work, and it scales horizontally like other stateless components. Confirm in the chart documentation how job queue settings map to worker deployments, and whether your chosen layout keeps Sidekiq pods on Kubernetes or on separate hosts for workloads that need different node sizing.

Gitaly repository storage

Gitaly holds the Git repository data, and it needs persistent volumes with predictable performance, so placement is a storage decision as much as a compute one. Confirm in the current chart and reference architecture documentation whether Gitaly runs inside the cluster for your user count, which storage classes are supported, and how repository data is backed up and restored.

PostgreSQL database

PostgreSQL stores users, projects, merge requests and CI metadata, so losing or corrupting it affects the whole instance. The reference architecture documentation says stateful components such as PostgreSQL are not supported inside Kubernetes, so plan for a VM-based or managed PostgreSQL service, and confirm the supported version, connection settings and failover behavior in your chart release notes.

Reference architectures

Redis cache and queues

Redis holds cache and job queue data, and the reference architecture documentation says it should run outside Kubernetes in the Cloud Native Hybrid layout. Confirm which Redis topology the chart version accepts, whether Sentinel is supported for your user count, and how an external Redis endpoint and password are passed to the webservice and Sidekiq pods.

Object storage for artifacts and backups

Job artifacts, LFS objects, packages and backup archives are large and grow over time, so they usually live in object storage rather than in pod volumes. Confirm in the chart documentation which object storage backends and bucket settings it supports, how credentials are stored as Kubernetes secrets, and how these buckets are included in your backup and restore plan.

Backup and restore docs

How the Cloud Native Hybrid layout splits the workload

The diagram starts with users and CI runners sending traffic to a load balancer that feeds the GitLab stateless services running in the Kubernetes cluster. Those services hand off to stateful components that sit outside the cluster, on VMs or managed services: PostgreSQL, Redis, Gitaly storage and object storage. The trust boundary separates the cluster from those data services, so check which network paths, credentials and firewall rules cross it. Confirm the current component list and the supported external-service options against the reference architecture documentation before you size anything.

Stateless GitLab services run in Kubernetes while stateful data services stay outside the cluster.

Helm chart, GitLab Operator or Linux package: which fits your team

The Helm chart fits teams that already run Kubernetes in production and want GitLab managed with the same tooling as their other workloads. It is the method most often paired with the Cloud Native Hybrid layout, where stateless GitLab services run in the cluster and PostgreSQL, Redis and Gitaly run on virtual machines or managed services outside it. Your team owns the values files, the cluster and the upgrade sequence.

  • Cluster skills: Someone on the team should be able to troubleshoot pods, ingress, persistent volumes and Helm releases without waiting for outside help.
  • Values as code: Keep values files in version control and review changes like application code, since most configuration lives there.
  • Upgrade handling: Plan each chart upgrade against the required upgrade stops and the component versions in the release notes, because the chart version alone does not tell you the whole story.
  • External services: Point the chart at PostgreSQL, Redis and Gitaly endpoints that you operate, and test failover for those services separately.

Confirm that your platform team can support both the cluster and the external stateful services before you commit to this path.

How to build a Cloud Native Hybrid GitLab deployment step by step

This sequence moves a self-managed GitLab instance from sizing to a tested, backed-up, upgradable deployment in which stateless components run on Kubernetes and stateful services run outside the cluster. Each step closes with a check that confirms it works before the next one starts.

  1. Choose the reference architecture for your user count

    Start by matching your expected user count and API load to a GitLab reference architecture, which ranges from 1,000 users at 20 API requests per second to 50,000 users at 1,000 API requests per second. Your platform team and the architect agree on that size in writing, including whether high availability is required, since the docs generally recommend it at 3,000 or more users. Done means a signed sizing sheet that lists the node pools, the external services and the storage each one needs.

  2. Provision PostgreSQL and Redis outside the cluster

    GitLab's reference architecture documentation states that running stateful components such as PostgreSQL and Redis inside Kubernetes is not supported, so these services go on VMs or a managed service that your team operates. Create the databases, roles and Redis instances, and confirm that the sizing and high availability design matches the reference architecture. The check is a test pod in the cluster that connects to both endpoints with the production credentials and completes a query and a write.

  3. Set up Gitaly storage on dedicated hosts

    Gitaly holds the Git repository data, so it runs on dedicated hosts or volumes that the cluster reaches over the network rather than inside Kubernetes. For instances at 3,000 users or more, the high availability guidance is Gitaly Cluster with Praefect, which your team should plan at this stage. Confirm disk capacity, backup coverage and network latency with your storage team before you point the chart at these hosts. The check is a test repository created and cloned through the Gitaly endpoint from inside the cluster.

  4. Configure object storage for artifacts and backups

    Create the object storage buckets for job artifacts, LFS objects, uploads, package and registry data and backup targets, then set access keys scoped to those buckets only. Record the bucket names, endpoints and retention settings so the chart values and the backup job use the same definitions. The check is a test object written and read from each bucket by a pod using the same credentials the chart will use.

  5. Install the chart with external services in values

    Install the official GitLab Helm chart or the GitLab Operator with the PostgreSQL, Redis, Gitaly and object storage endpoints set in the values file, and disable the bundled in-cluster stateful services. Keep the values file in version control so changes are reviewed like code. The check is that all stateless pods reach Ready, the database migration job completes without errors, and the administrator can sign in with the initial credentials that you rotate immediately afterward.

  6. Set ingress and TLS for the instance

    Configure the ingress controller, the external URL and the TLS certificates, including the registry hostname if you use the container registry. Confirm that certificates renew automatically and that the internal certificate authority, if any, is trusted by runners and the other services that call GitLab. The check is a browser and a Git client that both reach the instance over HTTPS with a valid chain, and a container push to the registry endpoint succeeds.

  7. Connect identity and verify group mapping

    Connect the instance to your identity provider using the method your organization uses, such as LDAP, SAML, generic OAuth 2.0 through OmniAuth, or SCIM provisioning, and decide which groups map to which roles. Keep one local administrator account under documented break-glass controls in case the identity provider is unavailable. The check is a test user from each relevant group who signs in, receives the expected role and cannot reach administrative areas that are outside that role.

  8. Register runners and run a test pipeline

    Install GitLab Runner in a separate environment from the GitLab control plane, choose the executor that fits your build workloads, and keep its major and minor versions aligned with the GitLab release. Tag runners by purpose, such as build, test or deploy, so that sensitive jobs run only on isolated runners. The check is a test pipeline with a tagged job that runs on the intended runner and writes its artifact to object storage.

  9. Test a backup and restore, then plan upgrades

    Run the gitlab-backup process against the external database, Gitaly and object storage, and save the secrets and configuration files separately, because the backup alone does not hold everything needed to restore. Restore the backup into a separate environment and confirm that projects, users and CI artifacts are present. Then record the upgrade path, which must pass through the required upgrade stops, and assign an owner for each monthly minor release. The check is a successful restore test and a written upgrade plan approved by the operations owner.

What drives effort and cost on Kubernetes

This table lists the factors that change the effort and recurring cost of a GitLab Kubernetes deployment, with a way to keep each one under control. Read it before requesting a quote, because the rows show which decisions set scope and which work repeats after go-live.

DriverWhy it changes effort or costHow to keep it down
User count and reference architectureYour headcount and API load determine which reference architecture applies, which sets node counts, storage and the need for high availability. Larger tiers add components to build, test and monitor.Size from measured peak load rather than total headcount, and confirm the reference architecture in writing before scoping.
External data servicesPostgreSQL, Redis and Gitaly run outside the cluster in this layout, so someone must provision, secure, back up and patch them on VMs or managed services. This is often the largest hidden share of the work.Reuse existing managed database and cache services where your policies allow, and agree on ownership of each service before the build starts.
Kubernetes platform maturityA cluster with ingress, storage classes, secrets management, certificate automation and monitoring already in place needs far less custom work than a bare cluster.Confirm which platform services your cluster already provides and list the gaps in the scope document.
Storage and backup designObject storage for artifacts, registry and LFS, plus database and repository backups, need sizing, retention rules and restore tests. Restore testing is recurring work.Define retention periods and recovery targets early, and budget restore tests as a regular activity rather than a one-off task.
Identity integrationConnecting an identity provider, group sync, SCIM provisioning and role mapping each add configuration and testing, and changes to the identity provider later need coordination.Limit the first release to one identity provider with a defined group model, and document how new groups are requested.
Air-gapped or regulated controlsOffline package and image transfer, internal registries, evidence collection for assessors and hardening baselines add build and documentation work, and they recur with each upgrade cycle.Decide early which controls must be evidenced, and request a control mapping as a deliverable so evidence is collected during the build.
Number of environmentsEach extra environment, such as staging or a disaster recovery copy, repeats installation, configuration and upgrade work.Keep non-production environments smaller, use one repeatable deployment definition for all of them, and automate the upgrade path.
CustomizationCustom runners, pipeline templates, integrations and bespoke configuration add code to maintain and retest at every GitLab upgrade.Prefer built-in settings and documented extension points, and keep a short list of custom items that each have an owner.
One-time versus recurring workOne-time work covers design, build, migration and first hardening. Recurring work covers monthly minor releases, required upgrade stops, patch releases, backups, restore tests and component updates.Ask the quote to split these two groups, and confirm who performs upgrades and on what cadence after handover.

How the Kubernetes layout changes by environment

A single-node evaluation is the fastest way to learn how the chart behaves, but it is a learning layout, not a production one. Stateful services can run inside the cluster for a trial, which keeps setup short. The GitLab reference architecture guidance does not support running PostgreSQL or Redis inside Kubernetes, so a test built on that assumption cannot simply be promoted later.

  • Data services: The bundled PostgreSQL and Redis are suitable for evaluation only. Confirm this against the chart documentation for the version you plan to run.
  • Storage classes: A default storage class is enough for a trial. Record which class you used so the data can be exported or migrated.
  • Image transfer: Pulls usually go straight to public registries. Confirm whether your network allows that, since the same assumption will fail on a restricted network.
  • Upgrade planning: Treat the test as disposable, but apply upgrades in the required order so the rehearsal reflects the upgrade stops.

Check whether the evaluation data will be discarded or carried forward, because a test that cannot be migrated usually means a full rebuild.

Securing secrets, network paths and admin access on Kubernetes

A GitLab chart deployment concentrates secrets, service-to-service traffic and administrative power in one cluster. The cards below cover the controls that connect those surfaces, and each one should be rolled out gradually and verified in a staging cluster before production. GitLab's hardening guidance is written as ongoing work to apply in stages, not as a one-time checklist.

Kubernetes secrets for chart values

The chart expects credentials for the root account, database, Redis, object storage and runner registration. Decide up front whether these live in Kubernetes Secrets created outside Helm values files, so that Git repositories and Helm release history never hold plaintext passwords. Confirm which secret keys the chart version you deploy reads, and who can read the namespace. Rotation is simpler when each credential has its own Secret, so a single leak does not force a full rebuild. Ask your partner to document the rotation procedure before go-live.

GitLab hardening guide

External database credentials

PostgreSQL and Redis run outside the cluster under the Cloud Native Hybrid layout, so GitLab authenticates to them with credentials that Kubernetes does not manage. Restrict those database roles to the databases GitLab needs, and require TLS on the connection where your database service supports it. Confirm the connection settings with your database team, because a misconfigured role often shows up only during upgrades when migrations run. Keep these credentials separate from the chart values so they can be rotated without redeploying the whole release.

Network policies between namespaces

Without network policies, any pod in the cluster can reach GitLab services, and GitLab pods can reach every other namespace. Write policies that allow traffic only between the webservice, Sidekiq, Gitaly and registry components, plus the ingress controller and the external PostgreSQL and Redis endpoints. Confirm that your CNI plugin enforces NetworkPolicy objects, since some clusters accept the objects but do not apply them. Test each rule by attempting a connection from an unrelated namespace and confirming it fails.

Service account permissions

Each GitLab component should run under a service account that holds only the Role bindings it needs. Review default service account token mounting, and disable automatic mounting on pods that never call the Kubernetes API. Keep cluster-wide roles out of the GitLab namespace, and limit who can create pods or read Secrets there, because those rights effectively grant access to every credential. Ask for an export of the bindings after deployment and review it on each chart upgrade.

Ingress TLS and admin paths

External access to GitLab, the registry and Pages depends on the ingress controller terminating TLS with certificates that your certificate authority issues or that your platform team renews automatically. Enforce HTTPS, and confirm that the certificate covers every hostname the chart exposes. Consider restricting administrative areas and the Rails admin interface to a internal network or VPN address range, because those pages should not be reachable from the public internet. Verify the configuration with an external scan after each change.

Runner placement and isolation

Runners execute untrusted CI code, so their placement determines how far a malicious job can reach. Run them in a separate node pool or namespace from GitLab core services, and avoid privileged containers unless a job specifically requires them. If runners use the Kubernetes executor, confirm the service account they receive can create pods only in the job namespace. Keep Runner versions aligned with the GitLab version, as the Runner documentation advises, and document which projects are allowed to use shared runners.

GitLab Runner docs

How to test that GitLab on Kubernetes works and fails safely

Testing a GitLab Helm chart or Operator deployment is not finished when the pods show as running. The point of the test plan is to prove that each user-facing path works through the ingress and external services, and that the failures you expect to happen, such as a pod restart or a data service outage, cause no data loss and recover in a way your team has rehearsed. Start with pod health and readiness across the webservice, Sidekiq, Gitaly and Toolbox workloads, then confirm that the Kubernetes readiness signals agree with what a user sees in the browser. Record the baseline so later failures can be compared against it.

Next, test the paths a user actually takes. Sign in through the external identity provider you configured, then push and clone a repository over HTTPS and SSH through the ingress. Run a CI job on a registered runner and confirm that the job log, artifacts and status update in the UI. Restarting a stateless pod, such as a webservice or Sidekiq pod, should leave repositories, issues and job history intact. Repository data lives in Gitaly, and the stateful services sit outside the cluster in the Cloud Native Hybrid layout, so check that pushed commits and artifacts are still present after each restart.

The most important test is a restore into a separate environment, not a backup job that reports success. Restore the gitlab-backup archive together with the secrets and configuration files you saved separately, then confirm that users can sign in and that repositories, merge requests and CI variables work. Then run a controlled failure of one external service, such as PostgreSQL or Redis, in a non-production environment and document how GitLab behaves, what alerts fire and how service returns. Confirm the failure response and recovery steps with your database and cache owners and with GitLab backup and restore documentation before you run the tests. Agree on pass criteria in writing before testing starts.

What to monitor, back up, upgrade and document after go-live

This table sets out what each operating area covers on a GitLab Kubernetes deployment, what to watch and what evidence to keep. Read each row as a handover item: the owner needs a named runbook and a recurring check, not a one-time setup. The main takeaway is that the Helm chart or Operator manages only part of the estate, so backups and upgrades must cover the external PostgreSQL, object storage and secrets as well.

AreaWhat to do after go-liveEvidence to hand over
Pods and workloadsMonitor stateless GitLab components on Kubernetes for restarts, pending pods and resource pressure, and size requests and limits from observed load.Dashboards, alert rules and the on-call runbook for pod failures
External PostgreSQLTrack connections, replication health, storage growth and backup success on the database you run outside the cluster, since the reference architecture does not place PostgreSQL in Kubernetes.Database monitoring config, backup job logs and restore test records
Gitaly storageWatch disk capacity, I/O latency and repository storage growth on Gitaly nodes, and confirm the storage layout matches the reference architecture you chose.Capacity reports and storage sizing decision record
PostgreSQL backupsSchedule regular database backups stored separately from the cluster, and confirm point-in-time recovery meets the recovery goals agreed with the business.Backup schedule, retention settings and a dated restore test
Object storage and secretsBack up object storage used for artifacts and registry data, and keep the secrets and gitlab.rb-equivalent configuration outside the chart values, such as in a vault or sealed store, with its own backup.Inventory of stored secrets, backup location list and access review
Upgrade planningPlan monthly minor releases and patch releases, and treat required upgrade stops at x.2, x.5, x.8 and x.11 as fixed points in the calendar, testing each step in a staging cluster first.Upgrade calendar, staging test results and rollback plan per step
Runner version alignmentKeep GitLab Runner major and minor versions aligned with the GitLab instance after each upgrade, and confirm runner pods are updated in the same change window.Runner version inventory and upgrade record per runner
Runbooks and handoverDocument the chart or Operator version, values files, external service endpoints, on-call contacts and the restore procedure, then review them after each upgrade.Signed runbooks, architecture diagram and change log

Common questions before deploying GitLab on Kubernetes

Can PostgreSQL and Redis run inside the Kubernetes cluster with GitLab?

No. GitLab's reference architectures say running stateful components such as PostgreSQL and Redis inside Kubernetes is not supported. The layout that fits Kubernetes is Cloud Native Hybrid: stateless GitLab components run as pods, while PostgreSQL and Redis run on virtual machines or managed services that you operate or buy. Plan those services, their backups and their failover before you write the Helm values, because the chart expects them to exist. Ask your platform team which managed PostgreSQL and Redis offerings they already support and confirm them against the reference architecture documentation for your user count.

When is the Linux package a better choice than the Helm chart or Operator?

The Linux package is usually the better choice when your team has strong virtual machine operations and no existing Kubernetes platform to run GitLab on. GitLab describes the Linux package as the most mature and scalable installation method, and it bundles PostgreSQL, Redis and Sidekiq. The Helm chart or Operator fits when your organization already runs and patches Kubernetes, has a platform team that owns cluster upgrades, and wants GitLab managed like other workloads. Choose based on who will be on call, not on preference. Also confirm that your chosen method supports your offline or air-gapped requirements, if you have them.

How much effort does a Kubernetes GitLab deployment take, and what drives it?

Effort depends mostly on the size of the user base, the number of stateful services you must provision outside the cluster, and how many integrations you need on day one. Larger reference architectures add more nodes, more storage and more load balancing, and high availability for 3,000 or more users adds Gitaly Cluster, PostgreSQL with Patroni, Redis Sentinel and Consul. Other drivers include identity integration, runner design, backup and restore testing, and the migration of existing repositories. Ask any provider for a written breakdown by these components, and ask which items are one-time work and which recur each month.

What must our team supply before a Kubernetes deployment starts?

Your team supplies four groups of inputs. The cluster must exist, with node capacity, storage classes, an ingress approach and a registry or image path you control. Storage must include persistent volumes for Gitaly and object storage for artifacts, LFS, packages and backups, or an agreed alternative. Identity needs an identity provider with LDAP, SAML or OpenID Connect settings, plus group names for role mapping. The network needs DNS names, certificates, egress rules for runners and, for air-gapped sites, a transfer process for images and packages. Confirm each item with the owning team early, because most schedule slips come from waiting on these inputs.

Can our own team deploy GitLab on Kubernetes without a partner?

Yes, if your team already runs production Kubernetes, manages stateful databases and can own backups and restore tests. GitLab publishes installation methods and reference architectures, so the knowledge is available. The harder parts are usually not the first install. They are the external PostgreSQL and Redis design, the Gitaly storage layout, identity and role mapping, runner capacity, and an upgrade process that respects required upgrade stops. Assess your team against those skills and count the people who can respond to an incident outside working hours. A partner fits when those skills or hours are missing for the first release.

How do upgrades differ on Kubernetes compared with a Linux package install?

On Kubernetes you upgrade by changing chart or Operator versions and image tags, but the GitLab rules stay the same. GitLab requires upgrades to pass through required upgrade stops, which since GitLab 17.5 fall at versions x.2, x.5, x.8 and x.11, so you cannot jump between them freely. GitLab ships a minor release on the third Thursday of each month, and security fixes are backported to the previous two monthly releases, so a schedule for patching is essential. Your platform team must also keep the external PostgreSQL, Redis and Gitaly components on compatible versions. Read the upgrade path for each target release before you change any values file.

Does the Kubernetes layout remove the need for backups?

No. The cluster protects pods, not your repositories, database or secrets. Backups must cover PostgreSQL, Gitaly repository data, object storage and the configuration and secrets that GitLab needs to restore cleanly. GitLab's backup and restore documentation describes the gitlab-backup tool, but it also notes that some secrets and configuration files must be saved separately. Plan the restore test as part of the project, because an untested backup is not evidence of recoverability. Ask any provider to show how a restore into a clean cluster is verified, and who runs it on a schedule.

How DeployOpen scopes, builds and hands over GitLab on Kubernetes

DeployOpen plans, implements, documents and supports self-hosted GitLab inside your own cloud accounts, data centers or air-gapped networks. For Kubernetes, we start by agreeing which components run as stateless workloads on the cluster and which stateful services stay on VMs or managed services, then build and hand over against that written layout.

How we scope

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • The written scope states which chart or Operator version, layout and external services are in and out of the build.
  • Scope records how PostgreSQL, Redis and Gitaly are provided, along with object storage, ingress and identity.
  • Ask for the scope to name the upgrade stop and GitLab version the instance will be installed on.

How we build

  • We deploy the stateless GitLab components on your cluster and connect them to externally hosted stateful services.
  • Build steps cover secrets handling, persistent storage classes, resource requests and network policies in your environment.
  • Runners, SSO and backup jobs are configured against the same written scope rather than added later.
  • Each build step is tested in a non-production environment before it is promoted to the production instance.

How we hand over

  • Deliverables include configuration as code, a runbook for upgrades and restores, and the access model documented.
  • We document where the secrets and configuration files that a restore depends on are stored and who can reach them.
  • A restore test is run and recorded so your team sees the recovery path working before handover.
  • Handover includes a session with your platform and security teams walking through the runbook.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, scoped separately from the build.
  • Upgrades follow the required upgrade stops, planned with your team before each change window.
  • Security testing of the deployed instance can be scheduled as part of the retainer or as a separate engagement.
  • Ask any provider to confirm in writing which GitLab and chart versions their support covers and for how long.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.