Skip to content
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

UpdateSelector: implementation #239

Merged
merged 6 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions api/v1/ytsaurus_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`

Expand Down Expand Up @@ -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"`
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/cluster.ytsaurus.tech_ytsaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading