3.3. Upgrading the Central cluster
After you have created a backup of the Central database and generated the necessary resources by using the provisioning bundle, the next step is to upgrade the Central cluster. This process involves upgrading Central and Scanner.
3.3.1. Upgrading Central 复制链接链接已复制到粘贴板!
You can update Central to the latest version by downloading and deploying the updated images.
If you use Kubernetes, enter kubectl instead of oc.
Procedure
To update the Central image, run the following command:
$ oc -n stackrox set image deploy/central \ central=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:4.7.8To update the Central-db image, run the following command:
$ oc -n stackrox set image deploy/central-db \ central-db=registry.redhat.io/advanced-cluster-security/rhacs-central-db-rhel8:4.7.8 \ init-db=registry.redhat.io/advanced-cluster-security/rhacs-central-db-rhel8:4.7.8To update the config controller image, run the following command:
$ oc -n stackrox set image deploy/config-controller \ manager=registry.redhat.io/advanced-cluster-security/rhacs-main-rhel8:4.7.8
Verification
Verify that the new pods have deployed:
$ oc get deploy -n stackrox -o wide$ oc get pod -n stackrox --watch
3.3.2. Upgrading Scanner 复制链接链接已复制到粘贴板!
You can update Scanner to the latest version by downloading and deploying the updated images.
If you are using Kubernetes, enter the kubectl command instead of the oc command.
Procedure
If you have created custom Scanner configurations, you must apply these changes before updating the Scanner configuration file:
To generate Scanner, run the following command:
$ roxctl -e "$ROX_CENTRAL_ADDRESS" scanner generateTo apply the TLS secrets YAML file, run the following command:
$ oc apply -f scanner-bundle/scanner/02-scanner-03-tls-secret.yamlTo apply the Scanner configuration YAML file, run the following command:
$ oc apply -f scanner-bundle/scanner/02-scanner-04-scanner-config.yaml
To update the Scanner image, run the following command:
$ oc -n stackrox set image deploy/scanner \ scanner=registry.redhat.io/advanced-cluster-security/rhacs-scanner-rhel8:4.7.8To update the Scanner database image, run the following command:
$ oc -n stackrox set image deploy/scanner-db \ db=registry.redhat.io/advanced-cluster-security/rhacs-scanner-db-rhel8:4.7.8 \ init-db=registry.redhat.io/advanced-cluster-security/rhacs-scanner-db-rhel8:4.7.8
Verification
To verify that the new pods have been deployed, run the following commands:
$ oc get deploy -n stackrox -o wide$ oc get pod -n stackrox --watch
3.3.3. Verifying the Central cluster upgrade 复制链接链接已复制到粘贴板!
After you have upgraded both Central and Scanner, verify that the Central cluster upgrade is complete.
If you use Kubernetes, enter kubectl instead of oc.
Procedure
Check the Central logs by running the following command:
$ oc logs -n stackrox deploy/central -c centralExample output
No database restore directory found (this is not an error). Migrator: 2023/04/19 17:58:54: starting DB compaction Migrator: 2023/04/19 17:58:54: Free fraction of 0.0391 (40960/1048576) is < 0.7500. Will not compact badger 2023/04/19 17:58:54 INFO: All 1 tables opened in 2ms badger 2023/04/19 17:58:55 INFO: Replaying file id: 0 at offset: 846357 badger 2023/04/19 17:58:55 INFO: Replay took: 50.324µs badger 2023/04/19 17:58:55 DEBUG: Value log discard stats empty Migrator: 2023/04/19 17:58:55: DB is up to date. Nothing to do here. badger 2023/04/19 17:58:55 INFO: Got compaction priority: {level:0 score:1.73 dropPrefix:[]} version: 2023/04/19 17:58:55.189866 ensure.go:49: Info: Version found in the DB was current. We’re good to go!