Questo contenuto non è disponibile nella lingua selezionata.
Chapter 2. Upgrading using Helm charts
You can upgrade to the latest version of Red Hat Advanced Cluster Security for Kubernetes from a supported older version. For upgrading to RHACS 4.0, you must be using the latest patch release of RHACS 3.74. If you are using an older version, you must first upgrade to RHACS 3.74.
If you have installed Red Hat Advanced Cluster Security for Kubernetes by using Helm charts, to upgrade to the latest version of Red Hat Advanced Cluster Security for Kubernetes you must perform the following:
- Backup the Central database.
- (Optional) Optimize Central database and Persistent Volume Claims (PVC).
-
(Optional) Generate
values-private.yaml
configuration file containing root certificates for the central-services Helm chart. - Update the Helm chart.
-
Run the
helm upgrade
command.
To ensure optimal functionality, use the same version for your secured-cluster-services Helm chart and central-services Helm chart.
2.1. Backing up the Central database Copia collegamentoCollegamento copiato negli appunti!
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
read
permission for all resources of Red Hat Advanced Cluster Security for Kubernetes. The Analyst system role hasread
permissions for all resources. -
You have installed the
roxctl
CLI. -
You have configured the
ROX_API_TOKEN
and theROX_CENTRAL_ADDRESS
environment variables.
Procedure
Run the backup command:
roxctl -e "$ROX_CENTRAL_ADDRESS" central backup
$ roxctl -e "$ROX_CENTRAL_ADDRESS" central backup
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2. Optimizing Central database and PVC Copia collegamentoCollegamento copiato negli appunti!
When you upgrade to Red Hat Advanced Cluster Security for Kubernetes (RHACS) 4.0, RHACS creates a PostgreSQL instance called central-db
with a default Persistent Volume Claims (PVC). Optionally, you can customize central-db
or PVC configuration.
Red Hat recommends the following minimum memory and CPU requests:
2.3. Generating root certificates file Copia collegamentoCollegamento copiato negli appunti!
If you do not have access to your values-private.yaml
configuration file that you have used to install Red Hat Advanced Cluster Security for Kubernetes (RHACS), use the following instruction to generate the values-private.yaml
configuration file containing root certificates.
Skip the instruction here, if you have access to your values-private.yaml
configuration file.
The generated values-private.yaml
file has sensitive configuration options. Ensure that you store this file securely.
Procedure
-
Download the
create_certificate_values_file.sh
script. Make the
create_certificate_values_file.sh
script executable:chmod +x create_certificate_values_file.sh
$ chmod +x create_certificate_values_file.sh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run the
create_certificate_values_file.sh
script file:create_certificate_values_file.sh values-private.yaml
$ create_certificate_values_file.sh values-private.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. Updating the Helm chart repository Copia collegamentoCollegamento copiato negli appunti!
You must always update Helm charts before upgrading to a new version of Red Hat Advanced Cluster Security for Kubernetes.
Prerequisites
- You must have already added the Red Hat Advanced Cluster Security for Kubernetes Helm chart repository.
- You must be using Helm version 3.8.3 or newer.
Procedure
Update Red Hat Advanced Cluster Security for Kubernetes charts repository.
helm repo update
$ helm repo update
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Run the following command to verify the added chart repository:
helm search repo -l rhacs/
$ helm search repo -l rhacs/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.6. Running the Helm upgrade command Copia collegamentoCollegamento copiato negli appunti!
You can use the helm upgrade
command to update Red Hat Advanced Cluster Security for Kubernetes (RHACS).
Prerequisites
-
You must have access to the
values-private.yaml
configuration file that you have used to install Red Hat Advanced Cluster Security for Kubernetes (RHACS). Otherwise, you must generate thevalues-private.yaml
configuration file containg root certificates, before proceeding with the commands here.
Procedure
Run the helm upgrade command and specify the configuration files by using the
-f
option:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou might use the
--reuse-values
option to preserve the previously configured Helm values during the upgrade. If you do that, you must turn off central-db creation before you upgrade to the next version. For example,Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.7. Remove Central-attached PV Copia collegamentoCollegamento copiato negli appunti!
Kubernetes and OpenShift Container Platform do not delete persistent volumes (PV) automatically. When you upgrade RHACS from earlier versions, the Central PV called stackrox-db
remains mounted. However, in RHACS 4.1, Central does not need the previously attached PV anymore.
The PV has data and persistent files used by earlier RHACS versions. You can use the PV to roll back to an earlier version before RHACS 4.1. Or, if you have a large RocksDB backup bundle for Central, you can use the PV to restore that data.
If you do not plan to roll back or restore from earlier RocksDB backups, you can remove the Central-attached persistent volume claim (PVC) to free up the storage.
After removing PVC, you cannot roll back Central to an earlier version before RHACS 4.1 or restore large RocksDB backups created with RocksDB.
2.7.1. Remove Central-attached PV using Helm Copia collegamentoCollegamento copiato negli appunti!
Remove the Central-attached persistent volume claim (PVC) stackrox-db
to free up storage space.
Procedure
Run the following command:
helm upgrade -n stackrox stackrox-central-services \ rhacs/central-services --version <current-rhacs-version> \ --set central.persistence.none=true
$ helm upgrade -n stackrox stackrox-central-services \ rhacs/central-services --version <current-rhacs-version> \ --set central.persistence.none=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Run the following command:
oc -n stackrox describe pvc stackrox-db | grep -i 'Used By'
$ oc -n stackrox describe pvc stackrox-db | grep -i 'Used By' Used By: <none>
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.8. Rolling back an Helm upgrade Copia collegamentoCollegamento copiato negli appunti!
You can roll back to a previous version of Central if the upgrade to a new version is unsuccessful.
Procedure
Run the following
helm upgrade
command:helm upgrade -n stackrox \ stackrox-central-services rhacs/central-services \ --version <previous_rhacs_74_version> \ --set central.db.enabled=false
$ helm upgrade -n stackrox \ stackrox-central-services rhacs/central-services \ --version <previous_rhacs_74_version> \
1 --set central.db.enabled=false
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
<previous_rhacs_74_version>
with the previously installed RHACS version.
Delete the
central-db
persistent volume claim (PVC):oc -n stackrox delete pvc central-db
$ oc -n stackrox delete pvc central-db
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- If you use Kubernetes, enter
kubectl
instead ofoc
.