Commit Graph

170 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
15894cfc85
Merge pull request #116550 from alculquicondor/fix-bind-uid
Preserve UID and ResourceVersion in BindingREST
2023-03-20 08:49:20 -07:00
Aldo Culquicondor
62889f416c
Preserve UID/ResourceVersion in the BindingREST endpoint
Change-Id: If4023da10c455963a320fdb9fc2a73c099bea3db
2023-03-20 10:29:25 -04:00
Filip Křepinský
51c0e2374f API-initiated eviction: handle deleteOptions correctly
when adding a DisruptionTarget condition into a pod that will be deleted

- handle ResourceVersion and Preconditions correctly
- handle DryRun option correctly

Co-authored-by: Jordan Liggitt jordan@liggitt.net
2023-03-17 22:18:07 +01:00
Wei Huang
feed8c683d
Enforce nodeName cannot be set along with non empty schedulingGates 2023-02-07 13:53:28 -08:00
Kubernetes Prow Robot
12c71fdf1c
Merge pull request #113542 from ardaguclu/fix-shortname-disperancy
Set singular names for core types to pass to discovery
2023-01-03 09:29:43 -08:00
Kubernetes Prow Robot
6f6bf42ee5
Merge pull request #113768 from lojies/codecleanupforkubeleteviction
cleanup:Omit comparison with boolean constant
2022-12-09 14:34:26 -08:00
Arda Güçlü
43a889fc65 Add integration test to test singularnames for all resources 2022-11-21 09:59:37 +03:00
Arda Güçlü
23e2899556 Implement GetSingularName for LegacyBindingREST
LegacyBindingREST is only used for `bindings` resource. It is not
a subresource and that's why it is required to implement
`GetSingularName` function. However, there is no need to implement
this function for BindingREST because it is only used for binding
subresource.

That's why, this function statically adds GetSingularName for
LegacyBindingREST.
2022-11-18 12:21:19 +03:00
Arda Güçlü
d14b7781e2 Use casted SingularName for rbac types 2022-11-18 12:21:19 +03:00
Arda Güçlü
1abf94bec3 Remove GetSingularName for subresources 2022-11-18 12:21:19 +03:00
Arda Güçlü
672e0b1e01 Use correct singular name format for subresources 2022-11-18 12:21:19 +03:00
Arda Güçlü
578ddde80e Add singular name for the rest of types 2022-11-18 12:21:13 +03:00
Arda Güçlü
0990ba1cc9 Introduce singularNameProvider for core types
This introduces `singularNameProvider`. This provider will be used
by core types to have their singular names are defined in discovery
endpoint. Thanks to that, core resources singular name always have
higher precedence than CRDs shortcuts or singular names.
2022-11-18 12:21:07 +03:00
Kubernetes Prow Robot
cc704f9778
Merge pull request #113375 from atiratree/PodHealthyPolicy-api
api: add unhealthyPodEvictionPolicy for PDBs
2022-11-11 04:02:10 -08:00
Filip Křepinský
a429797f2e api: add UnhealthyPodEvictionPolicy for PDBs 2022-11-10 23:25:42 +01:00
Michal Wozniak
c803892bd8 Enable the feature into beta 2022-11-09 09:02:40 +01:00
lojies
e2a4565a2b cleanup:Omit comparison with boolean constant 2022-11-09 09:54:41 +08:00
Wei Huang
7b6293b6b6
APIs, Validation and condition enforcements
- New API field .spec.schedulingGates
- Validation and drop disabled fields
- Disallow binding a Pod carrying non-nil schedulingGates
- Disallow creating a Pod with non-nil nodeName and non-nil schedulingGates
- Adds a {type:PodScheduled, reason:WaitingForGates} condition if necessary
- New literal SchedulingGated in the STATUS column of `k get pod`
2022-11-03 14:32:34 -07:00
Michal Wozniak
04fcbd721c Introduction of a pod condition type indicating disruption. Its reason field indicates the reason:
- PreemptionByKubeScheduler (Pod preempted by kube-scheduler)
- DeletionByTaintManager (Pod deleted by taint manager due to NoExecute taint)
- EvictionByEvictionAPI (Pod evicted by Eviction API)
- DeletionByPodGC (an orphaned Pod deleted by PodGC)PreemptedByScheduler (Pod preempted by kube-scheduler)
2022-08-02 11:12:16 +02:00
Lee Verberne
d238e67ba6 Remove EphemeralContainers feature-gate checks 2022-07-26 02:55:30 +02:00
Wojciech Tyczyński
f62c14a9cc Extend StandardStorage with Destroy to implement rbac storage destroy 2022-04-19 15:59:13 +02:00
Wojciech Tyczyński
80060a502c Implement Destroy() method for all registries 2022-04-19 15:59:13 +02:00
Kubernetes Prow Robot
9fbe66a486
Merge pull request #103516 from ykakarap/kubectl-subresources-apiserver
kubectl: apiserver changes to add --subresource support
2022-03-23 13:21:32 -07:00
Yuvaraj Kakaraparthi
801c39b478 kubectl: API changes to support --subresource in kubectl
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
Co-authored-by: Nikhita Raghunath <nikitaraghunath@gmail.com>
Co-authored-by: Yuvaraj Kakaraparthi <kakaraparthy@vmware.com>
2022-03-23 11:19:58 +05:30
Jordan Liggitt
c0af728f43 Handle invalid selectors properly 2022-01-14 12:11:02 -05:00
Dan Williams
a04997e1a1 pod/storage: remove always-empty 'oldMachine' in setPodHostAndAnnotations()
There's only one caller of setPodHostAndAnnotations() and it always
passes an empty 'oldMachine'.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2021-11-11 16:29:20 -06:00
Ruochen Xu
6cc9bedfab add condition pre-check for pod uid and pod resource version in bind api 2021-11-02 09:51:15 +08:00
Jordan Liggitt
068e4c55a8 Eliminate parallel and unnecessary embedded etcd instances 2021-06-15 09:53:06 -04:00
Kubernetes Prow Robot
f5eded9a00
Merge pull request #100142 from Ethyling/enh-get-lastrestart
Add `LAST RESTART` column to `kubectl get pods`
2021-06-02 10:54:43 -07:00
Jordan Jacobelli
9eea445bcc Update test cases for 'RESTARTS' column in 'kubectl get pods'
Signed-off-by: Jordan Jacobelli <jordanjacobelli04@gmail.com>
2021-06-02 17:32:21 +02:00
Kubernetes Prow Robot
972ee2d425
Merge pull request #101034 from verb/1.22-ec-api
Switch alpha Pod ephemeralcontainers API to use Pod kind
2021-04-22 06:21:41 -07:00
Jordan Liggitt
10b07085f8 Define constant for eviction failure cause 2021-04-14 09:12:39 -04:00
Jordan Liggitt
33ad842480 allow evictions subresource to accept policy/v1 and policy/v1beta1 2021-04-13 21:22:25 -04:00
Jordan Liggitt
40f8fb2224 Register Eviction v1 2021-04-13 17:27:42 -04:00
Lee Verberne
d22dc5cb72 Switch ephemeralcontainers SR to Pod Kind
This changes the `/ephemeralcontainers` subresource of `/pods` to use
the `Pod` kind rather than `EphemeralContainers`.

