-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use rqlite instead of Postgres #3335
Merged
sgalsaleh
merged 8 commits into
main
from
salah/sc-60222/deploy-rqlite-instead-of-postgres-and-migrate
Oct 25, 2022
Merged
Use rqlite instead of Postgres #3335
sgalsaleh
merged 8 commits into
main
from
salah/sc-60222/deploy-rqlite-instead-of-postgres-and-migrate
Oct 25, 2022
Conversation
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
sgalsaleh
force-pushed
the
salah/sc-60222/deploy-rqlite-instead-of-postgres-and-migrate
branch
3 times, most recently
from
October 19, 2022 19:15
8855bbc
to
061f34d
Compare
sgalsaleh
force-pushed
the
salah/sc-60222/deploy-rqlite-instead-of-postgres-and-migrate
branch
from
October 20, 2022 18:10
2cee580
to
4e3acec
Compare
sgalsaleh
force-pushed
the
salah/sc-60222/deploy-rqlite-instead-of-postgres-and-migrate
branch
from
October 20, 2022 22:22
d5511e4
to
e94ad33
Compare
divolgin
reviewed
Oct 24, 2022
divolgin
reviewed
Oct 24, 2022
divolgin
reviewed
Oct 24, 2022
divolgin
reviewed
Oct 25, 2022
cbodonnell
reviewed
Oct 25, 2022
divolgin
approved these changes
Oct 25, 2022
cbodonnell
approved these changes
Oct 25, 2022
sgalsaleh
deleted the
salah/sc-60222/deploy-rqlite-instead-of-postgres-and-migrate
branch
October 25, 2022 18:16
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Replaces Postgres with rqlite because:
Which issue(s) this PR fixes:
Fixes SC-60222
Special notes for your reviewer:
New Installs:
Upgrades and migration notes:
Postgres's schema is always updated to the most recent version (e.g. currently the schema in KOTS 1.88) before running the migration. This makes the migration process much simpler since there would only be a single permutation for the migration to cover. It also ensures a smoother migration process from older versions of KOTS that have outdated schemas.
The migration process will only be triggered if Postgres is detected AND the migration did not run previously. This ensures that the migration does not run again even if Postgres still exists in the cluster for some reason after the migration (e.g. KOTS failed to clean up Postgres resources).
A Postgres instance is detected if the
kotsadm-postgres
secret exists in the cluster with a connection string / URI.Postgres resources will be cleaned up and removed from the cluster after a successful upgrade.
Two migration tests were added:
- One that tests upgrading from an older version of KOTS (v1.57.0) and ensures the migration runs successfully.
- A more thorough integration test that validates the integrity of both the schema and the data before and after the migration.
Timestamps in Postgres are converted to Unix timestamps (integers) when stored in or migrated to rqlite.
Byte arrays in Postgres are converted to Base64 encoded strings when stored in or migrated to rqlite.
Other notes:
kots enable-ha
CLI command that will enable HA mode by scaling up thekotsadm-rqlite
StatefulSet to3
replicas and distribute them across different nodes. The command will print an error message if the criteria to enable HA are not met. The criteria right now is having at least3
nodes in the cluster.Steps to reproduce
Does this PR introduce a user-facing change?
Does this PR require documentation?
replicatedhq/replicated-docs#713