Migrating your CloudBees CI instance on Kubernetes to Helm

2 minute read

To migrate your existing CloudBees CI installation to Helm:

  1. Ensure you have installed Helm, as documented in Setting up the Helm client.

  2. Back up your operations center and JENKINS_HOME directory.

  3. Ensure that the reclaim policy of the Persistent Volume for your operations center is set to Retain, and not Delete. To check this, run kubectl get pv and look under the RECLAIM POLICY column for the jenkins-home-cjoc-0 claim

    $ kubectl get pv NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE pvc-6235d73e-4f47-4fff-905e-095c89e245fe 20Gi RWO Retain Bound default/jenkins-home-cjoc-0 standard 174m

    If the RECLAIM POLICY is Delete, change it to Retain by following Changing the reclaim policy of a PersistentVolume

  4. Delete your existing operations center:

    $ kubectl delete -f cloudbees-ci.yml (1)
    1 Substitute the name of your most recently customized CloudBees CI YAML file for cloudbees-ci.yml.
  5. Kubernetes does not delete Persistent Volume Claims (PVC)s, so the CloudBees CI Helm chart can reuse this existing PVC in the new installation. Retrieve the PVC name:

    $ kubectl get pvc jenkins-home-cjoc-0 NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE jenkins-home-cjoc-0 Bound pvc-6d3b2db6-62b5-11e9-9b26-0e7bd6f0258e 20Gi RWO gp2 30d
  6. Use the same cjoc statefulset name that was previously used.

  7. Using either a custom value file that you created before you started the migration or the helm install --set argument, set the value field Persistence.ExistingClaim to jenkins-home-cjoc-0 for the PVC.

  8. Install the Helm chart using helm install cloudbees-core cloudbees/cloudbees-core -f custom-values.yaml --namespace=cloudbees-core

  9. Once your CloudBees CI migration has completed, log in to your operations center with your previous passwords.

  10. The Kubernetes Pod for each of your controllers will now require a restart. This can be done using the ManageRestart button in the operations center. Doing this ensures that the Kubernetes ServiceAccount and the Secret that was re-created as part of this Helm migration is picked up by each controller, which is required for the controller to be able to create new Kubernetes build agents.

For more information on running CloudBees CI on Kubernetes, see the CloudBees CI on modern cloud platforms administration guide.