controllers

package
v0.0.0-...-89e5b94 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 11

Documentation

Index

Constants

View Source
const (
	CRDAppImagesName           = "appimages.kuscia.secretflow"
	CRDClusterDomainRoutesName = "clusterdomainroutes.kuscia.secretflow"
	CRDDomainDataGrantsName    = "domaindatagrants.kuscia.secretflow"
	CRDDomainAppImagesName     = "domainappimages.kuscia.secretflow"
	CRDDomainRoutesName        = "domainroutes.kuscia.secretflow"
	CRDDomainsName             = "domains.kuscia.secretflow"
	CRDGatewaysName            = "gateways.kuscia.secretflow"
	CRDKusciaTasksName         = "kusciatasks.kuscia.secretflow"
	CRDKusciaDeploymentsName   = "kusciadeployments.kuscia.secretflow"
	CRDTaskResourcesGroupsName = "taskresourcegroups.kuscia.secretflow"
	CRDTaskResourcesName       = "taskresources.kuscia.secretflow"
	CRDKusciaJobsName          = "kusciajobs.kuscia.secretflow"
)

Variables

This section is empty.

Functions

func CheckCRDExists

func CheckCRDExists(ctx context.Context, extensionClient apiextensionsclientset.Interface, crdNames []string) error

CheckCRDExists is used to check if crd exist.

func NewServer

func NewServer(opts *Options, clients *kubeconfig.KubeClients, controllerConstructions []ControllerConstruction) *server

NewServer returns a server instance.

func RunServer

func RunServer(ctx context.Context, opts *Options, clients *kubeconfig.KubeClients, controllerConstructions []ControllerConstruction) error

Types

type ControllerConfig

type ControllerConfig struct {
	RunMode               common.RunModeType
	Namespace             string
	RootDir               string
	KubeClient            kubernetes.Interface
	KusciaClient          kusciaclientset.Interface
	EventRecorder         record.EventRecorder
	EnableWorkloadApprove bool
}

type ControllerConstruction

type ControllerConstruction struct {
	NewControler NewControllerFunc
	CRDNames     []string
}

type IController

type IController interface {
	Run(int) error
	Stop()
	Name() string
}

type NewControllerFunc

type NewControllerFunc func(ctx context.Context, config ControllerConfig) IController

type Options

type Options struct {
	Kubeconfig string
	MasterURL  string
	RunMode    common.RunModeType
	Namespace  string
	RootDir    string
	Workers    int
	// QPS indicates the maximum QPS to the master from this client.
	// If it's zero, the created RESTClient will use DefaultQPS: 5
	QPS float64
	// Maximum burst for throttle.
	// If it's zero, the created RESTClient will use DefaultBurst: 10.
	Burst int
	// HealthCheckPort is the port that the health check server listens on.
	HealthCheckPort int

	ControllerName string

	EnableWorkloadApprove bool
}

Options is the main context object for the domain controller.

func NewOptions

func NewOptions() *Options

NewOptions creates a new options with a default config.

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags for a specific server to the specified FlagSet.

func (*Options) Validate

func (o *Options) Validate() error

Validate whether the parameter is legal.

Directories

Path Synopsis
nolint:dulp
nolint:dulp
handler
nolint:dulp
nolint:dulp
nolint:dulp
nolint:dulp
handler
nolint:dulp
nolint:dulp

Jump to

Keyboard shortcuts

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