kubernetes

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	SystemNamespace = "kube-system"
	// DefaultWaitServantJobTimeout specifies the timeout value of waiting for the ServantJob to be succeeded
	DefaultWaitServantJobTimeout = time.Minute * 5
)

Variables

View Source
var (
	// PropagationPolicy defines the propagation policy used when deleting a resource
	PropagationPolicy = metav1.DeletePropagationBackground
	// CheckServantJobPeriod defines the time interval between two successive ServantJob status inspection
	CheckServantJobPeriod = time.Second * 10
)

Functions

func AddEdgeWorkerLabelAndAutonomyAnnotation

func AddEdgeWorkerLabelAndAutonomyAnnotation(cliSet kubeclientset.Interface, node *corev1.Node, lVal, aVal string) (*corev1.Node, error)

func DumpPod added in v1.5.0

func DumpPod(client kubeclientset.Interface, pod *corev1.Pod, w io.Writer) error

func GetOrCreateJoinTokenString

func GetOrCreateJoinTokenString(cliSet kubeclientset.Interface) (string, error)

func RunJobAndCleanup

func RunJobAndCleanup(cliSet kubeclientset.Interface, job *batchv1.Job, timeout, period time.Duration) error

RunJobAndCleanup runs the job, wait for it to be complete, and delete it

func RunServantJobs

func RunServantJobs(
	cliSet kubeclientset.Interface,
	waitServantJobTimeout time.Duration,
	getJob func(nodeName string) (*batchv1.Job, error),
	nodeNames []string, ww io.Writer) error

RunServantJobs launch servant jobs on specified nodes and wait all jobs to finish. Succeed jobs will be deleted when finished. Failed jobs are preserved for diagnosis.

Types

type Builder

type Builder struct {
	kubectlutil.Factory
}

func NewBuilder

func NewBuilder(kubeconfig string) *Builder

func (Builder) InstallComponents

func (b Builder) InstallComponents(path string, recursive bool) error

Jump to

Keyboard shortcuts

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