From 9bd180bd4c3e35873e83b02294e736f92637fb16 Mon Sep 17 00:00:00 2001 From: Kirill Sibirev Date: Tue, 16 Apr 2024 15:23:15 +0200 Subject: [PATCH] Add UpdateStrategy field --- api/v1/ytsaurus_types.go | 16 ++++++++++++++++ .../bases/cluster.ytsaurus.tech_ytsaurus.yaml | 6 ++++++ docs/api.md | 16 ++++++++++++++++ ytop-chart/templates/ytsaurus-crd.yaml | 6 ++++++ 4 files changed, 44 insertions(+) diff --git a/api/v1/ytsaurus_types.go b/api/v1/ytsaurus_types.go index 11a48684..fc32a1d6 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 + // UpdateStrategy is an experimental field. Behaviour may change. + // If UpdateStrategy is not empty EnableFullUpdate is ignored. + UpdateStrategy UpdateStrategy `json:"updateStrategy"` Bootstrap *BootstrapSpec `json:"bootstrap,omitempty"` @@ -618,10 +622,22 @@ type TabletCellBundleInfo struct { TabletCellCount int `yson:"tablet_cell_count,attr" json:"tabletCellCount"` } +type UpdateStrategy string + +const ( + UpdateStrategyNone UpdateStrategy = "" + UpdateStrategyBlocked UpdateStrategy = "Blocked" + UpdateStrategyStatelessOnly UpdateStrategy = "StatelessOnly" + UpdateStrategyMasterOnly UpdateStrategy = "MasterOnly" + UpdateStrategyTabletNodesOnly UpdateStrategy = "TabletNodesOnly" + UpdateStrategyFull UpdateStrategy = "Full" +) + type UpdateStatus struct { //+kubebuilder:default:=None State UpdateState `json:"state,omitempty"` Components []string `json:"components,omitempty"` + Strategy UpdateStrategy `json:"updateStrategy,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..6c0a580e 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 + updateStrategy: + description: UpdateStrategy is an experimental field. Behaviour may + change. + type: string useIpv4: default: false type: boolean @@ -35902,6 +35906,8 @@ spec: - tabletCellCount type: object type: array + updateStrategy: + type: string type: object type: object type: object diff --git a/docs/api.md b/docs/api.md index a3f8116a..a0b6a400 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1489,11 +1489,26 @@ _Appears in:_ | --- | --- | --- | --- | | `state` _[UpdateState](#updatestate)_ | | None | | | `components` _string array_ | | | | +| `updateStrategy` _[UpdateStrategy](#updatestrategy)_ | | | | | `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#condition-v1-meta) array_ | | | | | `tabletCellBundles` _[TabletCellBundleInfo](#tabletcellbundleinfo) array_ | | | | | `masterMonitoringPaths` _string array_ | | | | +#### UpdateStrategy + +_Underlying type:_ _string_ + + + + + +_Appears in:_ +- [UpdateStatus](#updatestatus) +- [YtsaurusSpec](#ytsaurusspec) + + + #### YQLAgentSpec @@ -1577,6 +1592,7 @@ _Appears in:_ | `oauthService` _[OauthServiceSpec](#oauthservicespec)_ | | | | | `isManaged` _boolean_ | | true | | | `enableFullUpdate` _boolean_ | | true | | +| `updateStrategy` _[UpdateStrategy](#updatestrategy)_ | UpdateStrategy is an experimental field. Behaviour may change.
If UpdateStrategy 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..d4f0939f 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 + updateStrategy: + description: UpdateStrategy is an experimental field. Behaviour may + change. + type: string useIpv4: default: false type: boolean @@ -35670,6 +35674,8 @@ spec: - tabletCellCount type: object type: array + updateStrategy: + type: string type: object type: object type: object