Using private image repository in Operations Center controller provisioning

2 minute read

Issue

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

Resolution

When configuring images used for controller 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 controller 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:
    # controller.Image.dockerImage -- Used to override the default docker image
    dockerImage: cloudbees/cloudbees-core-mm:2.289.2.2
  # controller.JavaOpts -- Additional Java options to pass to managed controllers. 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 controller Provisioning). Replace my-secret-1 with your configured image secret name.

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