Skip to content

Commit ee31a55

Browse files
authored
update TNG docs on manual external access migration (quay#107)
1 parent cae3a50 commit ee31a55

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

modules/proc_deploy-quay-openshift-operator-tng.adoc

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ If any of these considerations are unacceptable for your environment, it would b
133133

134134
==== Using Existing (Un-Managed) Components With the Quay Operator
135135

136-
If you have an existing components such as Postgres, Redis or object storage that you would like to use with Quay, you first configure then within the Quay configuration bundle (`config.yaml`) and then reference the bundle in your `QuayRegistry` (as a Kubernetes `secret`) while indicating which Components are unmanaged.
136+
If you have existing components such as Postgres, Redis or object storage that you would like to use with Quay, you first configure them within the Quay configuration bundle (`config.yaml`) and then reference the bundle in your `QuayRegistry` (as a Kubernetes `Secret`) while indicating which components are unmanaged.
137137

138138
For example, to use an existing Postgres database:
139139

@@ -232,13 +232,13 @@ metadata:
232232

233233
. Create the `QuayRegistry` in your namespace:
234234

235-
```
235+
```sh
236236
$ oc create -n <your-namespace> -f quay.yaml
237237
```
238238

239239
. Wait until the `status.registryEndpoint` is populated.
240240

241-
```
241+
```sh
242242
$ oc get -n <your-namespace> quayregistry my-registry -o jsonpath="{.status.registryEndpoint}" -w
243243
```
244244

@@ -269,7 +269,9 @@ When the Quay Operator starts up, it immediately looks for any `QuayRegistries`
269269

270270
Upgrades are supported from previous versions of the Operator which used the `QuayEcosystem` API for a limited set of configurations. To ensure that migrations do not happen unexpectedly, a special label needs to be applied to the `QuayEcosystem` for it to be migrated. A new `QuayRegistry` will be created for the Operator to manage, but the old `QuayEcosystem` will remain until manually deleted to ensure that you can roll back and still access Quay in case anything goes wrong. To migrate an existing `QuayEcosystem` to a new `QuayRegistry`, follow these steps:
271271

272-
. If using an Operator-managed database, ensure that the password is set for the `postgres` root admin user (not set by default). This allows remote access to the database for migration. The Operator looks for this password in the `Secret` referenced by `spec.quay.database.credentialsSecretKey` under the `database-root-password` key.
272+
==== Preparing Managed Database for Migration
273+
274+
If using an external database not deployed by the Quay Operator, skip this step. Otherwise, ensure that the password is set for the `postgres` root admin user (not set by default). This allows remote access to the database for migration. The Operator looks for this password in the `Secret` referenced by `spec.quay.database.credentialsSecretKey` under the `database-root-password` key.
273275

274276
To set/change the password, use either the OpenShift console or `kubectl` to [open an SSH terminal connection](https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/) to the Postgres pod:
275277
```sh
@@ -285,9 +287,11 @@ Type "help" for help.
285287
postgres=# \password
286288
```
287289

290+
==== Performing QuayEcosystem Upgrade
291+
288292
. Add `"quay-operator/migrate": "true"` to the `metadata.labels` of the `QuayEcosystem`.
289293

290-
. Wait for a `QuayRegistry` to be created with the same `metadata.name` as your `QuayEcosystem`.
294+
. Wait for a `QuayRegistry` to be created with the same `metadata.name` as your `QuayEcosystem`. The `QuayEcosystem` will be marked with the label `"quay-operator/migration-complete": "true"`.
291295

292296
. Once the `status.registryEndpoint` of the new `QuayRegistry` is set, access Quay and confirm all data and settings were migrated successfully.
293297

@@ -297,40 +301,50 @@ postgres=# \password
297301

298302
If something goes wrong during the automatic upgrade from `QuayEcosystem` to `QuayRegistry`, follow these steps to revert back to using the `QuayEcosystem`:
299303

300-
. Delete the `QuayRegistry` using either the UI or `kubectl`:
304+
* Delete the `QuayRegistry` using either the UI or `kubectl`:
301305
```sh
302306
$ kubectl delete -n <namespace> quayregistry <quayecosystem-name>
303307
```
304308

305-
. If external access was provided using a `Route`, change the `Route` to point back to the original `Service` using the UI or `kubectl`.
309+
* If external access was provided using a `Route`, change the `Route` to point back to the original `Service` using the UI or `kubectl`.
306310

307311
[NOTE]
308312
====
309-
If your `QuayEcosystem` was managing the {productname} Postgres database, the upgrade process will migrate your data to a new Postgres database managed by the upgraded Operator. Your old database will not be changed or removed but Quay will no longer use it once the migration is completed. If there are issues during the data migration, the upgrade process will exit and it is recommended that you continue with your database as an unmanaged component.
313+
If your `QuayEcosystem` was managing the Postgres database, the upgrade process will migrate your data to a new Postgres database managed by the upgraded Operator. Your old database will not be changed or removed but Quay will no longer use it once the migration is completed. If there are issues during the data migration, the upgrade process will exit and it is recommended that you continue with your database as an unmanaged component.
310314
====
311315

312316
==== Supported QuayEcosystem Configurations for Upgrades
313317

314318
The Quay Operator will report errors in its logs and in `status.conditions` if migrating a `QuayEcosystem` component fails or is unsupported. All unmanaged components should migrate successfully because no Kubernetes resources need to be adopted and all the necessary values are already provided in Quay's `config.yaml`.
315319

316320
*Database*
321+
317322
Ephemeral database not supported (`volumeSize` field must be set). The `postgres` user must have a password set and referenced in `credentialsSecretName` (instructions above).
318323

319324
*Redis*
325+
320326
Nothing special needed.
321327

322328
*External Access*
323-
Only `Route` access supported.
324329

325-
If using `LoadBalancer` (which the Operator will mark as an unmanaged component), ensure that you delete the `metadata.ownerReferences` field from existing `Service` _before_ deleting the `QuayEcosystem` to prevent Kubernetes from garbage collecting the `Service` and removing the load balancer. This can be achieved using the OpenShift UI or CLI.
330+
Only `Route` access supported for automatic migration. Manual migration required for other methods.
331+
332+
* `LoadBalancer` without custom hostname:
333+
After the `QuayEcosystem` is marked with label `"quay-operator/migration-complete": "true"`, delete the `metadata.ownerReferences` field from existing `Service` _before_ deleting the `QuayEcosystem` to prevent Kubernetes from garbage collecting the `Service` and removing the load balancer. A new `Service` will be created with `metadata.name` format `<QuayEcosystem-name>-quay-app`. Edit the `spec.selector` of the existing `Service` to match the `spec.selector` of the new `Service` so traffic to the old load balancer endpoint will now be directed to the new pods. You are now responsible for the old `Service`; the Quay Operator will not manage it.
334+
335+
* `LoadBalancer`/`NodePort`/`Ingress` with custom hostname:
336+
A new `Service` of type `LoadBalancer` will be created with `metadata.name` format `<QuayEcosystem-name>-quay-app`. Change your DNS settings to point to the `status.loadBalancer` endpoint provided by the new `Service`.
326337

327338
*Clair*
339+
328340
Nothing special needed.
329341

330342
*Object Storage*
343+
331344
`QuayEcosystem` did not have a managed object storage component, so object storage will always be marked as unmanaged. Local storage is not supported.
332345

333346
*Repository Mirroring*
347+
334348
Nothing special needed.
335349

336350
= Advanced Concepts

0 commit comments

Comments
 (0)