Skip to content

Commit b928f5e

Browse files
nojnhuhk8s-publishing-bot
authored andcommitted
Workload API: PodGroup ResourceClaims (KEP-5729)
Kubernetes-commit: d80f384b702e4c6630e6f46b2926ab5e45553c97
1 parent 61bd78e commit b928f5e

16 files changed

Lines changed: 1055 additions & 14 deletions

core/v1/generated.proto

Lines changed: 28 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/v1/types.go

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4505,6 +4505,14 @@ type PodSpec struct {
45054505
//
45064506
// It adds a name to it that uniquely identifies the ResourceClaim inside the Pod.
45074507
// Containers that need access to the ResourceClaim reference it with this name.
4508+
//
4509+
// When the DRAWorkloadResourceClaims feature gate is enabled and this Pod
4510+
// belongs to a PodGroup, a PodResourceClaim is matched to a
4511+
// PodGroupResourceClaim if all of their fields are equal (Name,
4512+
// ResourceClaimName, and ResourceClaimTemplateName). A matched claim references
4513+
// a single ResourceClaim shared across all Pods in the PodGroup, reserved for
4514+
// the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual
4515+
// Pods.
45084516
type PodResourceClaim struct {
45094517
// Name uniquely identifies this resource claim inside the pod.
45104518
// This must be a DNS_LABEL.
@@ -4531,6 +4539,16 @@ type PodResourceClaim struct {
45314539
// generated component, will be used to form a unique name for the
45324540
// ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.
45334541
//
4542+
// When the DRAWorkloadResourceClaims feature gate is enabled and the pod
4543+
// belongs to a PodGroup that defines a PodGroupResourceClaim with the same
4544+
// Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the
4545+
// ResourceClaim generated for the PodGroup. All pods in the group that
4546+
// define an equivalent PodResourceClaim matching the
4547+
// PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same
4548+
// generated ResourceClaim. ResourceClaims generated for a PodGroup are
4549+
// owned by the PodGroup and their lifecycles are tied to the PodGroup
4550+
// instead of any individual pod.
4551+
//
45344552
// This field is immutable and no changes will be made to the
45354553
// corresponding ResourceClaim by the control plane after creating the
45364554
// ResourceClaim.
@@ -4550,9 +4568,16 @@ type PodResourceClaimStatus struct {
45504568
Name string `json:"name" protobuf:"bytes,1,name=name"`
45514569

45524570
// ResourceClaimName is the name of the ResourceClaim that was
4553-
// generated for the Pod in the namespace of the Pod. If this is
4554-
// unset, then generating a ResourceClaim was not necessary. The
4555-
// pod.spec.resourceClaims entry can be ignored in this case.
4571+
// generated for the Pod in the namespace of the Pod.
4572+
//
4573+
// When the DRAWorkloadResourceClaims feature is enabled and the
4574+
// corresponding PodResourceClaim matches a PodGroupResourceClaim
4575+
// made by the Pod's PodGroup, then this is the name of the
4576+
// ResourceClaim generated and reserved for the PodGroup.
4577+
//
4578+
// If this is unset, then generating a ResourceClaim was not
4579+
// necessary. The pod.spec.resourceClaims entry can be ignored in
4580+
// this case.
45564581
//
45574582
// +optional
45584583
ResourceClaimName *string `json:"resourceClaimName,omitempty" protobuf:"bytes,2,opt,name=resourceClaimName"`

core/v1/types_swagger_doc_generated.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,10 +1842,10 @@ func (PodReadinessGate) SwaggerDoc() map[string]string {
18421842
}
18431843

18441844
var map_PodResourceClaim = map[string]string{
1845-
"": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.",
1845+
"": "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.\n\nWhen the DRAWorkloadResourceClaims feature gate is enabled and this Pod belongs to a PodGroup, a PodResourceClaim is matched to a PodGroupResourceClaim if all of their fields are equal (Name, ResourceClaimName, and ResourceClaimTemplateName). A matched claim references a single ResourceClaim shared across all Pods in the PodGroup, reserved for the PodGroup in ResourceClaimStatus.ReservedFor rather than for individual Pods.",
18461846
"name": "Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL.",
18471847
"resourceClaimName": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
1848-
"resourceClaimTemplateName": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
1848+
"resourceClaimTemplateName": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nWhen the DRAWorkloadResourceClaims feature gate is enabled and the pod belongs to a PodGroup that defines a PodGroupResourceClaim with the same Name and ResourceClaimTemplateName, this PodResourceClaim resolves to the ResourceClaim generated for the PodGroup. All pods in the group that define an equivalent PodResourceClaim matching the PodGroupResourceClaim's Name and ResourceClaimTemplateName share the same generated ResourceClaim. ResourceClaims generated for a PodGroup are owned by the PodGroup and their lifecycles are tied to the PodGroup instead of any individual pod.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
18491849
}
18501850

18511851
func (PodResourceClaim) SwaggerDoc() map[string]string {
@@ -1855,7 +1855,7 @@ func (PodResourceClaim) SwaggerDoc() map[string]string {
18551855
var map_PodResourceClaimStatus = map[string]string{
18561856
"": "PodResourceClaimStatus is stored in the PodStatus for each PodResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.",
18571857
"name": "Name uniquely identifies this resource claim inside the pod. This must match the name of an entry in pod.spec.resourceClaims, which implies that the string must be a DNS_LABEL.",
1858-
"resourceClaimName": "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.",
1858+
"resourceClaimName": "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod.\n\nWhen the DRAWorkloadResourceClaims feature is enabled and the corresponding PodResourceClaim matches a PodGroupResourceClaim made by the Pod's PodGroup, then this is the name of the ResourceClaim generated and reserved for the PodGroup.\n\nIf this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.",
18591859
}
18601860

18611861
func (PodResourceClaimStatus) SwaggerDoc() map[string]string {

resource/v1/types.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ const (
3737
ExtendedResourceClaimAnnotation = "resource.kubernetes.io/extended-resource-claim"
3838
// PodResourceClaimAnnotation is the annotation set on template-generated
3939
// ResourceClaims by the ResourceClaim controller. Its value is the
40-
// pod.spec.resourceClaims[].name for which the claim was generated.
40+
// spec.resourceClaims[].name of the Pod or PodGroup for which the claim was
41+
// generated. The Pod and its PodGroup are guaranteed to use the same name.
4142
PodResourceClaimAnnotation = "resource.kubernetes.io/pod-claim-name"
4243
// Resource device class prefix is for generating implicit extended resource
4344
// name for a device class when its ExtendedResourceName field is not

0 commit comments

Comments
 (0)