You are viewing documentation for a release that is no longer maintained. To view the documentation for the most recent version, see the latest RHACS docs.
Chapter 2. Manually upgrading using the roxctl CLI
You can upgrade to the latest version of Red Hat Advanced Cluster Security for Kubernetes from a supported older version.
To upgrade Red Hat Advanced Cluster Security for Kubernetes to the latest version, you must perform the following:
- Backup the Central database
- Upgrade Central
-
Upgrade the
roxctlCLI - Upgrade Scanner
- Verify that all secured clusters are upgraded
2.1. Backing up the Central database Copy linkLink copied to clipboard!
You can back up the Central database and use that backup for rolling back from a failed upgrade or data restoration in the case of an infrastructure disaster.
Prerequisites
-
You must have an API token with
readpermission for all resources of Red Hat Advanced Cluster Security for Kubernetes. The Analyst system role hasreadpermissions for all resources. -
You have installed the
roxctlCLI. -
You have configured the
ROX_API_TOKENand theROX_CENTRAL_ADDRESSenvironment variables.
Procedure
Run the backup command:
For Red Hat Advanced Cluster Security for Kubernetes 3.0.55 and newer:
roxctl -e "$ROX_CENTRAL_ADDRESS" central backup
$ roxctl -e "$ROX_CENTRAL_ADDRESS" central backupCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Red Hat Advanced Cluster Security for Kubernetes 3.0.54 and older:
roxctl -e "$ROX_CENTRAL_ADDRESS" central db backup
$ roxctl -e "$ROX_CENTRAL_ADDRESS" central db backupCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2. Upgrading the Central cluster Copy linkLink copied to clipboard!
After you have backed up the Central database, the next step is to upgrade the Central cluster. This step includes upgrading Central, the roxctl CLI, and the Scanner.
2.2.1. Upgrading Central Copy linkLink copied to clipboard!
You can update Central to the latest version by downloading and deploying the updated images.
Prerequisites
- If you deploy images from a private image registry, first push the new image into your private registry, and then replace your image registry for the commands in this section.
Procedure
Run the following commands to upgrade Central:
oc -n stackrox patch deploy/central -p '{"spec":{"template":{"spec":{"containers":[{"name":"central","env":[{"name":"ROX_NAMESPACE","valueFrom":{"fieldRef":{"fieldPath":"metadata.namespace"}}}]}]}}}}'$ oc -n stackrox patch deploy/central -p '{"spec":{"template":{"spec":{"containers":[{"name":"central","env":[{"name":"ROX_NAMESPACE","valueFrom":{"fieldRef":{"fieldPath":"metadata.namespace"}}}]}]}}}}'1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
oc -n stackrox patch deployment/scanner -p '{"spec":{"template":{"spec":{"containers":[{"name":"scanner","securityContext":{"runAsUser":65534}}]}}}}'$ oc -n stackrox patch deployment/scanner -p '{"spec":{"template":{"spec":{"containers":[{"name":"scanner","securityContext":{"runAsUser":65534}}]}}}}'1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
oc -n stackrox set image deploy/central central=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2
$ oc -n stackrox set image deploy/central central=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.21 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
ImportantIf you are upgrading from Red Hat Advanced Cluster Security for Kubernetes 3.65.0, you must run the following additional command to create the
stackrox-central-diagnosticsrole:oc -n stackrox patch role stackrox-central-diagnostics -p '{"rules":[{"apiGroups":["*"],"resources":["deployments","daemonsets","replicasets","configmaps","services"],"verbs":["get","list"]}]}'$ oc -n stackrox patch role stackrox-central-diagnostics -p '{"rules":[{"apiGroups":["*"],"resources":["deployments","daemonsets","replicasets","configmaps","services"],"verbs":["get","list"]}]}'1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
If you have not installed Red Hat Advanced Cluster Security for Kubernetes by using Helm or Operator, and you want to enable authentication using the OpenShift OAuth server, you must run the following additional command:
oc -n stackrox set env deploy/central ROX_ENABLE_OPENSHIFT_AUTH=true
$ oc -n stackrox set env deploy/central ROX_ENABLE_OPENSHIFT_AUTH=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Check that the new pods have deployed:
oc get deploy -n stackrox -o wide
$ oc get deploy -n stackrox -o wide1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
oc get pod -n stackrox --watch
$ oc get pod -n stackrox --watch1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
2.2.2. Upgrading the roxctl CLI Copy linkLink copied to clipboard!
To upgrade the roxctl CLI to the latest version you must uninstall the existing version of roxctl CLI and then install the latest version of the roxctl CLI.
2.2.2.1. Uninstalling the roxctl CLI Copy linkLink copied to clipboard!
You can uninstall the roxctl CLI binary on Linux by using the following procedure.
Procedure
Find and delete the
roxctlbinary:ROXPATH=$(which roxctl) && rm -f $ROXPATH
$ ROXPATH=$(which roxctl) && rm -f $ROXPATH1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Depending on your environment, you might need administrator rights to delete the
roxctlbinary.
2.2.2.2. Installing the roxctl CLI on Linux Copy linkLink copied to clipboard!
You can install the roxctl CLI binary on Linux by using the following procedure.
Procedure
Download the latest version of the
roxctlCLI:curl -O https://mirror.openshift.com/pub/rhacs/assets/3.69.2/bin/Linux/roxctl
$ curl -O https://mirror.openshift.com/pub/rhacs/assets/3.69.2/bin/Linux/roxctlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Make the
roxctlbinary executable:chmod +x roxctl
$ chmod +x roxctlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Place the
roxctlbinary in a directory that is on yourPATH:To check your
PATH, execute the following command:echo $PATH
$ echo $PATHCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify the
roxctlversion you have installed:roxctl version
$ roxctl versionCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.2.3. Installing the roxctl CLI on macOS Copy linkLink copied to clipboard!
You can install the roxctl CLI binary on macOS by using the following procedure.
Procedure
Download the latest version of the
roxctlCLI:curl -O https://mirror.openshift.com/pub/rhacs/assets/3.69.2/bin/Darwin/roxctl
$ curl -O https://mirror.openshift.com/pub/rhacs/assets/3.69.2/bin/Darwin/roxctlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Remove all extended attributes from the binary:
xattr -c roxctl
$ xattr -c roxctlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Make the
roxctlbinary executable:chmod +x roxctl
$ chmod +x roxctlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Place the
roxctlbinary in a directory that is on yourPATH:To check your
PATH, execute the following command:echo $PATH
$ echo $PATHCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify the
roxctlversion you have installed:roxctl version
$ roxctl versionCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.2.4. Installing the roxctl CLI on Windows Copy linkLink copied to clipboard!
You can install the roxctl CLI binary on Windows by using the following procedure.
Procedure
Download the latest version of the
roxctlCLI:curl -O https://mirror.openshift.com/pub/rhacs/assets/3.69.2/bin/Windows/roxctl.exe
$ curl -O https://mirror.openshift.com/pub/rhacs/assets/3.69.2/bin/Windows/roxctl.exeCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify the
roxctlversion you have installed:roxctl version
$ roxctl versionCopy to Clipboard Copied! Toggle word wrap Toggle overflow
After you upgrade the roxctl CLI you can upgrade Scanner.
2.2.3. Upgrading Scanner Copy linkLink copied to clipboard!
You can update Scanner to the latest version by using the roxctl CLI.
Prerequisites
- If you deploy images from a private image registry, first push the new image into your private registry, and then replace your image registry for the commands in this section.
- If you used Red Hat UBI-based images when you installed Red Hat Advanced Cluster Security for Kubernetes, replace the image names for the commands in this section with the following UBI-based image names:
If you have created custom scanner configurations, you must apply those changes before updating the scanner configuration file:
roxctl -e "$ROX_CENTRAL_ADDRESS" scanner generate
$ roxctl -e "$ROX_CENTRAL_ADDRESS" scanner generateCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc apply -f scanner-bundle/scanner/02-scanner-03-tls-secret.yaml
$ oc apply -f scanner-bundle/scanner/02-scanner-03-tls-secret.yaml1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
oc apply -f scanner-bundle/scanner/02-scanner-04-scanner-config.yaml
$ oc apply -f scanner-bundle/scanner/02-scanner-04-scanner-config.yaml1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
Procedure
Update the Scanner image:
oc -n stackrox set image deploy/scanner scanner=registry.redhat.io/advanced-cluster-security/rhacs-scanner-rhel8:3.69.2
$ oc -n stackrox set image deploy/scanner scanner=registry.redhat.io/advanced-cluster-security/rhacs-scanner-rhel8:3.69.21 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
Update the Scanner database image:
oc -n stackrox set image deploy/scanner-db db=registry.redhat.io/advanced-cluster-security/rhacs-scanner-db-rhel8:3.69.2
$ oc -n stackrox set image deploy/scanner-db db=registry.redhat.io/advanced-cluster-security/rhacs-scanner-db-rhel8:3.69.21 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
oc -n stackrox set image deploy/scanner-db init-db=registry.redhat.io/advanced-cluster-security/rhacs-scanner-db-rhel8:3.69.2
$ oc -n stackrox set image deploy/scanner-db init-db=registry.redhat.io/advanced-cluster-security/rhacs-scanner-db-rhel8:3.69.21 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
Verification
Check that the new pods have deployed successfully:
oc get pod -n stackrox --watch
$ oc get pod -n stackrox --watch1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
2.2.4. Verifying the Central cluster upgrade Copy linkLink copied to clipboard!
After you have upgraded both Central and Scanner, verify that the Central cluster upgrade is complete.
Procedure
Check the Central logs:
oc logs -n stackrox deploy/central -c central
$ oc logs -n stackrox deploy/central -c central1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
If the upgrade is successful, you will see output similar to the following:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Upgrading all secured clusters Copy linkLink copied to clipboard!
After upgrading Central services, you must upgrade all secured clusters.
If you are using automatic upgrades:
- Update all your secured clusters by using automatic upgrades.
- Skip the instructions in this section and follow the instructions in the Verify upgrades and Revoking the API token sections.
- If you are not using automatic upgrades, you must run the instructions in this section on all secured clusters including the Central cluster.
To complete manual upgrades of each secured cluster running Sensor, Collector, and Admission Controller, follow the instructions in this section.
2.3.1. Update readiness probes Copy linkLink copied to clipboard!
If you are upgrading from a version below Red Hat Advanced Cluster Security for Kubernetes 3.65.0, you must run the following additional command to update the readiness probe path. If you are running a higher version than 3.65, skip this step.
Procedure
Update the readiness probe path:
oc -n stackrox patch deploy/sensor -p '{"spec":{"template":{"spec":{"containers":[{"name":"sensor","readinessProbe":{"httpGet":{"path":"/ready"}}}]}}}}'$ oc -n stackrox patch deploy/sensor -p '{"spec":{"template":{"spec":{"containers":[{"name":"sensor","readinessProbe":{"httpGet":{"path":"/ready"}}}]}}}}'1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
2.3.2. Updating OpenShift security context constraints Copy linkLink copied to clipboard!
Depending on the version of Red Hat Advanced Cluster Security for Kubernetes you are upgrading to, you must update certain OpenShift Container Platform security context constraints (SCCs).
Run the commands in this section only if you are using Red Hat Advanced Cluster Security for Kubernetes with OpenShift Container Platform. Otherwise, skip the instructions in this section.
Procedure
Red Hat Advanced Cluster Security for Kubernetes 3.64.0 renames the SCCs. If you are upgrading from a version below Red Hat Advanced Cluster Security for Kubernetes 3.64.0, you must delete and reapply the SCCs, otherwise, skip this step:
Run the following commands to update Central:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete scc central
$ oc delete scc centralCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following commands to update Scanner:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete scc scanner
$ oc delete scc scannerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following commands on each OpenShift Secured Cluster:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete scc admission-control collector sensor
$ oc delete scc admission-control collector sensorCopy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3.3. Updating other images Copy linkLink copied to clipboard!
You must update the sensor, collector and compliance images on each secured cluster when not using automatic upgrades.
If you are using Kubernetes, use kubectl instead of oc for the commands listed in this procedure.
Procedure
Update the Sensor image:
oc -n stackrox set image deploy/sensor sensor=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2
$ oc -n stackrox set image deploy/sensor sensor=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.21 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
Update the Compliance image:
oc -n stackrox set image ds/collector compliance=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2
$ oc -n stackrox set image ds/collector compliance=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.21 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
Update the Collector image:
oc -n stackrox set image ds/collector collector=registry.redhat.io/advanced-cluster-security/rhacs-collector-rhel8:3.69.2
$ oc -n stackrox set image ds/collector collector=registry.redhat.io/advanced-cluster-security/rhacs-collector-rhel8:3.69.21 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
NoteIf you are using the collector slim image, run the following command instead:
oc -n stackrox set image ds/collector collector=registry.redhat.io/advanced-cluster-security/rhacs-collector-slim-rhel8:{rhacs-version}$ oc -n stackrox set image ds/collector collector=registry.redhat.io/advanced-cluster-security/rhacs-collector-slim-rhel8:{rhacs-version}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Update the admission control image:
oc -n stackrox set image deploy/admission-control admission-control=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2
$ oc -n stackrox set image deploy/admission-control admission-control=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:3.69.2Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3.4. Verifying secured cluster upgrade Copy linkLink copied to clipboard!
After you have upgraded secured clusters, verify that the updated pods are working.
Procedure
Check that the new pods have deployed:
oc get deploy,ds -n stackrox -o wide
$ oc get deploy,ds -n stackrox -o wide1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
oc get pod -n stackrox --watch
$ oc get pod -n stackrox --watch1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
2.4. Rolling back Central Copy linkLink copied to clipboard!
You can roll back to a previous version of Central if the upgrade to a new version is unsuccessful.
2.4.1. Rolling back Central normally Copy linkLink copied to clipboard!
You can roll back to a previous version of Central if upgrading Red Hat Advanced Cluster Security for Kubernetes fails.
Prerequisites
- You must be using Red Hat Advanced Cluster Security for Kubernetes 3.0.57.0 or higher.
- Before you can perform a rollback, you must have free disk space available on your persistent storage. Red Hat Advanced Cluster Security for Kubernetes uses disk space to keep a copy of databases during the upgrade. If the disk space is not enough to store a copy and the upgrade fails, you will not be able to roll back to an earlier version.
Procedure
Run the following command to roll back to a previous version when an upgrade fails (before the Central service starts):
oc -n stackrox rollout undo deploy/central
$ oc -n stackrox rollout undo deploy/central1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectlinstead ofoc.
2.5. Verifying upgrades Copy linkLink copied to clipboard!
The updated Sensors and Collectors continue to report the latest data from each secured cluster.
The last time Sensor contacted Central is visible in the RHACS portal.
Procedure
-
On the RHACS portal, navigate to Platform Configuration
System Health. - Check to ensure that Sensor Upgrade shows clusters up to date with Central.
2.6. Revoking the API token Copy linkLink copied to clipboard!
For security reasons, Red Hat recommends that you revoke the API token that you have used to complete Central database backup.
Prerequisites
- After the upgrade, you must reload the RHACS portal page and re-accept the certificate to continue using the RHACS portal.
Procedure
-
On the RHACS portal, navigate to Platform Configuration
Integrations. - Scroll down to the Authentication Tokens category, and click API Token.
- Select the checkbox in front of the token name that you want to revoke.
- Click Revoke.
- On the confirmation dialog box, click Confirm.