Quick Start

This document describes steps needed to install Operator Service for Jenkins from Red Hat marketplace

Prerequisites

You need to have access to a namespace in which you wish to deploy the operator. For information on registering your cluster and creating a namespace, see Red Hat Marketplace Docs. This must be done prior to operator installation.

Operator installation on RedHat Marketplace

  • On the main menu, click Workspace > My Software > Product > Install Operator.
  • Search for and select Operator Service for Jenkins
  • On the Update Channel section, select an option.
  • On the Approval Strategy section, select either Automatic or Manual. The approval strategy corresponds to how you want to process operator upgrades.
  • On the Target Cluster section:
  • Click the checkbox next to the clusters where you want to install the Operator.
  • For each cluster you selected, under Namespace Scope, on the Select Scope list, select an option.
  • Click Install. It may take several minutes for installation to complete.
  • Once installation is complete, the status will change from Installing to Up to date.
  • For further information, see the Red Hat Marketplace Operator documentation

install operator

Verification of operator installation

  • Once status changes to Up to date, click the vertical ellipses and select Cluster Console.
  • Open the cluster where you installed the product
  • Go to Operators > Installed Operators
  • Select the Namespace or Project you installed on
  • Verify status for the product is Succeeded
  • Click the product name to open details

verify installation of the operator

Deploying Jenkins

  • Once the operator is up and running, you may proceed to deploy a Jenkins instance. To do so, you need to click the operator name and then create a Jenkins CR:

deploying Jenkins

  • Go into YAML view, and you will see the example Jenkins configuration.
  • Check the version of Jenkins image. It can be found under spec.podspec.containers[0].image.
  • If you find version @sha256:(...) there, change it to 4.9.0. Image quay.io/openshift/origin-jenkins:4.9.0 should be used.
  • Click Create and then the Jenkins instance will start.
  • Go to Jenkins tab and wait for Jenkins to report status Ready. It might take several minutes.

Jenkins install verification

  • Once Jenkins is ready, you can navigate to Networking > Routes to see the route that the Operator made for Jenkins. Clicking there will prompt you to login using OpenShift OAuth. After logging, you will be presented with Jenkins UI

Your Hello World Jenkins job

  • Jenkins jobs definitions are declared in the SeedJob CR. To create your first jobs that will persist after Jenkins’ restarts, go to the JenkinsSeedJob tab
  • In the YAML view, paste the example SeedJob:
apiVersion: operator-service.com/v1beta1
kind: JenkinsSeedJob
metadata:
 name: example-jenkins-seedjob
 labels:
   operator-service.com/jenkins: example
spec:
 repository:
   url: https://github.com/jenkinsci/kubernetes-operator.git
   branch: master
   targets: "cicd/jobs/*.jenkins"
  • Wait for the SeedJob to report the Ready status
  • Go to Jenkins UI and you will see example jobs:

Jenkins example seedjobs