kube

package
v0.0.0-...-9d58fce Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeKubeClientFromFile

func ComposeKubeClientFromFile(kubeconfig string) (*kubernetes.Clientset, *rest.Config, error)

ComposeKubeClientFromFile creates a kubernetes client from a kubeconfig file.

func ComposeKubeClientInKube

func ComposeKubeClientInKube() (*kubernetes.Clientset, *rest.Config, error)

ComposeKubeClientInKube creates a kubernetes client in a k8s pod.

Types

type Engine

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

func NewEngine

func NewEngine(client kubernetes.Interface, opt *Option) (*Engine, error)

func (*Engine) CreateRunner

func (e *Engine) CreateRunner(ctx context.Context, logProvider engine.LogProvider, spec *api.Job) (engine.Runner, error)

func (*Engine) Ping

func (e *Engine) Ping(ctx context.Context) error

type Option

type Option struct {
	// ExecutorImage is the image of contains the executor binary.
	ExecutorImage string
	// ExecutorPath is the path of the executor binary in the executor image.
	ExecutorPath string
	// KubeConfig is the kube config used to connect to the kubernetes cluster.
	// It's required when UsePortForward is true.
	KubeConfig *rest.Config
	// UsePortForward is true, the runner will use port-forward to connect to the executor.
	// It is useful when the runner is running outside the kubernetes cluster.
	UsePortForward bool
	// Namespace is the namespace to create the runner pod.
	Namespace string
}

type Runner

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

func (*Runner) GetContainerExecutor

func (r *Runner) GetContainerExecutor(ctx context.Context, containerName string) (executorpb.ExecutorClient, error)

func (*Runner) GetExecutor

func (r *Runner) GetExecutor(ctx context.Context) (executorpb.ExecutorClient, error)

func (*Runner) Start

func (r *Runner) Start(ctx context.Context) (startErr error)

func (*Runner) Stop

func (r *Runner) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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