-
Notifications
You must be signed in to change notification settings - Fork 191
VMDistributedCluster CR: orchestrate VMCluster upgrades #1556
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
base: master
Are you sure you want to change the base?
Conversation
|
initially thought distributed CR is needed for full distributed setup management, but looks like it only performs version upgrade. In this case just curious why we need different CRs for VM, VT and VL? |
eaeacd4 to
c02b24c
Compare
|
Yes, so far we're focusing on upgrades - existing CRs provide sufficient flexibility IMO - and we didn't get a request for other actions so far.
VL and VT don't have agents (yet) so their specs would be different. However we can reuse the same approach and probably even some helper functions |
Haleygo
left a comment
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.
Yes, so far we're focusing on upgrades - existing CRs provide sufficient flexibility IMO - and we didn't get a request for other actions so far.
I believe users would expect to modify the vmcluster spec value or apply extra flags to the vmclusters.
And since vmclusterSpec.ClusterVersion is optional, users could specify component versions inside vmclusterSpec which overrides the vmclusterSpec.ClusterVersion.
And currently, it seems VMDistributedCluster only covers a limited scenario where resources like vmcluster, vmuser, vmauth are defined and configured as needed.
Could you please provide an example of how to config them to achieve similar topology described in victoria-metrics-distributed chart? I expect VMDistributedCluster to be supported there when released.
internal/controller/operator/factory/vmdistributedcluster/vmdistributedcluster.go
Outdated
Show resolved
Hide resolved
internal/controller/operator/factory/vmdistributedcluster/vmdistributedcluster.go
Outdated
Show resolved
Hide resolved
Yup, setting generic |
280b2e6 to
04b44f9
Compare
04b44f9 to
1336f73
Compare
1336f73 to
c3b3e24
Compare
internal/controller/operator/factory/vmdistributedcluster/vmdistributedcluster.go
Outdated
Show resolved
Hide resolved
internal/controller/operator/factory/vmdistributedcluster/vmdistributedcluster.go
Outdated
Show resolved
Hide resolved
| // +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.updateStatus",description="current status of update rollout" | ||
| // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" | ||
| // VMDistributedClusterSpec is progressively rolling out updates to multiple VMClusters. | ||
| type VMDistributedCluster struct { |
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 feature isn’t limited to vmcluster, it can also be applied to vmsingle.
Later, we can support vmsingle with the same CRD by replacing vmcluster objects under VMDistributedClusterSpec with vmsingle.
What about calling it VMDistributed?
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.
Yes, I think it's fair to extend this to VMSingle too. I think it would be trivial to extend this to VMSingles - by adding VMType to Zones property. We didn't get a request to extend this to VMSingle though, so I'd prefer to focus on VMClusters.
Not quite sure about VMDistributed - its fair to treat multiple zones as a cluster (so VMCluster would be a fantastic name :) ), while VMDistributed doesn't really pinpoint it.
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.
We didn't get a request to extend this to VMSingle though, so I'd prefer to focus on VMClusters.
I disagree. The VMDistributedCluster audience is the same as the distributed chart’s audience. We’ve received requests to support vmsingle there and added it, see VictoriaMetrics/helm-charts#2090, VictoriaMetrics/helm-charts#2517.
So the need exists, and I believe we should cover it if there are no technical blockers, which I don’t see.
However, the current implementation cannot be extended to support vmsingle in zones without introducing a breaking change.
I think we can either expand the zones, like
Zones []zone `json:"zones,omitempty"`
type zone struct {
vmclusterList []VMClusterRefOrSpec `json:"vmclusterList,omitempty"`
// allow adding vmsingleList now or later
}
or rename the zones field to something like vmclusterList as suggested here, then vmsingleList can be added without affect vmclusterList.
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.
Wouldn't it be easier to update VMClusterRefOrSpec instead? We may also want to define VMSingles inline.
I agree that its best to have a structure for vmsingles ready now
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.
Oh, that makes us rename Spec into ClusterSpec and introduce SingleSpec, which is ugly - so I like your solution better
internal/controller/operator/factory/vmdistributedcluster/vmdistributedcluster.go
Outdated
Show resolved
Hide resolved
internal/controller/operator/factory/vmdistributedcluster/vmdistributedcluster.go
Outdated
Show resolved
Hide resolved
a5c6693 to
43e7344
Compare
4efee35 to
5a92268
Compare
529b9b7 to
030e308
Compare
Add a new CR -
VMDistributedCluster- so that multiple VMClusters can be upgraded in an orchestrated fashion, ensuring the read VMAuth is disabled before upgrade and the VMAgent (if available) doesn't have pending bytes to send.Fixes #1515
This CR can refer to VMClusters using one of two possible ways:
refproperty and changes applied usingoverrideSpecnameandspecpropertiesEither way, settings in VMDistributedCluster would be applied to target VMClusters, overriding their existing settings if necessary.
Current implementation scope:
See #1515 (comment) for agreed limitations for v1alpha1 version:
TODO:
Keeping original commits for review as its useful to show how the feature was developed