KEP-4671: Add Workload API#134564
Conversation
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
1a15ac8 to
3709c86
Compare
|
It looks great! |
thockin
left a comment
There was a problem hiding this comment.
Open question on impl: #134564 (review)
Otherwise this LGTM for API
| metav1.TypeMeta `json:",inline"` | ||
| // Standard object's metadata. | ||
| // | ||
| // +optional |
There was a problem hiding this comment.
It's not common to say the name format here, even though we should. Please do.
| } | ||
| } | ||
| if ref.Kind == "" { | ||
| allErrs = append(allErrs, field.Required(fldPath.Child("kind"), "must be specified")) |
There was a problem hiding this comment.
super nit-picky: the last arg to Required() is for rare cases where more context is needed. The error message will already say "Required value".
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("labels").Key(key),
pkg/apis/core/validation/validation.go: el = append(el, field.Required(namePath, ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath, "must specify a volume type"))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("path"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("repository"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("targetPortal"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("iqn"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("secretRef"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("targetPortal"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("iqn"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("secretRef"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("secretRef", "name"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("targetWWNs"), "must specify either targetWWNs or wwids, but not both"))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("lun"), "lun is required if targetWWNs is specified"))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("pdName"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("volumeID"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("secretName"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("name"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("key"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("path"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("claimName"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("server"), ""))
pkg/apis/core/validation/validation.go: allErrs = append(allErrs, field.Required(fldPath.Child("path"), ""))
There was a problem hiding this comment.
Good point, changed to empty arg
| } | ||
| } | ||
| if ref.Name == "" { | ||
| allErrs = append(allErrs, field.Required(fldPath.Child("name"), "must be specified")) |
There was a problem hiding this comment.
@sanposhiho @helayoty do you see anything else from the scheduler POV?
Only one point from me: #134564 (comment)
| // When set, it cannot be changed. | ||
| // | ||
| // +optional | ||
| ControllerRef *TypedLocalObjectReference |
There was a problem hiding this comment.
Isn't this redundant with metadata.OwnerRef with Controller: true?
|
|
||
| // PodGroupPolicy defines the scheduling configuration for a PodGroup. | ||
| type PodGroupPolicy struct { | ||
| // Basic specifies that the pods in this group should be scheduled using |
There was a problem hiding this comment.
Don't we usually use a discriminator like a type field for enums, especially if there are members that have no settings? E.G. in deployment.spec.strategy there is a type
There was a problem hiding this comment.
There was a problem hiding this comment.
See #134564 (comment). The decision was to remove this field
|
/approve for API |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: erictune, macsko, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
lgtm from sig node. Looking forward for more feedback on this and follow ups |
|
/hold |
|
The implementation part is formally approved too now: @macsko - can you please rebase this PR so that we can merge it? |
|
Tagging and unholding based on approval from SIG scheduling TLs on the implementation PR: /lgtm |
|
LGTM label has been added. DetailsGit tree hash: cbce30a3aa15b504deb8b5b319c9641309378cb8 |
|
/lgtm |
|
LGTM label has been added. DetailsGit tree hash: d6f4b6c5437819f682404c26403942f4c1f97dcf |
|
@macsko: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds a Workload API based on KEP-4671. Moreover, it adds a WorkloadReference to the Pod spec.
This PR doesn't contain the gang scheduling implementation that is posted in #134722.
Which issue(s) this PR is related to:
Part of #134471
Fixes #134472
Fixes #134473
Fixes #134474
Fixes #134478
KEP: kubernetes/enhancements#4671
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: