pod

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 51 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 (
	// WorkloadWaitingForReplacementPods is True when Kueue doesn't observe all
	// the Pods declared for the group.
	WorkloadWaitingForReplacementPods = "WaitingForReplacementPods"

	// WorkloadPodsFailed means that at least one Pod are not runnable or not succeeded.
	WorkloadPodsFailed = "PodsFailed"
)
View Source
const (
	ManagedLabelKey              = constants.ManagedByKueueLabel
	ManagedLabelValue            = "true"
	PodFinalizer                 = ManagedLabelKey
	GroupNameLabel               = "kueue.x-k8s.io/pod-group-name"
	GroupTotalCountAnnotation    = "kueue.x-k8s.io/pod-group-total-count"
	GroupFastAdmissionAnnotation = "kueue.x-k8s.io/pod-group-fast-admission"
	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, podUID types.UID) string

func IndexPodGroupName added in v0.6.2

func IndexPodGroupName(o client.Object) []string

func IsPodOwnerManagedByKueue

func IsPodOwnerManagedByKueue(p *Pod) bool

func NewJob added in v0.9.0

func NewJob() jobframework.GenericJob

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 FromObject added in v0.7.0

func FromObject(o runtime.Object) *Pod

func (*Pod) ConstructComposableWorkload added in v0.6.0

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

func (*Pod) CustomWorkloadConditions added in v0.7.0

func (p *Pod) CustomWorkloadConditions(wl *kueue.Workload) ([]metav1.Condition, bool)

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() (message string, success, finished bool)

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

func (*Pod) ForEach added in v0.7.0

func (p *Pod) ForEach(f func(obj runtime.Object))

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) PodLabelSelector added in v0.9.0

func (p *Pod) PodLabelSelector() string

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