kubernetes/pkg/api
Patrick Ohly 444d23bd2f dra: generated name for ResourceClaim from template
Generating the name avoids all potential name collisions. It's not clear how
much of a problem that was because users can avoid them and the deterministic
names for generic ephemeral volumes have not led to reports from users. But
using generated names is not too hard either.

What makes it relatively easy is that the new pod.status.resourceClaimStatus
map stores the generated name for kubelet and node authorizer, i.e. the
information in the pod is sufficient to determine the name of the
ResourceClaim.

The resource claim controller becomes a bit more complex and now needs
permission to modify the pod status. The new failure scenario of "ResourceClaim
created, updating pod status fails" is handled with the help of a new special
"resource.kubernetes.io/pod-claim-name" annotation that together with the owner
reference identifies exactly for what a ResourceClaim was generated, so
updating the pod status can be retried for existing ResourceClaims.

The transition from deterministic names is handled with a special case for that
recovery code path: a ResourceClaim with no annotation and a name that follows
the Kubernetes <= 1.27 naming pattern is assumed to be generated for that pod
claim and gets added to the pod status.

There's no immediate need for it, but just in case that it may become relevant,
the name of the generated ResourceClaim may also be left unset to record that
no claim was needed. Components processing such a pod can skip whatever they
normally would do for the claim. To ensure that they do and also cover other
cases properly ("no known field is set", "must check ownership"),
resourceclaim.Name gets extended.
2023-07-11 14:23:48 +02:00
..
endpoints/testing Move endpoints test-helper funcs to a package 2021-07-01 18:26:45 -07:00
job Add warnings for big number of completions and parallelism 2023-06-14 10:38:42 -04:00
legacyscheme hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
node deprecated node labels: make naming consistant and remove some unused args in funcs 2022-05-25 15:15:34 +08:00
persistentvolume Change the fieldpath in the deprecated plugin response 2023-06-16 19:47:03 +05:30
persistentvolumeclaim emit warning on deprecated annotation volume.beta.kubernetes.io/storage-class 2023-05-16 10:19:01 +08:00
pod dra: generated name for ResourceClaim from template 2023-07-11 14:23:48 +02:00
service api: replace intstr.FromInt with intstr.FromInt32 2023-05-01 09:16:15 +02:00
storage deprecated node labels: make naming consistant and remove some unused args in funcs 2022-05-25 15:15:34 +08:00
testing lavalamp is taking a long break 2023-05-11 16:43:38 +00:00
v1 implement sidecar resource calculation 2023-07-08 07:26:13 +09:00
OWNERS Check in OWNERS modified by update-yamlfmt.sh 2021-12-09 21:31:26 -05:00