Go to file
antoniaklja 87739f71f1 Update seedjob and jenkins client 2018-12-20 16:36:11 +01:00
build Add reconcile loop of Jenkins base configuration 2018-12-06 09:29:38 +01:00
cmd/manager Bump operator-sdk to v0.2.0 2018-12-12 09:43:29 +01:00
deploy Initial version of user reconciliation loop and seed jobs 2018-12-19 22:40:08 +01:00
doc Update developer-guide.md 2018-12-19 22:57:27 +01:00
pkg Update seedjob and jenkins client 2018-12-20 16:36:11 +01:00
test/e2e Update seedjob and jenkins client 2018-12-20 16:36:11 +01:00
version Add reconcile loop of Jenkins base configuration 2018-12-06 09:29:38 +01:00
.gitignore Add reconcile loop of Jenkins base configuration 2018-12-06 09:29:38 +01:00
Gopkg.lock Update seedjob and jenkins client 2018-12-20 16:36:11 +01:00
Gopkg.toml Update seedjob and jenkins client 2018-12-20 16:36:11 +01:00
LICENSE Initial commit 2018-10-19 16:20:19 +02:00
Makefile #2 Fixed make deepcopy-gen 2018-12-19 22:56:00 +01:00
README.md Update seedjob and jenkins client 2018-12-20 16:36:11 +01:00
VERSION.txt Add reconcile loop of Jenkins base configuration 2018-12-06 09:29:38 +01:00
checkmake.ini Add checkmake config 2018-10-26 18:17:26 +02:00
config.env Add Makefile goals for minikube 2018-11-05 15:59:26 +01:00

README.md

jenkins-operator

Kubernetes native Jenkins operator.

Developer guide

Can be found here.

Configuration

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.

TODO

Common:

  • simple library for sending Kubernetes events using one common format
  • decorate Jenkins API client and add more function for handling jobs e.g. Ensure, CreateOrUpdate

Base configuration:

  • install configuration as a code Jenkins plugin
  • handle Jenkins restart when base configuration has changed
  • install and configure Kubernetes plugin
  • e2e pipelines using Kubernetes plugin
  • Jenkins hardening, disable insecure options

User configuration:

  • user reconciliation loop with CR validation (work in progress)
  • configure seed jobs and deploy keys (work in progress)
  • e2e tests for seed jobs (work in progress)
  • backup and restore for Jenkins jobs running as standalone job
  • trigger backup job before pod deletion using preStop k8s hooks
  • verify Jenkins configuration events