-
Notifications
You must be signed in to change notification settings - Fork 83
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
volume: Add support for volume size and env variable overrides (PROJQUAY-1090) #586
Conversation
jonathankingfc
commented
Nov 4, 2021
•
edited by ricardomaraschini
Loading
edited by ricardomaraschini
- Add overrides to component spec
- Add volumeSize to overrides spec field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the ticket for this pull request: https://issues.redhat.com/browse/PROJQUAY-1090
I propose to add arbitrary labels as well. This will help with a lot of use cases where customers want to leverage labels to base automation and customization upon. One particular example is router sharding in OpenShift (https://docs.openshift.com/container-platform/4.9/networking/ingress-operator.html#nw-ingress-sharding-route-labels_configuring-ingress) |
cd77cc4
to
6861556
Compare
apis/quay/v1/quayregistry_types.go
Outdated
ComponentMirror = "mirror" | ||
ComponentMonitoring = "monitoring" | ||
ComponentTLS = "tls" | ||
ComponentBase = "base" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep these constants typed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way it was only the ComponentBase had a different type, all the others were strings: https://goplay.space/#C-DHpg_1hcO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed back to Componentkind type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you gonna have to add ComponentKind
to each line, otherwise only the first one is of type ComponentKind
. Can you do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at my comments.
apis/quay/v1/quayregistry_types.go
Outdated
ComponentMirror = "mirror" | ||
ComponentMonitoring = "monitoring" | ||
ComponentTLS = "tls" | ||
ComponentBase = "base" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way it was only the ComponentBase had a different type, all the others were strings: https://goplay.space/#C-DHpg_1hcO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jonathankingfc,
I thought we had agreed that we would focus on overrides, but this PR includes both labels and env vars.
What are you plans here?
d69afd2
to
9ec9cd3
Compare
@flavianmissi Updated the PR with fixes proposed by @ricardomaraschini and removed any implementation of env and label overrides (this should be supported in a later PR). |
9ec9cd3
to
f8eeea2
Compare
f8eeea2
to
9ed6371
Compare
0e1af36
to
573a3d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, just clarifying some things below.
apis/quay/v1/quayregistry_types.go
Outdated
var supportsVolumeOverride = []ComponentKind{ | ||
ComponentPostgres, | ||
ComponentClair, | ||
ComponentObjectStorage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does ObjectStorage support Override ? The Jira card has, as an acceptance criteria:
"volume overrides available for every managed component that uses a PersistentVolume (Noobaa Backend, Postgres for Quay, Postgres for Clair)"
I know that we do not set the size of the Nooba Backend but before merging this we better clarify the behavior with the Jira card reporter.
5a1ba49
to
e93e2c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good! Let's just await for @dmesser in the Jira card then we can get this in.
pkg/middleware/middleware.go
Outdated
if volumeSizeOverride != nil { | ||
// Ensure that volume size is not being reduced | ||
if pvc.Spec.Resources.Requests.Storage() != nil && volumeSizeOverride.Cmp(*pvc.Spec.Resources.Requests.Storage()) == -1 { | ||
return nil, fmt.Errorf("cannot shrink volume override size from %s to %s", volumeSizeOverride.String(), pvc.Spec.Resources.Requests.Storage().String()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't from
and to
inverted here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathankingfc this is the last one, I promise :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
- Add override field to Operator CRD to allow for volume size overrides - Add tests to reflect changes in API
e93e2c3
to
8c0cce2
Compare
- Add override field to Operator CRD to allow for volume size overrides - Add tests to reflect changes in API
- Add override field to Operator CRD to allow for volume size overrides - Add tests to reflect changes in API