From cc59df9947a8977b6bcdd1e470b5a0f1a3c204eb 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 | 5 +++++ docs/api.md | 18 +++++++++++++++++- ytop-chart/templates/ytsaurus-crd.yaml | 5 +++++ 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/api/v1/ytsaurus_types.go b/api/v1/ytsaurus_types.go index 11a48684..29406102 100644 --- a/api/v1/ytsaurus_types.go +++ b/api/v1/ytsaurus_types.go @@ -543,9 +543,13 @@ type YtsaurusSpec struct { //+kubebuilder:default:=true //+optional IsManaged bool `json:"isManaged"` + // EnableFullUpdate is deprecated, use UpdateStrategy instead. + // EnableFullUpdate is only considered if UpdateStrategy is empty. //+kubebuilder:default:=true //+optional EnableFullUpdate bool `json:"enableFullUpdate"` + //+optional + 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..c6376356 100644 --- a/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml +++ b/config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml @@ -7158,6 +7158,7 @@ spec: type: object enableFullUpdate: default: true + description: EnableFullUpdate is deprecated, use UpdateStrategy instead. type: boolean ephemeralCluster: default: false @@ -33433,6 +33434,8 @@ spec: type: object uiImage: type: string + updateStrategy: + type: string useIpv4: default: false type: boolean @@ -35902,6 +35905,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..a089d4d9 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 @@ -1576,7 +1591,8 @@ _Appears in:_ | `adminCredentials` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#localobjectreference-v1-core)_ | | | | | `oauthService` _[OauthServiceSpec](#oauthservicespec)_ | | | | | `isManaged` _boolean_ | | true | | -| `enableFullUpdate` _boolean_ | | true | | +| `enableFullUpdate` _boolean_ | EnableFullUpdate is deprecated, use UpdateStrategy instead.
If UpdateStrategy is not | true | | +| `updateStrategy` _[UpdateStrategy](#updatestrategy)_ | | | | | `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..3874fdef 100644 --- a/ytop-chart/templates/ytsaurus-crd.yaml +++ b/ytop-chart/templates/ytsaurus-crd.yaml @@ -7120,6 +7120,7 @@ spec: type: object enableFullUpdate: default: true + description: EnableFullUpdate is deprecated, use UpdateStrategy instead. type: boolean ephemeralCluster: default: false @@ -33220,6 +33221,8 @@ spec: type: object uiImage: type: string + updateStrategy: + type: string useIpv4: default: false type: boolean @@ -35670,6 +35673,8 @@ spec: - tabletCellCount type: object type: array + updateStrategy: + type: string type: object type: object type: object