How to change the storageClass used in CloudBees CI (CloudBees Core) on Modern Cloud Platforms

Article ID:360040082412
1 minute readKnowledge base

Issue

You would like to modify the storageClass used by CJOC and the Managed controllers created in CloudBees Core on Modern Cloud Platforms

Resolution

Using Helm

Using Helm it is very straight forward to configure the storageClass used by CJOC and the Managed controllers.

Before CloudBees Core 2.204.2.2

In the case of the Operations Center, we just need to set the Persistence.StorageClass with the right value. i.e --set Persistence.StorageClass='<MY_STORAGE_CLASS>.

For the Managed controllers, the same is done through Java arguments configuring the Helm value OperationsCenter.JavaOpts with -Dcom.cloudbees.masterprovisioning.kubernetes.KubernetesMasterProvisioning.storageClassName=<MY_STORAGE_CLASS> - changing <MY_STORAGE_CLASS> with the name of a storage class listed by kubectl get storageclass - . i.e --set OperationsCenter.JavaOpts='-Dcom.cloudbees.masterprovisioning.kubernetes.KubernetesMasterProvisioning.storageClassName=<MY_STORAGE_CLASS>

The installation command should look something like the snipped below, in which nfs-client is the storageClass we would like to use on this case.

helm install cloudbees-core --debug --set OperationsCenter.HostName='example.cloudbees-core.com' --set OperationsCenter.JavaOpts='-Dcom.cloudbees.masterprovisioning.kubernetes.KubernetesMasterProvisioning.storageClassName=nfs-client' --set Persistence.StorageClass='nfs-client' --namespace cloudbees-core cloudbees/cloudbees-core

After CloudBees Core 2.204.2.2

To change the storageClass is just a matter of setting Persistence.StorageClass with the right value. i.e --set Persistence.StorageClass='<MY_STORAGE_CLASS>. This will make the storageClass change for both, Operations Center and Managed controllers.

Using .yaml

Through .yaml we must manually modify the Operations Center Statefulset enabling the Java argument -Dcom.cloudbees.masterprovisioning.kubernetes.KubernetesMasterProvisioning.storageClassName=<MY_STORAGE_CLASS> and add the required storageClass in the volumeClaimTemplates.

Important Note

Changes of storageclass do not apply to an existing PV/PVC. A new volume needs to be provisioned and data needs to be migrated in order to use the new storageclass.