|
|
||
|---|---|---|
| build | ||
| cmd/manager | ||
| deploy | ||
| doc | ||
| pkg | ||
| test/e2e | ||
| version | ||
| .gitignore | ||
| Gopkg.lock | ||
| Gopkg.toml | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| VERSION.txt | ||
| checkmake.ini | ||
| config.env | ||
| jenkins-operator-draft.png | ||
README.md
jenkins-operator
Kubernetes native Jenkins operator.
Developer guide
Can be found here.
TODO
Common:
VirtusLab docker registryhttps://hub.docker.com/r/virtuslab/jenkins-operator- simple library for sending Kubernetes events using one common format
decorate Jenkins API client and add more functions for handling jobs and builds e.g. Ensure, CreateOrUpdate- documentation github pages with Hugo:
- Installation
- Getting Started
- Authorization
- Plugins
- Seed jobs
- Backup and Restore
- How it works
- architecture
- CR definition
- K8s events
- Debugging
- Base and User configuration
- Contributing
- VirtusLab flavored Jenkins theme
- create Jenkins Jobs View to all jobs managed by the operator
Base configuration:
- install configuration as a code Jenkins plugin
- handle Jenkins restart when base configuration has changed
installand configure Kubernetes plugin (in-progress)- e2e pipelines using Kubernetes plugin
- Jenkins hardening, disable insecure options
User configuration:
user reconciliation loop with CR validationconfigure seed jobs and deploy keyse2e tests for seed jobs- configure Jenkins authorization (via configuration as a code plugin or groovy scripts)
- backup and restore for Jenkins jobs running as standalone job (AWS, GCP, Azure)
- trigger backup job before pod deletion using preStop k8s hooks
- verify Jenkins configuration events
Configuration (this section has to be moved to external docs)
This section describes Jenkins configuration.
Seed Jobs
Jenkins operator uses job-dsl and ssh-credentials plugins for configuring seed jobs and deploy keys.
It can be configured using Jenkins.spec.seedJobs section from custom resource manifest:
apiVersion: virtuslab.com/v1alpha1
kind: Jenkins
metadata:
name: example
spec:
master:
image: jenkins/jenkins
seedJobs:
- id: jenkins-operator
targets: "cicd/jobs/*.jenkins"
description: "Jenkins Operator e2e tests repository"
repositoryBranch: master
repositoryUrl: git@github.com:VirtusLab/jenkins-operator-e2e.git
privateKey:
secretKeyRef:
name: deploy-keys
key: jenkins-operator-e2e
And corresponding Kubernetes Secret (in the same namespace) with private key:
apiVersion: v1
kind: Secret
metadata:
name: deploy-keys
data:
jenkins-operator-e2e: |
-----BEGIN RSA PRIVATE KEY-----
MIIJKAIBAAKCAgEAxxDpleJjMCN5nusfW/AtBAZhx8UVVlhhhIKXvQ+dFODQIdzO
oDXybs1zVHWOj31zqbbJnsfsVZ9Uf3p9k6xpJ3WFY9b85WasqTDN1xmSd6swD4N8
...
If your GitHub repository is public, you don't have to configure privateKey and create Kubernetes Secret:
apiVersion: virtuslab.com/v1alpha1
kind: Jenkins
metadata:
name: example
spec:
master:
image: jenkins/jenkins
seedJobs:
- id: jenkins-operator-e2e
targets: "cicd/jobs/*.jenkins"
description: "Jenkins Operator e2e tests repository"
repositoryBranch: master
repositoryUrl: https://github.com/VirtusLab/jenkins-operator-e2e.git
Jenkins operator will automatically configure and trigger Seed Job Pipeline for all entries from Jenkins.spec.seedJobs.