When designing this API initially it seemed preferable to create a new
kind containing only the pod's ephemeral containers, similar to how
binding and scaling work.

It later became clear that this made admission control more difficult
because the controller wouldn't be presented with the entire Pod, so we
updated this to operate on the entire Pod, similar to how `/status`
works.
2021-04-13 13:36:48 +02:00
Kevin Delgado
a1fac8cbd9 Server-Side Apply: Status Wiping/Reset Fields
Adds and implements ResetFieldsProvder interface in order to ensure that
the fieldmanager no longer owns fields that get reset before the object
is persisted.

Co-authored-by: Kevin Wiesmueller <kwiesmul@redhat.com>
Co-authored-by: Kevin Delgado <kevindelgado@google.com>
2021-03-10 01:02:18 +00:00
Morten Torkildsen
621aed4d32 generated 2021-03-09 10:29:11 -05:00
Morten Torkildsen
21fba79d45 Promote PDBs to GA 2021-03-09 10:29:11 -05:00
Morten Torkildsen
1e2a7f381f Add conditions to PDB status 2021-03-04 18:52:02 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
xiaofei.sun
fd62f32125 Scheduler: remove pkg/apis/core/field_constants.go 2021-02-24 18:06:29 +08:00
Kubernetes Prow Robot
94a623a45a
Merge pull request #90299 from josephw/send-static-retry-after-when-hitting-pod-disruption-budget
Set a static Retry-After when evicting a pod is not allowed.
2021-01-11 07:19:07 -08:00
Joseph Walton
fb61854bd2 Set a static Retry-After when evicting a pod is not allowed.
Follow the original TODO from back in c86b84c with the errors added
in d3be1ac. Edit the TODO to make clear that a dynamic response would
still be ideal.

Dramatically reduce the time based on suggestion in PR, and remove name from TODO
as not currently active.
2021-01-11 23:23:35 +11:00
wojtekt
c2d61896f4 Add suggestion to storage interface Delete method 2020-12-16 08:12:57 +01:00
wojtekt
8b98305858 Remove variadic argument from storage interface 2020-11-02 16:08:23 +01:00
Michael Gugino
717be0cd44 Allow deletion of unhealthy pods if enough healthy
Currently, if you have a PDB with 0 disruptions
available and you attempt to evict a non-healthy
pod, the eviction request will always fail.  This
is because the eviction API does not currently
take in to account that the pod you are removing
is the unhealthy one.

This commit accounts for trying to evict an
unhealthy pod as long as there are enough healthy
pods to satisfy the PDB's requirements.  To
protect against race conditions, a ResourceVersion
constraint is enforced.  This will ensure that
the target pod does not go healthy and allow
any race condition to occur which might disrupt
too many pods at once.

This commit also eliminates superfluous class to
DeepCopy for the deleteOptions struct.
2020-10-20 12:59:23 -04:00
Kubernetes Prow Robot
def8fe3b4e
Merge pull request #94685 from verb/ec-admission
Convert to EphemeralContainers for validation in EphemeralContainersREST
2020-09-30 00:29:25 -07:00
Jordan Liggitt
71fcc2298d Fix resource location for ipv6 pods 2020-09-16 11:24:07 -04:00
Lee Verberne
bf0a33d1de Use EphemeralContainers for storage validation
When updating ephemeral containers, convert Pod to EphemeralContainers
in storage validation. This resolves a bug where admission webhook
validation fails for ephemeral container updates because the webhook
client cannot perform the conversion.

Also enable the EphemeralContainers feature gate for the admission
control integration test, which would have caught this bug.
2020-09-10 17:24:52 +02:00
Michael Gugino
dd49915c55 Eviction: ignore PDBs if pods with DeletionTimestamp
When using the eviction API, if a pod already has
a non-zero DeletionTimestamp, we don't need to check
PDBs as it has already been marked for deletion.
2020-06-02 01:06:45 -04:00