← All projects

Featured project 10 · CI/CD · Jenkins + Kubernetes

Jenkins + Kubernetes Test Pipeline

A Jenkins pipeline, configured entirely as code, that builds a small API, deploys it to a kind Kubernetes cluster in a namespace per build and runs unit, smoke and regression tests against the deployment; GitHub Actions starts a real Jenkins on every push and requires the pipeline to pass.

Live CI status of Jenkins + Kubernetes Test Pipeline

View source code View documentation View latest CI runs View test report

Purpose

Shows the CI/CD side of test automation: getting tests to run reliably against a freshly deployed system, on every change, with results people can read. The service under test lives in the repository, so the pipeline depends on nothing outside it, and the Jenkinsfile itself is tested in CI like any other code.

Technology stack

AreaTools
CI serverJenkins 2.580 LTS in Docker: Configuration as Code, Job DSL, Pipeline Graph View, JUnit, HTML Publisher, credentials binding
Kuberneteskind 0.33 (Kubernetes in Docker), kubectl 1.37: Deployment with probes, Service, Job, a namespace per build
System under testroom-booking: Node.js 24 API, no dependencies, with node:test unit tests
Testspytest 9 + requests: smoke and regression suites, JUnit XML and pytest-html reports, Ruff
CIGitHub Actions: checks, the Kubernetes path with the same scripts, and a real Jenkins that runs the Jenkinsfile

Architecture overview

Jenkinsfile                    stages, parallelism, parameters, quality gate, reports
      │  calls
scripts/*.sh                   kind-up, deploy, smoke-job, api-tests, teardown (also used by GitHub Actions)
      │
kind cluster 'qa'              namespace qa-<build>: Deployment (2 pods, probes) + Service + smoke Job
      ▲
Jenkins controller (Docker)    JCasC + Job DSL, uses the host's Docker for images and the cluster

Key engineering decisions

Implemented features

Setup and execution

docker compose -f jenkins/docker-compose.yml up -d --build --wait   # Jenkins on http://localhost:8088
scripts/run-jenkins-build.sh                                      # start the job, wait, print the result

Sample test results

Jenkins stage graph of a successful build
A successful build in Jenkins' stage graph: every stage of the pipeline in 31 seconds.
Jenkins job page with the test result trend
The job page with the test trend; the drop from 42 to 21 is the fix that stopped tests from being counted twice.

CI workflow

On every push and pull request: unit tests, lint and the API tests against the service on the runner; then, in parallel, the Kubernetes path without Jenkins (kind, deploy, smoke Job, API tests) and a job that builds and starts the Jenkins image and runs the pipeline in it.

Known limitations and future improvements

Limitations

Next steps