Documentation ¶
Index ¶
Constants ¶
const ( ActionFailure fsm.Event = fsm.NoOp ActionSuccess fsm.Event = "action_success" AllNodesUpgraded fsm.Event = "all_nodes_upgraded" AllRacksUpgraded fsm.Event = "all_racks_upgraded" BeginUpgrade fsm.State = "begin_upgrade" CheckSchemaAgreement fsm.State = "check_schema_agreement" CreateSystemBackup fsm.State = "create_system_backup" FindNextRack fsm.State = "find_next_rack" UpgradeImageInPodSpec fsm.State = "upgrade_image_in_pod_spec" FindNextNode fsm.State = "find_next_node" EnableMaintenanceMode fsm.State = "enable_maintenance_mode" DrainNode fsm.State = "drain_node" BackupData fsm.State = "backup_data" DisableMaintenanceMode fsm.State = "disable_maintenance_mode" DeletePod fsm.State = "delete_pod" ValidateUpgrade fsm.State = "validate_upgrade" ClearDataBackup fsm.State = "clear_data_backup" ClearSystemBackup fsm.State = "clear_system_backup" RestoreUpgradeStrategy fsm.State = "restore_upgrade_strategy" FinishUpgrade fsm.State = "finish_upgrade" )
const (
ClusterVersionUpgradeAction = "rack-version-upgrade"
)
const RackCreateAction = "rack-create"
const RackReplaceNodeAction = "rack-replace-node"
const RackScaleDownAction = "rack-scale-down"
const RackScaleUpAction = "rack-scale-up"
const (
RackSynchronizedActionPrefix = "rack-synchronized-"
)
const (
SidecarVersionUpgradeAction = "sidecar-upgrade"
)
Variables ¶
var NewSessionFunc = func(hosts []string) (CQLSession, error) { cluster := gocql.NewCluster(hosts...) return gocqlx.WrapSession(cluster.CreateSession()) }
var ScyllaClientForClusterFunc = func(ctx context.Context, cc client.Client, hosts []string, logger log.Logger) (*scyllaclient.Client, error) { cfg := scyllaclient.DefaultConfig(hosts...) return scyllaclient.NewClient(cfg, logger) }
Functions ¶
func NewSidecarUpgrade ¶ added in v1.1.0
func NewSidecarUpgrade(c *scyllav1.ScyllaCluster, sidecar corev1.Container, l log.Logger) *rackSynchronizedAction
Types ¶
type Action ¶
type Action interface { // Name returns the action's name. // Useful for unit-testing. Name() string // Execute will execute the action using the // ClusterController to read and write the // state of the system. Execute(ctx context.Context, s *State) error }
Action represents a discrete action that a scylla rack can take. This can be a rack creation,
type CQLSession ¶ added in v1.1.0
type ClusterVersionUpgrade ¶
type ClusterVersionUpgrade struct { Cluster *scyllav1.ScyllaCluster ScyllaClient *scyllaclient.Client ClusterSession CQLSession // contains filtered or unexported fields }
func NewClusterVersionUpgradeAction ¶
func NewClusterVersionUpgradeAction(c *scyllav1.ScyllaCluster, l log.Logger) *ClusterVersionUpgrade
func (*ClusterVersionUpgrade) Execute ¶
func (a *ClusterVersionUpgrade) Execute(ctx context.Context, s *State) error
TODO:(zimnx) Refactor patch version upgrade into rack_synchronized action.
func (*ClusterVersionUpgrade) Name ¶
func (a *ClusterVersionUpgrade) Name() string
type RackCreate ¶
type RackCreate struct { Rack scyllav1.RackSpec Cluster *scyllav1.ScyllaCluster OperatorImage string }
func NewRackCreateAction ¶
func NewRackCreateAction(r scyllav1.RackSpec, c *scyllav1.ScyllaCluster, image string) *RackCreate
func (*RackCreate) Name ¶
func (a *RackCreate) Name() string
type RackReplaceNode ¶ added in v1.0.0
type RackReplaceNode struct { Rack scyllav1.RackSpec Cluster *scyllav1.ScyllaCluster Logger log.Logger }
func NewRackReplaceNodeAction ¶ added in v1.0.0
func NewRackReplaceNodeAction(r scyllav1.RackSpec, c *scyllav1.ScyllaCluster, l log.Logger) *RackReplaceNode
NewRackReplaceNodeAction returns action used for Scylla node replacement.
func (*RackReplaceNode) Execute ¶ added in v1.0.0
func (a *RackReplaceNode) Execute(ctx context.Context, s *State) error
Execute performs replace node operation. This action should be executed when at least one member service contain replace label. It will save IP address in Cluster status, delete PVC associated with Pod bound to marked member service which will release node affinity. Then Pod and member service itself will be deleted. Once StatefulSet controller creates new Pod and this Pod will enter ready state this action will cleanup replace label from member service, and replacement IP will be removed from Cluster status.
func (*RackReplaceNode) Name ¶ added in v1.0.0
func (a *RackReplaceNode) Name() string
Name returns name of the action.
type RackScaleDown ¶
type RackScaleDown struct { Rack scyllav1.RackSpec Cluster *scyllav1.ScyllaCluster }
func NewRackScaleDownAction ¶
func NewRackScaleDownAction(r scyllav1.RackSpec, c *scyllav1.ScyllaCluster) *RackScaleDown
func (*RackScaleDown) Execute ¶
func (a *RackScaleDown) Execute(ctx context.Context, s *State) error
func (*RackScaleDown) Name ¶
func (a *RackScaleDown) Name() string
type RackScaleUp ¶
type RackScaleUp struct { Rack scyllav1.RackSpec Cluster *scyllav1.ScyllaCluster }
func NewRackScaleUpAction ¶
func NewRackScaleUpAction(r scyllav1.RackSpec, c *scyllav1.ScyllaCluster) *RackScaleUp
func (*RackScaleUp) Name ¶
func (a *RackScaleUp) Name() string
type SidecarUpgrade ¶ added in v1.1.0
type SidecarUpgrade struct {
// contains filtered or unexported fields
}
func (*SidecarUpgrade) Name ¶ added in v1.1.0
func (a *SidecarUpgrade) Name() string
func (*SidecarUpgrade) RackUpdated ¶ added in v1.1.0
func (a *SidecarUpgrade) RackUpdated(sts *appsv1.StatefulSet) (bool, error)
func (*SidecarUpgrade) Update ¶ added in v1.1.0
func (a *SidecarUpgrade) Update(sts *appsv1.StatefulSet) error
type State ¶
type State struct { // Dynamic client - uses caching for lookups client.Client // contains filtered or unexported fields }
State contains tools to discover and modify the state of the world.
func NewState ¶
func NewState(client client.Client, kubeclient kubernetes.Interface, recorder record.EventRecorder) *State