pod

package
v0.6.0-devel Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchedulingGateName = "kueue.x-k8s.io/admission"
	FrameworkName      = "pod"

	ConditionTypeTerminationTarget = "TerminationTarget"
)
View Source
const (
	ManagedLabelKey   = "kueue.x-k8s.io/managed"
	ManagedLabelValue = "true"
	PodFinalizer      = ManagedLabelKey
)

Variables

View Source
var NewReconciler = jobframework.NewGenericReconciler(
	func() jobframework.GenericJob {
		return &Pod{}
	}, nil)

Functions

func GetWorkloadNameForPod

func GetWorkloadNameForPod(podName string) string

func IsPodOwnerManagedByKueue

func IsPodOwnerManagedByKueue(p *Pod) bool

func SetupIndexes

func SetupIndexes(ctx context.Context, indexer client.FieldIndexer) error

func SetupWebhook

func SetupWebhook(mgr ctrl.Manager, opts ...jobframework.Option) error

SetupWebhook configures the webhook for pods.

Types

type Pod

type Pod corev1.Pod

func (*Pod) Finalize

func (p *Pod) Finalize(ctx context.Context, c client.Client) error

func (*Pod) Finished

func (p *Pod) Finished() (metav1.Condition, bool)

Finished means whether the job is completed/failed or not, condition represents the workload finished condition.

func (*Pod) GVK

func (p *Pod) GVK() schema.GroupVersionKind

GVK returns GVK (Group Version Kind) for the job.

func (*Pod) IsActive

func (p *Pod) IsActive() bool

IsActive returns true if there are any running pods.

func (*Pod) IsSuspended

func (p *Pod) IsSuspended() bool

IsSuspended returns whether the job is suspended or not.

func (*Pod) Object

func (p *Pod) Object() client.Object

Object returns the job instance.

func (*Pod) PodSets

func (p *Pod) PodSets() []kueue.PodSet

PodSets will build workload podSets corresponding to the job.

func (*Pod) PodsReady

func (p *Pod) PodsReady() bool

PodsReady instructs whether job derived pods are all ready now.

func (*Pod) RestorePodSetsInfo

func (p *Pod) RestorePodSetsInfo(nodeSelectors []podset.PodSetInfo) bool

RestorePodSetsInfo will restore the original node affinity and podSet counts of the job.

func (*Pod) RunWithPodSetsInfo

func (p *Pod) RunWithPodSetsInfo(podSetsInfo []podset.PodSetInfo) error

RunWithPodSetsInfo will inject the node affinity and podSet counts extracting from workload to job and unsuspend it.

func (*Pod) Skip

func (p *Pod) Skip() bool

func (*Pod) Stop

func (p *Pod) Stop(ctx context.Context, c client.Client, _ []podset.PodSetInfo, eventMsg string) (bool, error)

func (*Pod) Suspend

func (p *Pod) Suspend()

Suspend will suspend the job.

type PodWebhook

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

func (*PodWebhook) Default

func (w *PodWebhook) Default(ctx context.Context, obj runtime.Object) error

func (*PodWebhook) ValidateCreate

func (w *PodWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

func (*PodWebhook) ValidateDelete

func (*PodWebhook) ValidateUpdate

func (w *PodWebhook) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)

Jump to

Keyboard shortcuts

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