← All posts

GitLab at home: I also get to be the IT department

Zebra is my Kubernetes cluster. Much of its configuration lives in Git, the version-control system I use to track changes. That makes the place holding those repositories part of how I look after the rest of the setup. I want control over that service too, including where its data is hosted and how I recover it.

I run GitLab Community Edition in Zebra. It provides repositories alongside continuous integration (CI) jobs, a registry for container images, and other tools used to get changes into running services. Keeping those functions together gives me a development workflow on infrastructure I operate.

I use it a lot for small applications and games, as well as development of eScorer, my application project. Family using the tenant platform also use GitLab and its runners. For repositories alone, a smaller Git service would be easier to maintain.

Following a change

This blog is a small example. Its source goes into GitLab. CI builds a container image and pushes it to the registry. A successful build triggers a deployment job that updates the image reference in a separate configuration repository. Flux, the tool that keeps the cluster aligned with Git, applies the validated deployment configuration.

That separation lets me distinguish building a change from releasing it. A successful image build makes a version available; the following automated promotion step selects it for the public site. I can inspect the deployment change and identify the image it selects.

There are credentials and access decisions along that path. A job that builds an image needs different permissions from an operator changing shared infrastructure. Keeping the tools under my control gives me the ability to make those distinctions, along with the responsibility to get them right.

For the platform itself, deployment now follows a signed-artifact path:

Git source -> CI validates and signs -> registry artifact
                                             |
                                             v
                                  Flux verifies signature
                                             |
                                             v
                                      cluster changes

That narrows which published artifacts Flux accepts. It does not make the signing pipeline independent of GitLab or prove that a signed change is safe. CI credentials, protected publication, and signing-key access remain high-value boundaries. Build workloads also need separate scrutiny where they require elevated privileges; image scanning does not prevent every malicious dependency from running. These are part of the security boundaries, not just build conveniences.

Keeping access deliberate

The repositories and development interfaces are intended for authorised access rather than general public browsing. The setup uses private access paths and ingress restrictions. Websites published through GitLab Pages have different access requirements from the GitLab interface itself.

This matters when writing about the infrastructure: linking to a private repository would not help a reader without access. I can explain the design and link to public documentation without exposing the management endpoints or pretending they are public examples.

Hosting the tools myself also fits my preference for keeping data in Europe. Zebra uses home hardware and affordable Hetzner machines in the EU. That describes the hosting arrangement; individual CI jobs still need scrutiny if they send source or other data to external services.

Recovering the service

GitLab's state is spread across several backends. In this deployment, PostgreSQL holds database state, Gitaly stores the Git repositories and Praefect coordinates access to their replicas, and Garage provides object storage for items such as artifacts and uploads.

The toolbox backup job handles repositories, while databases have their own backup path. Laptop clones help preserve source, and losing a small recent change may be manageable. They don't automatically preserve issues, settings, artifacts, or all repository history. Losing the full source collection would be much more serious.

There is also a dependency to plan around: GitLab runs on the infrastructure whose configuration it stores. A recovery plan needs a way to obtain that configuration when GitLab is unavailable. This is one of the recovery dependencies I check before relying on the normal administration path. I do not want to discover that requirement while trying to rebuild it.

The repository copies, databases, and objects can also share the home room's fate. A complete data-loss exercise needs compatible application state and independently available source and recovery instructions. I have not established a full GitLab recovery from loss of that room here.

I like being able to run this workflow on my own infrastructure. Whether it's worth it for you probably depends on how much of GitLab you'll actually use. Repositories alone are a much smaller job. Add builds, deployments, and a registry, and you also inherit their permissions and recovery work. The IT department is still me.

← Back to the notebook