Overview
This template provides a production‑ready GitLab stack as a Monk runnable. You can:- Run it directly to get a managed GitLab instance with runner support
- Inherit it in your own stack to seamlessly add a complete DevOps platform
What this template manages
- GitLab CE (Community Edition) server
- GitLab Runner (for CI/CD job execution)
- Persistent volumes for repositories, data, logs, and configuration
- SSH and HTTP/HTTPS access
- Container Registry for Docker images
Quick start (run directly)
- Load templates
- Run GitLab stack with defaults
- Customize credentials (recommended via inheritance)
variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
- Preferred: inherit and replace variables with
secret("...")as shown below. - Alternative: fork/clone and edit the
variablesin the manifest files, thenmonk load MANIFESTand run.
z123z123 (change this in production!)
Configuration
Key variables you can customize in this template:${monk-volume-path}/gitlab-data on the host. Configuration, logs, and repository data are stored in separate subdirectories.
Stack components
The GitLab stack includes the following runnables:gitlab/server- GitLab CE server (ports 80, 22, 443, 5050)gitlab/runner- GitLab Runner for CI/CD
Register a GitLab Runner
To register a runner with your GitLab instance:- Obtain a runner registration token from the GitLab UI (Admin → Runners section)
- Run the following command:
Use by inheritance (recommended for production)
Inherit the GitLab stack in your infrastructure and declare connections. Example:Ports and connectivity
- HTTP: Service
gitlabon TCP port80 - HTTPS: Service
gitlabon TCP port443 - SSH: TCP port
22(configurable viassh-portvariable) - Container Registry: TCP port
5050 - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve the GitLab host.
Persistence and configuration
- Configuration path:
${monk-volume-path}/gitlab-data/config:/etc/gitlab - Data path:
${monk-volume-path}/gitlab-data/data:/var/opt/gitlab - Logs path:
${monk-volume-path}/gitlab-data/logs:/var/log/gitlab
Persistency with cloud volumes
If you’re using any of the clouds available via Monk, you can use volume definition to spin a disk block device to make your GitLab instance independent from the node it’s running on. To do so, uncomment thevolume block in manifest.yaml.
Features
- Git Repository Management: Full-featured Git repository hosting
- CI/CD: Integrated continuous integration and deployment pipelines
- Issue Tracking: Built-in issue and project management
- Code Review: Merge requests with inline commenting
- Container Registry: Built-in Docker registry
- Wiki: Per-project wikis for documentation
- Snippets: Code snippets sharing
Create your own template with multiple runners
You can create your own template and inherit the defaults to add more runners:Related templates
- High‑availability setup: consider load balancing multiple GitLab instances for production deployments
- Integrate with artifact repositories: see
nexus/orartifactory/templates for artifact management - Database backends: MariaDB, PostgreSQL templates for external database configuration
Troubleshooting
- GitLab may take 5-10 minutes to fully start on first launch.
- Ensure sufficient system resources (minimum 4GB RAM, 8GB recommended for production).
- Check that all required ports are available and not blocked by firewalls.
- Verify SSH access is properly configured and the SSH port is accessible.
- If you changed
gitlab-root-passwordafter initial setup, you may need to reset it inside GitLab or purge the data volume. - Ensure the host volumes are writable by the container user.
- Check logs:
- If you encounter startup issues, try purging and restarting: