https://github.com/thesurlydev/jenkins-k8s
Deploy Jenkins on Kubernetes
https://github.com/thesurlydev/jenkins-k8s
jenkins kubernetes kubernetes-deployment
Last synced: about 2 months ago
JSON representation
Deploy Jenkins on Kubernetes
- Host: GitHub
- URL: https://github.com/thesurlydev/jenkins-k8s
- Owner: thesurlydev
- Created: 2020-07-25T21:08:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-27T17:23:12.000Z (almost 6 years ago)
- Last Synced: 2025-10-06T17:46:21.484Z (8 months ago)
- Topics: jenkins, kubernetes, kubernetes-deployment
- Language: Shell
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jenkins-k8s
The intent of this document is to outline the steps necessary to install Jenkins with the Kubernetes plugin on a cluster. The Kubernetes plugin allows for a scale to zero solution for build agents which saves on resources.
## Technology Components
* [Kubernetes](https://kubernetes.io/) cluster - see [digitalsanctum/kubernetes-bare-metal: Personal notes for setting up a Kubernetes cluster on bare metal.](https://github.com/digitalsanctum/kubernetes-bare-metal)
* [Rook](https://rook.io/), [Ceph File System](https://docs.ceph.com/docs/master/cephfs/) - see [digitalsanctum/rook-ceph-bare-metal](https://github.com/digitalsanctum/rook-ceph-bare-metal)
* [Jenkins](https://www.jenkins.io/)
* [Kubernetes | Jenkins plugin](https://plugins.jenkins.io/kubernetes/)
## Build image
The following will build a Jenkins container image via `Dockerfile` and automate the installation of plugins defined in the `plugins.txt` file.
Update `plugins.txt` as needed.
```
docker build -t digitalsanctum/jenkins:2.235.2 .
docker login
docker push digitalsanctum/jenkins:2.235.2
```
Test locally.
```
docker run -d --name jenkins -p 8080:8080 --rm digitalsanctum/jenkins:2.235.2
```
## Install via kubectl
Update image/version in `kubernetes/deployment.yaml` as needed.
```bash
kc apply -f kubernetes/namespace.yaml
kc apply -f kubernetes
kc apply -f kubernetes/service.yaml --validate=false
```
Get the port via:
```bash
kc get service -n jenkins
```
## Install via Helm
NOT WORKING YET...need to tweak storage bits to use ceph.
```bash
helm repo add stable https://kubernetes-charts.storage.googleapis.com
helm install my-release stable/jenkins -f helm/values.yaml
```
* Reference: https://github.com/helm/charts/tree/master/stable/jenkins