/jenkins-on-minikube

Jenkins deployed on Minikube for testing purposes

Primary LanguageShellMIT LicenseMIT

Contributors Forks Stargazers Issues MIT License


Jenkins on Minikube

Jenkins deployed on Minikube for testing purposes

Table of Contents
  1. About The Project
  2. Getting Started
  3. License

About The Project

docs/diagram.drawio.svg

Features

  1. Jenkins installed on Minikube with Helm (JCasC for configuration)
  2. Jenkins agent for Maven 3 (Java 17)
  3. Common tools containerized (kaniko + crane)
  4. Example of backend deployment on Minikube
  5. Ingress controller to expose Jenkins and examples

Methodology

This project was made following these steps:

  1. Install Jenkins with default chart values
  2. Get the default chart values (helm/values.yaml)
  3. Check if all is working (pipelines/*)
  4. Update plugins
  5. Check if all is working (pipelines/*)
  6. Get updated plugins versions
  7. Modify Dockerfile with updated plugins versions
  8. Upload new Docker image (image/Dockefile)
  9. Update chart values (helm/values.custom.yaml)

Commands are listed in (docs/commands.md)

Roadmap

  • (docs) Write "Methodology"
  • (docs) Write "Security considerations"
  • (scripts) Set parameters in a different sh file (scripts/_params.sh)
  • Configure backup lifecycle
  • Update Jenkins (Jenkins chart 4.3.23)

(back to top)

Getting Started

Prerequisites

  • Ubuntu 22.04
  • Docker 23.0.4
  • Docker Hub account (Read Security consideration #1)
  • Kubectl v1.27.1
  • Minikube v1.30.1
  • Helm v3.11.3
  • Jenkins chart 4.3.20 (Jenkins 2.387.2)
  • Github account (Jenkins uses SSH to connect to Github. Read Security considerations #2 and #3)

Security considerations

  • #1. The script scripts/_init.sh requires a $HOME/.docker/config.json file to connect Jenkins to Docker hub. You can create this file with docker login. This consideration is based on https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry

  • #2. Public SSH key fingerprints are used to validate a connection to a remote server. In this project, Jenkins uses GitHub's SSH key fingerprints. They are configured as approvedHostKeys in helm/values.security.yaml. Those values could change in the future.

  • #3. The script scripts/_init.sh requires a SSH key to connect Jenkins to Github. If there is a SSH key in path GITHUB_SSH_KEY_FILE, the script will ask to use it. Else, a new SSH key will be created and then the public key must be registered on your Github account. When you uninstall this project, you should consider to remove the SSH key from local and your Github account. This consideration is based on https://docs.github.com/en/authentication/connecting-to-github-with-ssh

Installation

  1. Clone the repo

    git clone https://github.com/kenkina/jenkins-on-minikube.git
  2. (Optional) Change parameters in scripts/_init.sh

  3. Execute scripts/_init.sh

    sh scripts/_init.sh

Uninstallation

  1. Execute scripts/_wipe.sh
    sh scripts/_wipe.sh

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)