Go to file
antoniaklja b5fca5950a Minor refactoring 2019-01-02 18:59:09 +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 Install base plugins 2018-12-25 17:10:56 +01:00
doc Refactoring, additional tests and update README.md 2018-12-27 18:17:54 +01:00
pkg Minor refactoring 2019-01-02 18:59:09 +01:00
test/e2e Organized imports and updated README.md 2019-01-02 18:33:35 +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 Add tests for jobs + mockgen for jenkins client 2019-01-02 16:41:33 +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 Refactoring, additional tests and update README.md 2018-12-27 18:17:54 +01:00
README.md Organized imports and updated README.md 2019-01-02 18:33:35 +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
jenkins-operator-draft.png Update README.md and add initial jenkins-operator draft 2018-12-27 20:35:56 +01:00

README.md

jenkins-operator

Kubernetes native Jenkins operator.

Developer guide

Can be found here.

TODO

jenkins-operator-draft

Common:

  • VirtusLab docker registry https://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
  • install and configure Kubernetes plugin (in-progress)
  • e2e pipelines using Kubernetes plugin
  • Jenkins hardening, disable insecure options

User configuration:

  • user reconciliation loop with CR validation
  • configure seed jobs and deploy keys
  • e2e 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.