Migration from docker compose demo config to production Kubernetes config

Created by George I., Modified on Mon, 20 Nov 2023 at 11:01 PM by Daniel S.

Motivation

This is all about saving your time, efforts, resources and (yes) money, the less time you spend on a system maintenance, the less money you spend on this very system maintenance.

Having Allure TestOps deployed in the way suitable for production allows you to avoid spending time on migrations and makes the system easier to maintain.


Main idea

All stateless components are in the deploy.

  • Allure TestOps services
    • report
    • gateway
    • uaa
  • 3P services
    • Redis


All stateful components are deployed separately.

  • DataBases to be in a stand-alone DB server
    • report DB
    • uaa DB
  • RabbitMQ is deployed as a stand-alone service
  • S3 
    • is either deployed as a stand-alone service
      • e.g. minio or ceph
    • You can use S3 from AWS or Google


Migration to dedicated database server

  1. Deploy PostgreSQL 14 server
    1. Create report and uaa databases, see the docs: https://docs.qameta.io/allure-testops/configuration/external-database/
  2. Stop any traffic to Allure TestOps and migrate the database
    1. docker compose stop gateway report uaa (check docker compose ps for actual services names)
    2. make the dump of databases: https://docs.qameta.io/allure-testops/configuration/backup-restore/
      1. report database
      2. uaa database
    3. restore the databases to the dedicated PostgreSQL server
      1. make sure to restore report >> report, uaa >> uaa
    4. update `.env` env variables responsible for the database connections with the references to the standalone DB server
    5. Stop the deployment via `docker compose down`
    6. Start the deployment via  `docker compose up -d`
  3. Perform the tests to be sure the connection with the DB works fine (create, delete, view tests and test results and attachments).

Preparation for the S3 migration

Create S3 storage

The instructions below are for the migration to minio, it could be applied to any S3 storage migration except the actions explicitly designated for minio.
  1. Deploy minio as standalone solution with SSD under hood. 
  2. Alternatives are
    1. AWS S3 - recommended
    2. Google cloud storage - recommended
    3. Ceph with SSD under hood - less performance comparing to AWS and Google.
    4. We don't recommend using direct file system / storage without S3 emulation.
  3. Create a new user for Allure TestOps with rights to put, move, copy, delete files (objects).
  4. Create new bucket, make sure that Allure TestOps user has got all the rights for the bucket described above.

Preparation of the Kubernetes deployment using Helm chart

  1. Start preparing the configs for Kubernetes deployment as described here: https://docs.qameta.io/allure-testops/getstarted/kubernetes/
  2. prepare values.yaml
    1. use the standalone database you've already migrated to
      1. check: https://github.com/qameta/allure-testops-deployment/blob/4211a12fd64bd3d4a97023be1a3deea44014cbfc/charts/allure-testops/values.yaml#L155
    2. use S3 settings for the minio server you are migrating to
      1. https://github.com/qameta/allure-testops-deployment/blob/master/charts/allure-testops/values.yaml#L194
      2. https://github.com/qameta/allure-testops-deployment/blob/4211a12fd64bd3d4a97023be1a3deea44014cbfc/charts/allure-testops/values.yaml#L204
      3. should be false: https://github.com/qameta/allure-testops-deployment/blob/master/charts/allure-testops/values.yaml#L233

Now, switch

  1. Stop all the traffic to Allure TestOps `docker compose stop gateway` (check `docker compose ps` for actual services names)
  2. For minio only: Copy all the files from report container to minio bucket using (this is very important) minio CLI tool see here
    1. we've prepared additional service for the docker compose deployment, so you either can use directly or you can use it as an example to copy the files. Here is the service: https://github.com/qameta/allure-docker-compose/blob/master/extras/minio.md#fs-to-minio-migration-job 
      1. you just can reuse the commands from there
    2. without minio client files won't be indexed properly and won't get correct access rights and ultimately won't be accessible by ATO
  3. For any other S3 just copy data from the docker compose container to a proper bucket in S3.
  4. When all the files are copied to S3
    1. stop docker compose deployment completely via `docker compose down`
    2. deploy Allure TestOps in K8s using prepared values.yaml
    3. Check k8s deployment works
      1. results upload, attachments can be saved and viewed
      2. manual test cases can be created with attachments
      3. launch with manual tests can be created and attachments from manual test cases appeat in the test results
      4. you can add attachments to the test results

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article