controller

package
v0.0.0-...-d799a11 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrometheusNamespace = "kube_shuffle_sharder"
)

Variables

View Source
var ErrMissingNodeAutoDiscoveryLabel = errors.New("missing node-auto-discovery label")
View Source
var ErrMissingTenantLabel = errors.New("missing tenant label")
View Source
var ErrUnableToCastMeta = errors.New("unable to cast interface to object")
View Source
var ErrUnableToCastNode = errors.New("unable to cast interface to node")

Functions

func Choose

func Choose(n, k int) (*int, error)

Choose calculates n choose k - the number of possible combinations

func HashShard

func HashShard(shard []string) (string, error)

Types

type NodeGroup

type NodeGroup struct {
	NumNodes int
	Nodes    map[string]struct{}
}

type NodeGroupCollection

type NodeGroupCollection map[string]NodeGroup

type PodMutatingWebhook

type PodMutatingWebhook struct {
	Mu                          *sync.Mutex
	NodeCache                   NodeGroupCollection
	NodeGroupAutoDiscoveryLabel string
	TenantLabel                 string
	NumNodeGroups               int
	Decoder                     *admission.Decoder
	// contains filtered or unexported fields
}

func (*PodMutatingWebhook) AddFunc

func (p *PodMutatingWebhook) AddFunc(obj interface{})

func (*PodMutatingWebhook) DeleteFunc

func (p *PodMutatingWebhook) DeleteFunc(obj interface{})

func (*PodMutatingWebhook) Handle

func (*PodMutatingWebhook) SetupWithManager

func (p *PodMutatingWebhook) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager registers the handler with manager's webhook server and adds the informer to the list of processes for manager to start

func (*PodMutatingWebhook) ShardExists

func (p *PodMutatingWebhook) ShardExists(ctx context.Context, shardHash string) (bool, error)

func (*PodMutatingWebhook) ShuffleShard

func (p *PodMutatingWebhook) ShuffleShard(ctx context.Context, tenant string, numNodeGroups int) ([]string, error)

func (*PodMutatingWebhook) Start

func (p *PodMutatingWebhook) Start(ctx context.Context) error

Start fulfills the manager.Runnable interface, required when calling (manager.Manager).Add in (controller.PodMutatingWebhook).SetupWithManager

func (*PodMutatingWebhook) StartInformer

func (p *PodMutatingWebhook) StartInformer(ctx context.Context) error

func (*PodMutatingWebhook) UpdateFunc

func (p *PodMutatingWebhook) UpdateFunc(oldObj, newObj interface{})

type ShuffleShardReconciler

type ShuffleShardReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ShuffleShardReconciler reconciles a ShuffleShard object

func (*ShuffleShardReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ShuffleShard object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile

func (*ShuffleShardReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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