Using private image repository in Operations Center master provisioning

Issue

Configure Master Provisioning to pull from an internal repository rather than dockerhub.
Using private repositories in Master provisioning as a workaround for Docker Hub Rate Limiting

Environment

Resolution

When configuring images used for master provisioning the default behaviour is to pull the image from CloudBees public dockerhub repository. However in certain situations CloudBees CI administrators
may want to pull images from an internal repository instead. For example using internal image repository allows administrators a workaround for Docker Hub Rate Limitingintroduced recently.
Currently the master provisioning page does not provide a field for an imagepullsecret which is required when using private repositories. Below workaround will help overcome that limitation and allow administrators to
use private repositories.

Workaround

The custom image must first be specified for use on the controller.

  1. Navigate on the CloudBees Jenkins Operations Center to Manage Jenkins
  2. Select Configure Controller Provisioning
  3. Scroll to the Container image definition section and click Add to supply a new Name and Image Tag.
  4. After saving, the image will then be available to select on the provisiong page for the controller in the image drop down field.

Alternatively, the image can be configured during the Helm install using the following syntax:
(Please note that this is subject to change and you should reference the output of helm show values cloudbees/cloudbees-core for the up to date syntax.)

  # Docker image inserted in Operations Center automatically
  Image:
    # Master.Image.dockerImage -- Used to override the default docker image
    dockerImage: cloudbees/cloudbees-core-mm:2.289.2.2
  # Master.JavaOpts -- Additional Java options to pass to managed masters. For example, setting up a JMX port
  JavaOpts: null

Replace the default dockerhub CloudBees image

dockerImage: cloudbees/cloudbees-core-mm:2.289.2.2

with the full path to your nexus repo

dockerImage: nexus.example.com:port/custom-cloudbees-core-mm:2.289.2.2

A workaround will be to add below to YAML field under $JENKINS_URL/masterProvisioning/ or (Manage Jenkins –> Configure Master Provisioning). Replace my-secret-1 with your configured image secret name.

---
kind: StatefulSet
spec:
  template:
    spec:
      imagePullSecrets:
      - name: "my-secret-1"

Have more questions?

0 Comments

Please sign in to leave a comment.