simulator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LabelSelector which identifies resources managed by kwok.
	LabelSelector = "type=kwok"
)

Variables

View Source
var (
	ErrOperatorNotInstalled = errors.New("kwok-operator is not installed")
)

Functions

func CheckAreStagesCreated

func CheckAreStagesCreated(ctx context.Context, client dynamic.Interface) (found bool, missing []string, err error)

func CheckIsKWOKInstalled

func CheckIsKWOKInstalled(ctx context.Context) (output []byte, installed bool)

CheckIsKWOKInstalled checks if the kwok binary is installed in the system.

func CheckIsKubectlInstalled

func CheckIsKubectlInstalled(ctx context.Context) (output []byte, installed bool)

CheckIsKubectlInstalled checks if the kubectl binary is installed in the system.

func CheckIsOperatorRunning

func CheckIsOperatorRunning(ctx context.Context, client kubernetes.Interface, namespace string) (output []byte, running bool, err error)

CheckIsOperatorRunning checks if kwok-operator is installed & running with at least 1 replica in the cluster.

func CreateRBAC

func CreateRBAC(ctx context.Context, clientset kubernetes.Interface, namespace string) error

func CreateStages

func CreateStages(ctx context.Context) (output []byte, err error)

CreateStages creates the kwok stages in the cluster required for node and pod lifecycle.

func DefaultArgs

func DefaultArgs() []string

func DeleteRBAC

func DeleteRBAC(ctx context.Context, clientset kubernetes.Interface, namespace string) error

func DeleteStages

func DeleteStages(ctx context.Context) (output []byte, err error)

DeleteStages deletes the kwok stages from the cluster.

func InstallOperator

func InstallOperator(ctx context.Context, namespace string) (output []byte, err error)

InstallOperator installs kwok-operator in the cluster.

func NewSimulatorJob added in v0.0.4

func NewSimulatorJob(args []string) *batchv1.Job

func UninstallOperator

func UninstallOperator(ctx context.Context, namespace string) (output []byte, err error)

UninstallOperator uninstalls kwok-operator from the cluster.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Client

func (*Client) Run

func (c *Client) Run(ctx context.Context) error

type Option

type Option func(*Client)

func WithLogger

func WithLogger(logger *slog.Logger) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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