pod

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

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

	ConditionTypeTerminationTarget = "TerminationTarget"

	IsGroupWorkloadAnnotationKey   = "kueue.x-k8s.io/is-group-workload"
	IsGroupWorkloadAnnotationValue = "true"
)
View Source
const (
	ReasonExcessPodDeleted     = "ExcessPodDeleted"
	ReasonOwnerReferencesAdded = "OwnerReferencesAdded"
)

Event reasons used by the pod controller

View Source
const (
	ManagedLabelKey            = "kueue.x-k8s.io/managed"
	ManagedLabelValue          = "true"
	PodFinalizer               = ManagedLabelKey
	GroupNameLabel             = "kueue.x-k8s.io/pod-group-name"
	GroupTotalCountAnnotation  = "kueue.x-k8s.io/pod-group-total-count"
	RoleHashAnnotation         = "kueue.x-k8s.io/role-hash"
	RetriableInGroupAnnotation = "kueue.x-k8s.io/retriable-in-group"
)
View Source
const (
	PodGroupNameCacheKey = "PodGroupNameCacheKey"
)

Variables

This section is empty.

Functions

func CanSupportIntegration added in v0.6.0

func CanSupportIntegration(opts ...jobframework.Option) (bool, error)

func GetWorkloadNameForPod

func GetWorkloadNameForPod(podName string) string

func IndexPodGroupName added in v0.6.2

func IndexPodGroupName(o client.Object) []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 struct {
	// contains filtered or unexported fields
}

func (*Pod) ConstructComposableWorkload added in v0.6.0

func (p *Pod) ConstructComposableWorkload(ctx context.Context, c client.Client, r record.EventRecorder) (*kueue.Workload, error)

func (*Pod) Finalize

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

func (*Pod) FindMatchingWorkloads added in v0.6.0

func (p *Pod) FindMatchingWorkloads(ctx context.Context, c client.Client, r record.EventRecorder) (*kueue.Workload, []*kueue.Workload, 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) ListChildWorkloads added in v0.6.0

func (p *Pod) ListChildWorkloads(ctx context.Context, c client.Client, key types.NamespacedName) (*kueue.WorkloadList, error)

func (*Pod) Load added in v0.6.0

func (p *Pod) Load(ctx context.Context, c client.Client, key *types.NamespacedName) (removeFinalizers bool, err error)

Load loads all pods in the group

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) ReclaimablePods added in v0.6.0

func (p *Pod) ReclaimablePods() ([]kueue.ReclaimablePod, error)

func (*Pod) RestorePodSetsInfo

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

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

func (*Pod) Run added in v0.6.0

func (p *Pod) Run(ctx context.Context, c client.Client, podSetsInfo []podset.PodSetInfo, recorder record.EventRecorder, msg string) error

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

func (*Pod) RunWithPodSetsInfo

func (p *Pod) RunWithPodSetsInfo(_ []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, stopReason jobframework.StopReason, eventMsg string) ([]client.Object, 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)

type Reconciler added in v0.6.0

type Reconciler struct {
	*jobframework.JobReconciler
	// contains filtered or unexported fields
}

func (*Reconciler) Reconcile added in v0.6.0

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*Reconciler) SetupWithManager added in v0.6.0

func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error

Jump to

Keyboard shortcuts

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