# sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes architecture

> Architecture diagram of the GitHub repository sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes
- Repository: https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes

## Overview

This repository provisions a self-hosted GitLab CI/CD platform through two deployment paths: Docker Compose for local use and Kubernetes for a production-style setup. The main user workflow is browser access through a proxy or HTTPS ingress to GitLab, which uses PostgreSQL and delegates pipeline jobs to GitLab Runner. Kubernetes adds monitoring, centralized logging, persistent storage, and namespace-level reliability controls. The graph reflects README-documented relationships; source excerpts were unavailable, so implementation-level call paths are not verified.

Main entry points: [`k8s/base/gitlab.yaml`](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/gitlab.yaml) (GitLab CE), [`docker/docker-compose.yml`](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/docker/docker-compose.yml) (Compose Stack), [`k8s/base`](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/tree/main/k8s/base) (Kubernetes Base), [`k8s/base/runner.yaml`](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/runner.yaml) (GitLab Runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deploy["Deployment"]
  node_compose["Compose Stack<br/>[docker-compose.yml]"]
  node_nginx["Nginx Proxy<br/>[nginx.conf]"]
  node_k8s["Kubernetes Base"]
  node_https["HTTPS Ingress<br/>[gitlab.yaml]"]
end

subgraph group_platform["Core Platform"]
  node_gitlab["GitLab CE<br/>[gitlab.yaml]"]
  node_postgres[("PostgreSQL<br/>[postgres.yaml]")]
  node_runner["GitLab Runner<br/>[runner.yaml]"]
end

subgraph group_observability["Observability"]
  node_prometheus["Prometheus<br/>[prometheus.yaml]"]
  node_promconfig["Prometheus Config"]
  node_grafana["Grafana<br/>[grafana.yaml]"]
  node_fluentbit["Fluent Bit"]
  node_elasticsearch[("Elasticsearch<br/>[es-values.yaml]")]
  node_kibana["Kibana<br/>[kibana-values.yaml]"]
end

subgraph group_operations["Operations"]
  node_backup["GitLab Backup<br/>[backup.sh]"]
  node_init["Environment Init<br/>[init.sh]"]
  node_k8sdeploy["Kubernetes Access<br/>[deploy-k8s.sh]"]
end

node_browser(("Browser"))

node_browser -->|"HTTPS access"| node_nginx
node_nginx -->|"proxies requests"| node_gitlab
node_browser -->|"HTTPS access"| node_https
node_https -->|"routes traffic"| node_gitlab
node_gitlab -->|"uses database"| node_postgres
node_runner -->|"connects back"| node_gitlab
node_prometheus -->|"scrapes metrics"| node_gitlab
node_promconfig -->|"configures scraping"| node_prometheus
node_grafana -->|"visualizes metrics"| node_prometheus
node_fluentbit -->|"ships logs"| node_elasticsearch
node_kibana -->|"explores logs"| node_elasticsearch
node_backup -->|"backs up data"| node_gitlab
node_init -->|"prepares environment"| node_compose
node_k8sdeploy -->|"deploys and forwards"| node_k8s
node_compose -->|"orchestrates service"| node_gitlab
node_compose -->|"orchestrates service"| node_postgres
node_compose -->|"orchestrates service"| node_runner
node_k8s -->|"deploys service"| node_gitlab
node_k8s -->|"deploys service"| node_postgres
node_k8s -->|"deploys service"| node_runner

click node_compose "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/docker/docker-compose.yml"
click node_nginx "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/nginx/nginx.conf"
click node_k8s "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/tree/main/k8s/base"
click node_https "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/gitlab.yaml"
click node_gitlab "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/gitlab.yaml"
click node_postgres "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/postgres.yaml"
click node_runner "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/runner.yaml"
click node_prometheus "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/prometheus.yaml"
click node_promconfig "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/prometheus-config.yaml"
click node_grafana "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/grafana.yaml"
click node_fluentbit "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/logging/fluent-bit-values.yaml"
click node_elasticsearch "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/logging/es-values.yaml"
click node_kibana "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/logging/kibana-values.yaml"
click node_backup "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/scripts/backup.sh"
click node_init "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/scripts/init.sh"
click node_k8sdeploy "https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/scripts/deploy-k8s.sh"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_compose,node_nginx,node_k8s,node_https,node_browser toneBlue
class node_gitlab,node_postgres,node_runner toneAmber
class node_prometheus,node_promconfig,node_grafana,node_fluentbit,node_elasticsearch,node_kibana toneMint
class node_backup,node_init,node_k8sdeploy toneRose
```

## Components

### Deployment

- [Compose Stack](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/docker/docker-compose.yml): `docker/docker-compose.yml`
- [Nginx Proxy](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/nginx/nginx.conf): `nginx/nginx.conf`
- [Kubernetes Base](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/tree/main/k8s/base): `k8s/base`
- [HTTPS Ingress](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/gitlab.yaml): `k8s/base/gitlab.yaml`

### Core Platform

- [GitLab CE](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/gitlab.yaml): `k8s/base/gitlab.yaml`
- [PostgreSQL](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/postgres.yaml): `k8s/base/postgres.yaml`
- [GitLab Runner](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/runner.yaml): `k8s/base/runner.yaml`

### Observability

- [Prometheus](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/prometheus.yaml): `k8s/base/prometheus.yaml`
- [Prometheus Config](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/prometheus-config.yaml): `k8s/base/prometheus-config.yaml`
- [Grafana](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/base/grafana.yaml): `k8s/base/grafana.yaml`
- [Fluent Bit](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/logging/fluent-bit-values.yaml): `k8s/logging/fluent-bit-values.yaml`
- [Elasticsearch](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/logging/es-values.yaml): `k8s/logging/es-values.yaml`
- [Kibana](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/k8s/logging/kibana-values.yaml): `k8s/logging/kibana-values.yaml`

### Operations

- [GitLab Backup](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/scripts/backup.sh): `scripts/backup.sh`
- [Environment Init](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/scripts/init.sh): `scripts/init.sh`
- [Kubernetes Access](https://github.com/sidhumanbirsingh/self-hosted-gitlab-ce-kubernetes/blob/main/scripts/deploy-k8s.sh): `scripts/deploy-k8s.sh`

### Other components

- **Browser**

## Connections

- Browser → Nginx Proxy: HTTPS access (evidence: `README.md`)
- Nginx Proxy → GitLab CE: proxies requests (evidence: `README.md`)
- Browser → HTTPS Ingress: HTTPS access (evidence: `README.md`)
- HTTPS Ingress → GitLab CE: routes traffic (evidence: `README.md`)
- GitLab CE → PostgreSQL: uses database (evidence: `README.md`)
- GitLab Runner → GitLab CE: connects back (evidence: `README.md`)
- Prometheus → GitLab CE: scrapes metrics (evidence: `README.md`)
- Prometheus Config → Prometheus: configures scraping (evidence: `README.md`)
- Grafana → Prometheus: visualizes metrics (evidence: `README.md`)
- Fluent Bit → Elasticsearch: ships logs (evidence: `README.md`)
- Kibana → Elasticsearch: explores logs (evidence: `README.md`)
- GitLab Backup → GitLab CE: backs up data (evidence: `README.md`)
- Environment Init → Compose Stack: prepares environment (evidence: `README.md`)
- Kubernetes Access → Kubernetes Base: deploys and forwards (evidence: `README.md`)
- Compose Stack → GitLab CE: orchestrates service (evidence: `README.md`)
- Compose Stack → PostgreSQL: orchestrates service (evidence: `README.md`)
- Compose Stack → GitLab Runner: orchestrates service (evidence: `README.md`)
- Kubernetes Base → GitLab CE: deploys service (evidence: `README.md`)
- Kubernetes Base → PostgreSQL: deploys service (evidence: `README.md`)
- Kubernetes Base → GitLab Runner: deploys service (evidence: `README.md`)
