-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Steven Smith <[email protected]>
- Loading branch information
Showing
9 changed files
with
227 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
[id="upgrading-clair-postgresql-database"] | ||
= Upgrading the Clair PostgreSQL database | ||
|
||
If you are upgrading {productname} to version 13, you must migrate your Clair PostgreSQL database version from PostgreSQL version 13 -> version 15. This requires bringing down your Clair PostgreSQL 13 database and running a migration script to initiate the process. | ||
|
||
Use the following procedure to upgrade your Clair PostgreSQL database from version 13 -> to version 15. | ||
|
||
[IMPORTANT] | ||
==== | ||
Clair security scans might become temporarily disrupted after the migration procedure has succeeded. | ||
==== | ||
|
||
.Procedure | ||
|
||
. Stop the {productname} container by entering the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ sudo podman stop <quay_container_name> | ||
---- | ||
|
||
. Stop the Clair container by running the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ sudo podman stop <clair_container_id> | ||
---- | ||
|
||
. Run the following Podman process from SCLOrg's link:https://github.com/sclorg/postgresql-container/tree/master/13#data-migration[Data Migration] procedure, which allows for data migration from a remote PostgreSQL server: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ sudo podman run -d --name <clair_migration_postgresql_database> <1> | ||
-e POSTGRESQL_MIGRATION_REMOTE_HOST=<container_ip_address> \ <2> | ||
-e POSTGRESQL_MIGRATION_ADMIN_PASSWORD=remoteAdminP@ssword \ | ||
-v </host/data/directory:/var/lib/pgsql/data:Z> \ <3> | ||
[ OPTIONAL_CONFIGURATION_VARIABLES ] | ||
registry.redhat.io/rhel8/postgresql-15 | ||
---- | ||
+ | ||
<1> Insert a name for your Clair PostgreSQL 15 migration database. | ||
<2> Your new Clair PostgreSQL 15 database container IP address. Can obtained by running the following command: `sudo podman inspect -f "{{.NetworkSettings.IPAddress}}" postgresql-quay`. | ||
<3> You must specify a different volume mount point than the one from your initial Clair PostgreSQL 13 deployment, and modify the access control lists for said directory. For example: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ mkdir -p /host/data/clair-postgresql15-directory | ||
---- | ||
+ | ||
[source,terminal] | ||
---- | ||
$ setfacl -m u:26:-wx /host/data/clair-postgresql15-directory | ||
---- | ||
+ | ||
This prevents data from being overwritten by the new container. | ||
|
||
. Stop the Clair PostgreSQL 13 container: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ sudo podman stop <clair_postgresql13_container_name> | ||
---- | ||
|
||
. After completing the PostgreSQL migration, run the Clair PostgreSQL 15 container, using the new data volume mount from Step 3, for example, `</host/data/clair-postgresql15-directory:/var/lib/postgresql/data>`: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ sudo podman run -d --rm --name <postgresql15-clairv4> \ | ||
-e POSTGRESQL_USER=<clair_username> \ | ||
-e POSTGRESQL_PASSWORD=<clair_password> \ | ||
-e POSTGRESQL_DATABASE=<clair_database_name> \ | ||
-e POSTGRESQL_ADMIN_PASSWORD=<admin_password> \ | ||
-p 5433:5432 \ | ||
-v </host/data/clair-postgresql15-directory:/var/lib/postgresql/data:Z> \ | ||
registry.redhat.io/rhel8/postgresql-15 | ||
---- | ||
|
||
. Start the {productname} container by entering the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ sudo podman run -d --rm -p 80:8080 -p 443:8443 --name=quay \ | ||
-v /home/<quay_user>/quay-poc/config:/conf/stack:Z \ | ||
-v /home/<quay_user>/quay-poc/storage:/datastorage:Z \ | ||
{productrepo}/{quayimage}:{productminv} | ||
---- | ||
|
||
. Start the Clair container by entering the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ sudo podman run -d --name clairv4 \ | ||
-p 8081:8081 -p 8088:8088 \ | ||
-e CLAIR_CONF=/clair/config.yaml \ | ||
-e CLAIR_MODE=combo \ | ||
registry.redhat.io/quay/clair-rhel8:{productminv} | ||
---- | ||
|
||
For more information, see link:https://github.com/sclorg/postgresql-container/tree/master/13#data-migration[Data Migration]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters