CloudBees Core on modern cloud platforms upgrade guide
This guide describes the upgrade process for CloudBees Core on Kubernetes installations.
Helm is the preferred method of managing CloudBees Core on modern cloud platforms. CloudBees provides a Helm chart for CloudBees Core on modern cloud platforms, and recommends migrating existing installations to use the Helm chart. |
-
For instructions on how to migrate your non-Helm installation to Helm, see Migrating existing Kubernetes CloudBees Core installations to Helm.
-
If you were using Helm 2 to manage your CloudBees Core installation, it is still supported, but we recommend that you migrate to Helm 3. See Migrating from Helm 2 to Helm 3.
The version of Operations Center must always be more recent or as old as the version of the Managed Masters that are connected to the Operations Center (Operations Center >= Managed Master version). |
Upgrading using Helm
One of the most useful features of Helm is a streamlined upgrade and update process for your CloudBees Core installation.
The helm upgrade
command allows you to upgrade your CloudBees Core release.
This can be new setting, such as an updated OperationCenter.HostName
value or a new version of CloudBees Core.
Helm Issue 2948 and NGINX Ingress controller support
If you are using the NGINX installation option, you MUST set the nginx-ingress.Enabled=true
value or the NGINX Controller will be deleted. CloudBees strongly recommends you use a Custom Values file.
For more details around Helm Issue 2948, see Helm Issue 2948 on GitHub.
Using a custom values file to upgrade CloudBees Core
CloudBees recommends using a Custom Values File to upgrade CloudBees Core using Helm.
To upgrade your installation using a custom values file:
$ helm upgrade -f example-values.yaml --dry-run --debug cloudbees-core cloudbees/cloudbees-core -n cloudbees-core (1)
1 | Run the helm upgrade command with the -f argument to use the examples-value.yaml file. Replace the examples-value.yaml filename with the name of your values file. Adding the --dry-run --debug runs a dry run of the installation without making changes. |
The following example upgrade custom values file is based on examples in the cloudbees-examples GitHub repository.
# A helm example values file for standard Kubernetes install.
# An nginx-ingress controller is not installed and ssl isn't installed.
# Install an nginx-ingress controller
nginx-ingress:
Enabled: false (1)
OperationsCenter:
# Set the HostName for the Operation Center
HostName: 'cloudbees-core.example.com' (2)
Ingress:
tls:
## Set this to true in order to enable TLS on the ingress record
Enable: false (3)
SecretName: core-example-com-tls
Host: jenkins.cluster.local
1 | If you want NGINX Ingress controller installed, change this value to true . |
2 | Replace cloudbees-core.example.com with your domain name. |
3 | If you want to enable TLS, set this value to true . |
Upgrading on OpenShift using Helm
One of the most useful features of Helm is a streamlined upgrade and update process for your CloudBees Core installation.
The helm upgrade
command allows you to upgrade your CloudBees Core release.
This can be new setting, such as an updated OperationCenter.HostName
value or a new version of CloudBees Core.
Using a custom values file to upgrade CloudBees Core
CloudBees recommends using a Custom Values File to upgrade CloudBees Core using Helm.
To upgrade your installation using a custom values file:
$ helm upgrade -f openshift-example-values.yaml --dry-run --debug (1) (2)
1 | Run the helm upgrade command with the -f argument to use the openshift-examples-value.yaml file. Replace the openshift-examples-value.yaml filename with the name of your values file. |
2 | Adding the --dry-run --debug runs a dry run of the installation without making changes. |
The following example upgrade custom values file is based on examples in the cloudbees-examples GitHub repository.
OperationsCenter:
# Set the HostName for the Operation Center
HostName: 'cloudbees-core.example.com' (1)
Route:
tls:
## Set this to true in order to enable TLS on the ingress record
Enable: false (2)
SecretName: core-example-com-tls
Host: jenkins.cluster.local
Project:
Name: myproject (3)
1 | Replace cloudbees-core.example.com with your domain name. |
2 | If you want to enable TLS, set this value to true . |
3 | OperationsCenter.Project.name is the OpenShift project. |
Upgrading without Helm
Before you upgrade
-
The CloudBees Core YAML has changed, because it is now generated from the CloudBees Core Helm Chart. Both the format and the order of the file have changed. If you intend to use the YAML file as your basis for the upgrade (instead of Helm), you must manually update the field values in cloudbees-core.yml to match the values in your previous installation.
-
As a best practice, CloudBees recommends backing up your Operations Center and
JENKINS_HOME
prior to upgrading. For more information, see the Backup and Restore guide.
Performing the upgrade
If you previously attempted to upgrade CloudBees Core and got an error message reading The StatefulSet "cjoc" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden , follow this upgrade process to resolve the issue.
|
To upgrade CloudBees Core:
-
Download the installer from the Downloads site.
-
In a local directory on your workstation, unpack the installer:
$ tar xvf name-of-installer.tgz
-
Modify the extracted cloudbees-core.yml to match the values of your previous installation. There are two options for this step:
-
Use Helm to create a custom YAML file for your installation
-
Manually edit cloudbees-core.yml values to match the values from the previous installation (IMPORTANT: the YAML file format has changed.
-
-
Delete the
cjoc
statefulset (this does not remove the associated volume or data):$ kubectl delete sts cjoc
-
Confirm that the CJOC statefulset has been deleted:
$ kubectl get sts cjoc Error from server (NotFound): statefulsets.apps "cjoc" not found (1)
1 This error confirms that the cjoc
statefulset has been deleted. -
Run the installer:
$ kubectl apply -f cloudbees-core.yml
-
Check the status of the Operations Center roll-out:
$ kubectl rollout status sts cjoc
-
Once the new Operations Center version has been rolled out, log into Operations Center and upgrade your Managed Masters.