workerslicegwrecycler

package
v1.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ST_init                   string = "init"
	ST_new_deployment_created string = "new_deployment_created_state"
	ST_slicerouter_updated    string = "slicerouter_updated_state"
	ST_old_deployment_deleted string = "old_deployment_deleted_state"
	ST_error                  string = "error_state"
	ST_end                    string = "end"
)

FSM State names

View Source
const (
	EV_verify_new_deployment_created string = "verify_new_deployment_created"
	EV_update_routing_table          string = "update_routing_table"
	EV_delete_old_gw_deployment      string = "delete_old_gw_deployment"
	EV_on_error                      string = "on_error"
	EV_end                           string = "end"
)

FSM Event names

Variables

This section is empty.

Functions

This section is empty.

Types

type Reconciler

type Reconciler struct {
	client.Client
	Log                   logr.Logger
	Scheme                *runtime.Scheme
	MeshClient            client.Client
	WorkerGWSidecarClient WorkerGWSidecarClientProvider
	WorkerRouterClient    WorkerRouterClientProvider
	EventRecorder         *events.EventRecorder
	FSM                   map[string]*fsm.FSM
}

func (*Reconciler) CheckIfDeploymentIsPresent added in v1.1.5

func (r *Reconciler) CheckIfDeploymentIsPresent(ctx context.Context, depName string, sliceName, sliceGwName string) bool

func (*Reconciler) CheckRouteInSliceRouter added in v1.1.5

func (r *Reconciler) CheckRouteInSliceRouter(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway, gwNsmIP string) (bool, error)

func (*Reconciler) CreateNewDeployment added in v1.1.5

func (r *Reconciler) CreateNewDeployment(ctx context.Context, depName string, sliceName, sliceGwName string) (ctrl.Result, error, bool)

func (*Reconciler) GetNsmIPForNewDeployment added in v1.1.5

func (r *Reconciler) GetNsmIPForNewDeployment(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway, depName string) (string, error)

func (*Reconciler) InjectClient

func (a *Reconciler) InjectClient(c client.Client) error

func (*Reconciler) MarkGwRouteForDeletion added in v1.1.5

func (r *Reconciler) MarkGwRouteForDeletion(ctx context.Context, sliceGw *kubeslicev1beta1.SliceGateway, depName string) error

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

The basic principles of the workerslicegatewayrecycler are as follows:

The server instance is the orchestrator of the recycling process. It is the owner of the FSM. The FSM maintains the status of the recycling process. Only the server instance should update the states. It can send requests to the client instance using the Request field in the Spec secion of the CR. The progression of the FSM depends on the responses received from the client instance.

The client instance is driven by the requests posted by the server instance. The client instance performs the needed operations to fulfill the requests. On completion of a request, it should post an appropriate response.

The workerslicegatewayrecycler reconciler is an external orchestrator of the recycling process. It should not create or delete slice gateway services or deployments. It can only request such actions from the slicegateway reconciler. It should only read the state of the slicegateways and slicerouters to deduce the next actions to be taken to progress the recycling process.

The FSM should not be re-initialized if the operator restarts. The server instance must pick up from where it had left.

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up reconciler with manager

func (*Reconciler) TriggerGwDeploymentDeletion added in v1.1.5

func (r *Reconciler) TriggerGwDeploymentDeletion(ctx context.Context, sliceName, sliceGwName, depName, newDepName string) error

type Request added in v1.1.5

type Request int

Operation Request names

const (
	REQ_invalid Request = -1
	REQ_none    Request = iota
	REQ_create_new_deployment
	REQ_update_routing_table
	REQ_delete_old_gw_deployment
)

type Response added in v1.1.5

type Response int

Operation Response names The names must be in the order of forward progression of the FSM.

const (
	RESP_invalid Response = -1
	RESP_none    Response = iota
	RESP_new_deployment_created
	RESP_routing_table_updated
	RESP_old_deployment_deleted
)

type WorkerGWSidecarClientProvider

type WorkerGWSidecarClientProvider interface {
	GetStatus(ctx context.Context, serverAddr string) (*gwsidecar.GwStatus, error)
}

type WorkerRouterClientProvider

type WorkerRouterClientProvider interface {
	UpdateEcmpRoutes(ctx context.Context, serverAddr string, ecmpUpdateInfo *router.UpdateEcmpInfo) error
	GetRouteInKernel(ctx context.Context, serverAddr string, sliceRouterConnCtx *router.GetRouteConfig) (*sidecar.VerifyRouteAddResponse, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL