diff --git a/api/v1/ytsaurus_types.go b/api/v1/ytsaurus_types.go index 11a48684..93df16cd 100644 --- a/api/v1/ytsaurus_types.go +++ b/api/v1/ytsaurus_types.go @@ -546,6 +546,10 @@ type YtsaurusSpec struct { //+kubebuilder:default:=true //+optional EnableFullUpdate bool `json:"enableFullUpdate"` + //+optional + // UpdateSelector is an experimental field. Behaviour may change. + // If UpdateSelector is not empty EnableFullUpdate is ignored. + UpdateSelector UpdateSelector `json:"updateSelector"` Bootstrap *BootstrapSpec `json:"bootstrap,omitempty"` @@ -618,10 +622,45 @@ type TabletCellBundleInfo struct { TabletCellCount int `yson:"tablet_cell_count,attr" json:"tabletCellCount"` } +type UpdateSelector string + +const ( + // UpdateSelectorUnspecified means that selector is disabled and would be ignored completely. + UpdateSelectorUnspecified UpdateSelector = "" + // UpdateSelectorNothing means that no component could be updated. + UpdateSelectorNothing UpdateSelector = "Nothing" + // UpdateSelectorStatelessOnly means that only stateless components (everything but master and tablet nodes) + // could be updated. + UpdateSelectorStatelessOnly UpdateSelector = "StatelessOnly" + // UpdateSelectorMasterOnly means that only master could be updated. + UpdateSelectorMasterOnly UpdateSelector = "MasterOnly" + // UpdateSelectorTabletNodesOnly means that only tablet nodes could be updated + UpdateSelectorTabletNodesOnly UpdateSelector = "TabletNodesOnly" + // UpdateSelectorExecNodesOnly means that only tablet nodes could be updated + UpdateSelectorExecNodesOnly UpdateSelector = "ExecNodesOnly" + // UpdateSelectorEverything means that all components could be updated. + // With this setting and if master or tablet nodes need update all the components would be updated. + UpdateSelectorEverything UpdateSelector = "Everything" +) + +type UpdateFlow string + +const ( + UpdateFlowNone UpdateFlow = "" + UpdateFlowStateless UpdateFlow = "Stateless" + UpdateFlowMaster UpdateFlow = "Master" + UpdateFlowTabletNodes UpdateFlow = "TabletNodes" + UpdateFlowFull UpdateFlow = "Full" +) + type UpdateStatus struct { //+kubebuilder:default:=None - State UpdateState `json:"state,omitempty"` - Components []string `json:"components,omitempty"` + State UpdateState `json:"state,omitempty"` + Components []string `json:"components,omitempty"` + // Flow is an internal field that is needed to persist the chosen flow until the end of an update. + // Flow can be on of ""(unspecified), Stateless, Master, TabletNodes, Full and update cluster stage + // executes steps corresponding to that update flow. + Flow UpdateFlow `json:"flow,omitempty"` Conditions []metav1.Condition `json:"conditions,omitempty"` TabletCellBundles []TabletCellBundleInfo `json:"tabletCellBundles,omitempty"` MasterMonitoringPaths []string `json:"masterMonitoringPaths,omitempty"` diff --git a/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml b/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml index 67dff921..5b4cc373 100644 --- a/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml +++ b/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml @@ -33433,6 +33433,10 @@ spec: type: object uiImage: type: string + updateSelector: + description: UpdateSelector is an experimental field. Behaviour may + change. + type: string useIpv4: default: false type: boolean @@ -35883,6 +35887,10 @@ spec: - type type: object type: array + flow: + description: Flow is an internal field that is needed to persist + the chosen flow until the en + type: string masterMonitoringPaths: items: type: string diff --git a/docs/api.md b/docs/api.md index a3f8116a..b94e5f06 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1461,6 +1461,32 @@ _Appears in:_ | `group` _string_ | | | | +#### UpdateFlow + +_Underlying type:_ _string_ + + + + + +_Appears in:_ +- [UpdateStatus](#updatestatus) + + + +#### UpdateSelector + +_Underlying type:_ _string_ + + + + + +_Appears in:_ +- [YtsaurusSpec](#ytsaurusspec) + + + #### UpdateState _Underlying type:_ _string_ @@ -1489,6 +1515,7 @@ _Appears in:_ | --- | --- | --- | --- | | `state` _[UpdateState](#updatestate)_ | | None | | | `components` _string array_ | | | | +| `flow` _[UpdateFlow](#updateflow)_ | Flow is an internal field that is needed to persist the chosen flow until the end of an update.
Flow can be on of ""(unspecified), Stateless, Master, TabletNodes, Full and update cluster stage
executes steps corresponding to that update flow. | | | | `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#condition-v1-meta) array_ | | | | | `tabletCellBundles` _[TabletCellBundleInfo](#tabletcellbundleinfo) array_ | | | | | `masterMonitoringPaths` _string array_ | | | | @@ -1577,6 +1604,7 @@ _Appears in:_ | `oauthService` _[OauthServiceSpec](#oauthservicespec)_ | | | | | `isManaged` _boolean_ | | true | | | `enableFullUpdate` _boolean_ | | true | | +| `updateSelector` _[UpdateSelector](#updateselector)_ | UpdateSelector is an experimental field. Behaviour may change.
If UpdateSelector is not empty EnableFullUpdate is ignored. | | | | `bootstrap` _[BootstrapSpec](#bootstrapspec)_ | | | | | `discovery` _[DiscoverySpec](#discoveryspec)_ | | | | | `primaryMasters` _[MastersSpec](#mastersspec)_ | | | | diff --git a/ytop-chart/templates/ytsaurus-crd.yaml b/ytop-chart/templates/ytsaurus-crd.yaml index a63cada9..d3731c76 100644 --- a/ytop-chart/templates/ytsaurus-crd.yaml +++ b/ytop-chart/templates/ytsaurus-crd.yaml @@ -33220,6 +33220,10 @@ spec: type: object uiImage: type: string + updateSelector: + description: UpdateSelector is an experimental field. Behaviour may + change. + type: string useIpv4: default: false type: boolean @@ -35651,6 +35655,10 @@ spec: - type type: object type: array + flow: + description: Flow is an internal field that is needed to persist + the chosen flow until the en + type: string masterMonitoringPaths: items: type: string