This repository was archived by the owner on Sep 30, 2024. It is now read-only.
appliance: move storage elements to standard feature#62903
Merged
craigfurman merged 2 commits intomainfrom May 28, 2024
Merged
Conversation
added 2 commits
May 28, 2024 10:12
Add a new standard block, persistentVolumeConfig, containing a storage size and storage class name. pvc.NewPersistentVolumeClaim() can fetch these values when a standard config is (optionally) passed to it, similar to other standard features. Remove service-specific code that parses storage quantities out of config. Regarding storage class, this makes the reconciler "dumber" and more verbosely-configured: every PVC must be explicitly assigned a storage class (or none), rather than taking from the global StorageClassSpec. Note that this doesn't have direct implications for admin UX: the appliance web app can still have features to configure a single, global, storage class name - it can simply copy this field everywhere needed into the ConfigMap it crafts. This relates to https://linear.app/sourcegraph/issue/REL-16/appliance-can-create-recommended-storageclasses-for-various-k8s also - the StorageClassSpec is unused until that feature is implemented.
Now that we have a standard feature, we can replace most instances of with-storage tests with one standard fixture. Symbols is the exception, since there is some logic done on the storage size (to determine a cache size env var).
b1e675c to
6eb4ad7
Compare
jdpleiness
approved these changes
May 28, 2024
Contributor
jdpleiness
left a comment
There was a problem hiding this comment.
I checked out the PR, ran the golden tests, and didn't see any divergence on my end either 🎉
Regarding storage class, this makes the reconciler "dumber" and more
verbosely-configured: every PVC must be explicitly assigned a storage
class (or none), rather than taking from the global StorageClassSpec.
While this makes the rec "dumber", I think this is actually a more desirable behavior in the end as it allows more granular control over storage classes if needed.
Contributor
Author
|
For sure, I meant dumber as a good thing in this case. Reconciler dumb, appliance application that serialises the ConfigMap smart. 😁 |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Please review one commit at a time, in order to give another pair of eyes to this being a pure refactor (the only golden file changes are config hashes and the actual spec structure, with the exception of redis, in which I changed the quantities to make sure we weren't accidentally feeding cache config to store or vice-versa).
appliance: move storage elements to standard feature
Add a new standard block, persistentVolumeConfig, containing a storage
size and storage class name. pvc.NewPersistentVolumeClaim() can fetch
these values when a standard config is (optionally) passed to it,
similar to other standard features.
Remove service-specific code that parses storage quantities out of
config.
Regarding storage class, this makes the reconciler "dumber" and more
verbosely-configured: every PVC must be explicitly assigned a storage
class (or none), rather than taking from the global StorageClassSpec.
Note that this doesn't have direct implications for admin UX: the
appliance web app can still have features to configure a single, global,
storage class name - it can simply copy this field everywhere needed
into the ConfigMap it crafts. This relates to
https://linear.app/sourcegraph/issue/REL-16/appliance-can-create-recommended-storageclasses-for-various-k8s
also - the StorageClassSpec is unused until that feature is implemented.
appliance: consolidate storage tests
Now that we have a standard feature, we can replace most instances of
with-storage tests with one standard fixture. Symbols is the exception,
since there is some logic done on the storage size (to determine a cache
size env var).
Test plan
Golden tests included.