Commit Graph

245 Commits

Author SHA1 Message Date
Matthew Cary
d386d6880e Respect controllers on PVCs for retention policy 2024-06-05 12:06:41 -07:00
Kubernetes Prow Robot
f75d8e97f1
Merge pull request #124624 from atiratree/fix-flake
[test] statefulset controller: fix requests tracker concurrency
2024-05-10 06:49:00 -07:00
Filip Křepinský
8ca077ab7a improve TestParallelScale test
we can test for larger number of parallel requests than 2 in
statefulsets with hundreds of replicas
2024-05-07 21:01:47 +02:00
Filip Křepinský
df276c5538 fix requests tracker concurrency 2024-05-07 20:45:18 +02:00
Alvaro Aleman
6d0ac8c561 Use the generic/typed workqueue throughout
This change makes us use the generic workqueue throughout the project in
order to improve type safety and readability of the code.
2024-05-04 14:33:12 -04:00
Marek Siarkowicz
3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +02:00
Filip Křepinský
85d55b6737
fix stateful set pod recreation and event spam (#123809)
* fix pods tracking and internal error checking in statefulset tests

* fix stateful set pod recreation and event spam

- do not emit events when pod reaches terminal phase
- do not try to recreate pod until the old pod has been removed from
  etcd storage

* fix conflict race in statefulset rest update

statefulset controller does less requests per sync now and thus can
reconcile status faster, thus resulting in a higher chance for conflicts
2024-04-18 01:03:46 -07:00
Mengjiao Liu
b584b87a94 kube-controller-manager: readjust log verbosity
- Increase the global level for broadcaster's logging to 3 so that users can ignore event messages by lowering the logging level. It reduces information noise.
- Making sure the context is properly injected into the broadcaster, this will allow the -v flag value to be used also in that broadcaster, rather than the above global value.
- test: use cancellation from ktesting
- golangci-hints: checked error return value
2024-02-26 14:51:56 +08:00
weilaaa
eb8f3f194f use build-in max and min func to instead of k8s.io/utils/integer funcs 2023-12-15 15:09:11 +08:00
Kubernetes Prow Robot
05765a851c
Merge pull request #121389 from aleksandra-malinowska/sts-restart-always
Resubmit "Make StatefulSet restart pods with phase Succeeded"
2023-10-30 21:11:51 +01:00
Aleksandra Malinowska
e07d898cfd Make StatefulSet restart pods with phase Succeeded 2023-10-26 15:34:01 +02:00
Kubernetes Prow Robot
ccca58aa36
Merge pull request #120075 from lowang-bh/enhancement
Call getPodRevision once
2023-10-23 19:51:40 +02:00
Kubernetes Prow Robot
568aee16e8
Merge pull request #120731 from Nordix/sts_issue/adil
Fixing CurrentReplicas and CurrentRevision in completeRollingUpdate
2023-10-20 14:42:08 +02:00
adil ghaffar
00c21ced3a
Fixing CurrentReplicas and CurrentRevision in completeRollingUpdate 2023-10-19 14:17:42 +03:00
Aleksandra Malinowska
7989400bef Fix concurrent write when filling PVC labels 2023-10-11 15:07:55 +02:00
Aleksandra Malinowska
54714686bc Modify test PVC to detect concurrent map write bug 2023-10-11 15:07:50 +02:00
Abhishek Srivastav
5f8fc30b2c
Added locks on request tracker before accessing fields (#120599)
* Added locks on request tracker before accessing fields

Unit test StatefulSetAutoDeletePVCEnabled has been
flaking with DATARACE. Added lock on request tracker
before accessing err field.

* Addressed review comments for PR : Added locks on request tracker before accessing fields
2023-10-03 16:38:08 +02:00
Aleksandra Malinowska
5ed60a72f6
Revert "Make StatefulSet restart pods with phase Succeeded" 2023-09-19 15:49:36 +02:00
Kubernetes Prow Robot
3eca0a5f78
Merge pull request #120398 from aleksandra-malinowska/sts-restart-always
Make StatefulSet restart pods with phase Succeeded
2023-09-13 12:40:12 -07:00
Aleksandra Malinowska
d7264d0af0 Make StatefulSet restart pods with phase Succeeded 2023-09-08 17:47:17 +02:00
Stephen Kitt
aa89e6dc97
Use ptr.To to retrieve intstr addresses
This uses the generic ptr.To in k8s.io/utils to replace functions and
code constructs which only serve to return pointers to intstr
values. Other uses of the deprecated pointer package are updated in
modified files.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-09-08 11:10:50 +02:00
Patrick Ohly
2472291790 api: introduce separate VolumeResourceRequirements struct
PVC and containers shared the same ResourceRequirements struct to define their
API. When resource claims were added, that struct got extended, which
accidentally also changed the PVC API. To avoid such a mistake from happening
again, PVC now uses its own VolumeResourceRequirements struct.

The `Claims` field gets removed because risk of breaking someone is low:
theoretically, YAML files which have a claims field for volumes now
get rejected when validating against the OpenAPI. Such files
have never made sense and should be fixed.

Code that uses the struct definitions needs to be updated.
2023-08-21 15:31:28 +02:00
lowang-bh
2f576969ee reducae function calling to once
Signed-off-by: lowang-bh <lhui_wang@163.com>
2023-08-20 19:36:50 +08:00
Daniel Vega-Myhre
7698fe7639
Add StatefulSet pod index as pod label (#119232)
* add statefulset pod index as pod label

* change statefulset pod index label name

* check 3 pods

* change label variable name
2023-07-17 12:47:10 -07:00
Aleksandra Malinowska
d616cf72a3 Add unit tests for parallel StatefulSet create & delete 2023-06-28 16:55:38 +02:00
Aleksandra Malinowska
63e5b6bdb2 Parallel StatefulSet pod create & delete 2023-06-20 12:15:21 +02:00
Aleksandra Malinowska
2fb472c83c Refactor StatefulSet controller update logic 2023-06-20 12:14:25 +02:00
kerthcet
3f1d8e7aeb Apply to use contextual logging for all loggers in statefulSet
Signed-off-by: kerthcet <kerthcet@gmail.com>
2023-05-18 16:55:19 +08:00
Stephen Kitt
5bfe738af2
apps: replace intstr.FromInt with intstr.FromInt32
This touches cases where FromInt() is used on numeric constants, or
values which are already int32s, or int variables which are defined
close by and can be changed to int32s with little impact.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-05-01 09:17:05 +02:00
HirazawaUi
397cc73dc9 delete unused functions in pkg/controller directory 2023-03-28 22:41:20 +08:00
ZhangKe10140699
a239b9986b Migrated the StatefulSet controller (within `kube-controller-manager) to use [contextual logging](https://k8s.io/docs/concepts/cluster-administration/system-logs/#contextual-logging) 2023-03-08 18:57:57 +08:00
Kubernetes Prow Robot
9f0b491953
Merge pull request #113270 from rrangith/fix/create-pvc-for-pending-pod
Automatically recreate PVC for pending STS pod
2023-03-03 10:24:58 -08:00
Kubernetes Prow Robot
2c37b470b3
Merge pull request #113794 from littlejiancc/feature_stateful_cleanup
Simplify case conditions
2023-02-09 20:37:39 -08:00
Rahul Rangith
2f0eb543c7 New function for creating missing pvcs 2023-01-17 10:21:42 -05:00
Rahul Rangith
392cd5ce8c Make e2e test not rely on local volumes 2023-01-17 10:21:42 -05:00
Rahul Rangith
3cf636b22e PR feedback 2023-01-17 10:21:41 -05:00
Rahul Rangith
c1cc18ccd5 Automatically recreate pvc when sts pod is stuck in pending 2023-01-17 10:21:41 -05:00
Kubernetes Prow Robot
901c1de5ea
Merge pull request #114870 from mattcary/mutation
Avoid mutation of PVC in stateful set controller shared cache
2023-01-05 23:16:09 -08:00
Matthew Cary
ed18ab54ba Avoid mutation of PVC in stateful set controller shared cache
Change-Id: Ieb8e443e460150d16524ca1c1fb3770f546b2c28
2023-01-05 18:09:05 -08:00
Kubernetes Prow Robot
d1c715a982
Merge pull request #113834 from atiratree/sts-handle-delete-pod-error
statefulset: handle API error on pod deletion
2022-12-22 08:17:26 -08:00
Jordan Liggitt
78cb3862f1
Fix indentation/spacing in comments to render correctly in godoc 2022-12-17 23:27:38 -05:00
Filip Křepinský
ec0b200f3d statefulset: handle API error on pod deletion
when new revision is being rolled out
2022-11-10 22:47:23 +01:00
wangxiaojian
02db35ab1c
Optimize case conditions 2022-11-10 00:49:20 +08:00
Peter Schuurman
9258cb4041 Fix typo in function emptyInvariants() 2022-11-08 07:48:10 -08:00
Peter Schuurman
366997951b Update doc comments and change name of feature gate 2022-11-08 07:48:10 -08:00
Peter Schuurman
8a9c126eca Small updates and comment fixes 2022-11-08 07:48:09 -08:00
Peter Schuurman
7b3d77a41a Adding implementation of KEP-3335, StatefulSetSlice 2022-11-08 07:48:00 -08:00
Gunju Kim
6559050ee1
StatefulSet: Cleanup the complex defer function updating the status
In the long term, the complex defer function makes the code harder to
maintain as code after it should take that into account. This removes
the complex defer function updating the status of a statefulset.
2022-11-08 08:39:42 +09:00
Mengjiao Liu
b9740694f3 StatefulSet: fix kube-controller-manager panic due to StatefulSetPersistentVolumeClaimRetentionPolicy being nil 2022-10-27 23:13:36 +08:00
Kubernetes Prow Robot
5c36a3c372
Merge pull request #110902 from 0xff-dev/master
convert int32 to pointer using library function
2022-10-14 08:48:46 -07:00