{"id":21971292,"url":"https://github.com/eldada/jenkins-in-kubernetes","last_synced_at":"2025-10-16T22:03:24.481Z","repository":{"id":114564349,"uuid":"121088331","full_name":"eldada/jenkins-in-kubernetes","owner":"eldada","description":"A Jenkins Docker image and helm chart for running in Kubernetes","archived":false,"fork":false,"pushed_at":"2020-08-18T07:57:20.000Z","size":18,"stargazers_count":92,"open_issues_count":0,"forks_count":116,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-01-28T02:34:45.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security.groovy","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-11T05:26:53.000Z","updated_at":"2024-11-27T16:28:39.000Z","dependencies_parsed_at":"2023-03-22T19:02:32.065Z","dependency_job_id":null,"html_url":"https://github.com/eldada/jenkins-in-kubernetes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fjenkins-in-kubernetes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fjenkins-in-kubernetes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fjenkins-in-kubernetes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fjenkins-in-kubernetes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldada","download_url":"https://codeload.github.com/eldada/jenkins-in-kubernetes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245031509,"owners_count":20549925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T14:49:53.851Z","updated_at":"2025-10-16T22:03:19.439Z","avatar_url":"https://github.com/eldada.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jenkins in Kubernetes\nThis repository has a `Dockerfile` and a `helm` chart for setting up a simple Jenkins master for running in Kubernetes.\n\nThis Jenkins has the required tools to work in and with Kubernetes\n- Jenkins application with pre-loaded plugins (see [plugins.txt](plugins.txt))\n- Skipped setup wizard\n  - You can control admin user and password with `--set adminUser=${USER},adminPassword=${PASSWORD}`\n  - You can add and remove plugins by editing the [plugins.txt](plugins.txt) file\n- Docker for managing a Docker CI lifecycle\n- `kubectl` command line client for working with the Kubernetes API\n- `helm` for managing your helm charts CI/CD lifecycle\n\n**IMPORTANT:** This example is for demo and testing. It should not be used a production environment!\n\n### Get the example Docker image\nYou can pull an already built version of this Jenkins image from [bintray.com](https://bintray.com).\n```bash\n# Pull the image\ndocker pull eldada-docker-examples.bintray.io/jenkins:lts-k8s-20190827\n```\n\n### Build the Jenkins Docker image\nYou can build the image yourself\n```bash\nexport DOCKER_REG=SET_YOUR_DOCKER_REGISTRY_HERE\n\n# Build the image\ndocker build -t ${DOCKER_REG}/jenkins:lts-k8s .\n\n# Push the image\ndocker push ${DOCKER_REG}/jenkins:lts-k8s\n```\n\n### Test your image\nYou can run your container locally, if you have Docker installed\n- Using the pre-built image\n```bash\n# Run the container you built before\ndocker run -d --name jenkins -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock eldada-docker-examples.bintray.io/jenkins:lts-k8s-20190827\n```\n\n- Using your built image\n```bash\n# Run the container you built before\ndocker run -d --name jenkins -p 8080:8080 -v /var/run/docker.sock:/var/run/docker.sock ${DOCKER_REG}/jenkins:lts-k8s\n```\n- Browse to http://localhost:8080 on your local browser\n\n### Deploy Jenkins helm chart to Kubernetes\nIf you are using the pre-built image `eldada-docker-examples.bintray.io/jenkins:lts-k8s`, you can install the helm chart with\n```bash\n# Init helm and tiller on your cluster\nhelm init\n\n# Deploy the Jenkins helm chart\n# (same command for install and upgrade)\nhelm upgrade --install jenkins ./helm/jenkins-k8s\n```\n**NOTE:** This helm chart deploys a pod with two containers. One for the Docker daemon and another for Jenkins. This is based on the suggestion in https://applatix.com/case-docker-docker-kubernetes-part-2/\n\nIf you are building your own version of Jenkins, you need your Kubernetes cluster to be able to pull the Docker image.\nYou have to create a Docker registry secret and reference to it in your `helm install` command.\n```bash\n# Create a Docker registry secret\nexport DOCKER_REG=SET_YOUR_DOCKER_REGISTRY_HERE\nexport DOCKER_USR=SET_YOUR_DOCKER_USERNAME_HERE\nexport DOCKER_PWD=SET_YOUR_DOCKER_PASSWORD_HERE\nexport DOCKER_EML=SET_YOUR_DOCKER_EMAIL_HERE\n\nkubectl create secret docker-registry docker-reg-secret \\\n        --docker-server=${DOCKER_REG} \\\n        --docker-username=${DOCKER_USR} \\\n        --docker-password=${DOCKER_PWD} \\\n        --docker-email=${DOCKER_EML}\n\n\n# Deploy the Jenkins helm chart\n# (same command for install and upgrade)\nhelm upgrade --install jenkins \\\n        --set imagePullSecrets=docker-reg-secret \\\n        --set image.repository=${DOCKER_REG}/jenkins \\\n        --set image.tag='lts-k8s' \\\n        ./helm/jenkins-k8s\n```\n\n### Data persistence\nBy default, in Kubernetes, the Jenkins deployment uses a persistent volume claim that is mounted to `/var/jenkins_home`.\nThis assures your data is saved across crashes, restarts and upgrades.   \n\n### Vagrant\nYou can test your Docker image using `Vagrant`. The enclosed [Vagrantfile](Vagrantfile) will provision an Ubuntu VM with Docker.\n\n- Spin up the Vagrant VM then build and run the Docker image\n```bash\n# Spin up the Vagrant VM\nvagrant up\n\n# SSH into the VM\nvagrant ssh\n\n# Go to the mounted sources repository\ncd /opt/provisioning\n\n# Build and run your Jenkins container as shown above\n```\n- Browse to http://localhost:8080 on your local browser\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fjenkins-in-kubernetes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldada%2Fjenkins-in-kubernetes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fjenkins-in-kubernetes/lists"}