Skip to main content

Overview

This template provides a production‑ready Jenkins instance as a Monk runnable. You can:
  • Run it directly to get a managed Jenkins automation server with sensible defaults
  • Inherit it in your own runnable to seamlessly add CI/CD capabilities to your stack
It exposes Jenkins on port 8080 (web UI) and port 50000 (agent communication), persists data to a host volume, and provides an action to retrieve admin credentials on first start.

What this template manages

  • Jenkins LTS container (jenkins/jenkins:lts image)
  • Web UI service on port 8080
  • Agent communication service on port 50000
  • Persistent volume for Jenkins home directory
  • Admin credential retrieval action

Quick start (run directly)

  1. Load templates
monk load MANIFEST
  1. Run Jenkins with defaults
monk run jenkins/server
  1. Get admin credentials
monk do jenkins/server/getAdminCredentials
Once started, access the Jenkins UI at http://localhost:8080 (or the runnable hostname inside Monk networks) and complete the initial setup wizard using the admin password retrieved in step 3.

Configuration

Key variables you can customize in this template:
variables:
  jenkins-image-tag: "lts"           # container image tag
  java-opts: "-Djava.awt.headless=true"  # JVM options (env: JAVA_OPTS)
Data is persisted under ${monk-volume-path}/jenkins on the host, mounted to /var/jenkins_home inside the container. Inherit the Jenkins runnable in your application and declare a connection. Example:
namespace: mycompany
cicd:
  defines: runnable
  inherits: jenkins/server
  variables:
    jenkins-image-tag: "lts"

api:
  defines: runnable
  containers:
    api:
      image: myorg/api
  connections:
    jenkins:
      runnable: cicd
      service: http
  variables:
    jenkins-url:
      value: <- connection-hostname("jenkins")
Then run your app group:
monk run mycompany/api

Ports and connectivity

  • Service: http on TCP port 8080 (web UI)
  • Service: tcp-agent on TCP port 50000 (agent communication)
  • From other runnables in the same process group, use connection-hostname("\<connection-name>") to resolve the Jenkins host.

Persistence and configuration

  • Data path: ${monk-volume-path}/jenkins:/var/jenkins_home
  • All Jenkins configuration, plugins, jobs, and build artifacts are persisted in this volume.
  • You can customize JVM options via the JAVA_OPTS environment variable.

Features

  • Pipeline as Code (Jenkinsfile)
  • 1800+ plugins available
  • Distributed builds
  • REST API
  • Blue Ocean UI
  • Docker integration
  • Extensive SCM integration (Git, GitHub, GitLab, Bitbucket)

Admin credentials

To retrieve the initial admin password after first start:
monk do jenkins/server/getAdminCredentials
Use this password to complete the setup wizard at http://\<jenkins-host>:8080.
  • Integrate with source control (gitlab/, github/ templates)
  • Use with artifact repositories (nexus/, artifactory/)
  • Combine with container registries for Docker image management
  • Deploy alongside sonarqube/ for code quality analysis

Troubleshooting

  • Jenkins may take a few minutes to start on first launch while it initializes the home directory.
  • If you cannot retrieve admin credentials, ensure the container has fully started and the volume is writable by the Jenkins user.
  • Check logs:
monk logs -l 500 -f jenkins/server
  • For plugin installation issues, verify network connectivity and check the Jenkins system log in the web UI.