changes deployment manifest to use statefulset #34
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.
Closes #18
Closes #17
Partially supports #7
With the usage of go-workflows, which we have currently configured with SQLite, we will need some durable persistence for the database WAL.
This PR changes the manifest to use a StatefulSet with 2 replicas for now to demonstrate that state distributed across replicas should be fine for this use case. It also adds a volumeClaimTemplate for the database storage.
What's the deal with durability and HA
This project is currently configured to persist workflow state to a local SQLite. It turns out having multiple replicas with their own local SQLite databases should be fine because the workflows are engineered to be idempotent and SpiceDB and Kube API server act as the source of truth.
If 2 replicas ended up receiving the exact same request (e.g. a client-side retry), two different
go-workflow
instances with their own SQLite will be executing a workflow. If activities from one instance interleave with those from another instance, the individual activities will be coordinated with the state of the backing SpiceDB/Kube API server.So for all intent and purposes, durability and high-availability for the MVP will be addressed by: