How to re-create the operations center PVC

Article ID:360055776691
1 minute readKnowledge base

Issue

You want to re-create the operations center PVC to apply a storageclass change.

Resolution

You can re-create the PVC and its information by following these steps:

  1. Backup the CJOC following this article

  2. Stop the CJOC statefulset (kubectl scale statefulset cjoc --replicas=0)

  3. Delete the CJOC PVC

  4. Recreate the PVC, depending on the StorageClass being used:

If the StorageClass you want to use is the default StorageClass, just start the CJOC with kubectl scale statefulset cjoc --replicas=1. This will create a new PVC. If the StorageClass you want to use is not the default StorageClass, add the StorageClass name to the .Persistence.StorageClass value in the helm values:

Persistence:
  # Persistence.StorageClass -- Persistent Volume Storage Class for Jenkins Home
  # If defined, storageClassName: <storageClass>.
  # If set to "-", storageClassName: "", which disables dynamic provisioning.
  # If undefined (the default) or set to null, the default storage class will be used,
  # unless specified otherwise below.
  # If setting OperationsCenter.Platform == gke, a storage class backed with
  # SSD drives will be created by this chart and used automatically.
  #
  # StorageClass: "-"
  StorageClass: <nameOfTheStorageClass>

Then apply the value with helm upgrade. This should create a new PVC and start CJOC.

5) Stop the CJOC with kubectl scale statefulset cjoc --replicas=0

6) Restore the CJOC from backup manually as explained in restore manually.