Commit Graph

47 Commits

Author SHA1 Message Date
Dr. Stefan Schimanski
b8045f98a4 kube-apiserver/leaderelection/tests: use fake clock
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-07-27 17:54:09 +00:00
Dr. Stefan Schimanski
8c971c5c15 kube-apiserver/leaderelection/test: fixing waiting for informer
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-07-27 17:54:08 +00:00
Dr. Stefan Schimanski
c7a1fa432a
Call non-blocking informerFactory.Start synchronously to avoid races
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-07-27 18:13:09 +02:00
Dr. Stefan Schimanski
87f40441d6
kube-apiserver/leaderelection: remove broken printf
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-07-26 09:27:05 +02:00
Jefftree
0c774d0b1f Change PingTime to be persistent 2024-07-24 14:41:13 +00:00
Dr. Stefan Schimanski
a738daa88a Review feedback: fix context handling in LeaseCandidateGCController
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-07-24 14:38:13 +00:00
Dr. Stefan Schimanski
15affefcab Review feedback: handle non-kube strategy correctly
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-07-24 14:38:13 +00:00
Dr. Stefan Schimanski
a64418ba0a Review feedback
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-07-24 14:38:13 +00:00
Jefftree
fac7581640 feedback: leasecandidate clients 2024-07-24 14:38:12 +00:00
Jefftree
e0c6987ca8 add gc and improve testing 2024-07-24 14:38:11 +00:00
Jefftree
c47ff1e1a9 CLE controller and client changes 2024-07-24 14:38:11 +00:00
Antonio Ojea
0e1f9dadd6 modify components to use the networking v1beta1 API 2024-06-30 09:48:46 +00:00
Antonio Ojea
7c4726d016 allow to shutdown quickly the apiserver 2024-06-27 11:33:36 +00: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
Patrick Ohly
b92273a760 apiserver + controllers: enhance context support
27a68aee3a introduced context support for events. Creating an event
broadcaster with context makes tests more resilient against leaking goroutines
when that context gets canceled at the end of a test and enables per-test
output via ktesting.

The context could get passed to the constructor. A cleaner solution is to
enhance context support for the apiserver and then pass the context into the
controller's run method. This ripples up the call stack to all places which
start an apiserver.
2024-04-29 20:59:21 +02:00
Dr. Stefan Schimanski
3daae717c3
controlplane: split out SystemNamespaces
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2024-04-27 14:19:56 +02:00
Tim Hockin
b3dd724174
Remove dep on set-gen: gone in gengo/v2 2024-02-29 22:06:18 -08:00
Antonio Ojea
99f7df3e1c improve default_servicecidr_controller startup
The default service-cidr controller blocks the apiserver because it
needs to create the default ServiceCIDR so Services can be allocated.

If the apiserver is started without the default ServiceCIDR any attempt
to createa  new Service will fail, and this is a breaking change for
users and installers that does not retry on this operation.

Instead of using a channel to signal the controller is ready, just
implement two loops, a first one that verifies that is ready and that
polls with a shorted interval, and leave the second loop with the
existing interval.

Change-Id: I54303af9faeaa9c5cce2a840b6b7b0320cd2f4ad
2023-11-14 23:31:58 +00:00
Antonio Ojea
7e87806fab default_servicecidr_controller: use new ServiceCIDR API
Change-Id: I2c53815136e0d985959420911339aacd62e01e78
2023-10-31 21:05:06 +00:00
Antonio Ojea
3b450378e0 bootstrap controller for default ServiceCIDR
The bootstrap controller for ServiceCIDR ensures that the default
ServiceCIDR is created from the existing flags.

It follows the same behavior than the kubernetes.default Service,
it only creates the default ServiceCIDR if it doesn't exist, but
does not modify it despite the parameters doesn't match.

review: bootstrap controller for default ServiceCIDR
2023-10-31 21:05:04 +00:00
Dr. Stefan Schimanski
59ad81a615
controller/clusterauthenticationtrust: complete event filter
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
2023-09-27 15:39:58 +02:00
git-jxj
a5b3a4b738
cleanup: Update deprecated FromInt to FromInt32 (#119858)
* redo commit

* apply suggestions from liggitt

* update Parse function based on suggestions
2023-08-16 09:33:01 -07:00
Antonio Ojea
c5147c91b8 controlplane: kubernetes.default controller stop polling
the kubernetesservice controller is in charge of reconciling the
kubernetes.default service with the first IP in the service CIDR range
and port 443, it also maintains the Endpoints associated to the Service
using the configure EndpointReconciler.

Until now, the controller was creating the default namespace if it
doesn't exist , and creating the kubernetes.default service if it
doesn't exist too. However, it was polling the Service in each loop,
with this change we reuse the apiserver informers to watch the Service
instead of polling.

It also removes the logic to create the default network namespace, since
this is part of the systemnamespaces controller now.

Change-Id: I70954f8e6309e7af8e4b749bf0752168f0ec2c42
Signed-off-by: Antonio Ojea <aojea@google.com>
2023-07-13 10:41:06 +00:00
Dr. Stefan Schimanski
75e3576523
kube-apiserver: rewire service controllers: kubernetesservice + IP repair 2023-07-11 17:27:20 +02:00
Dr. Stefan Schimanski
65b34221eb
kube-apiserver: remove IP repair plumbing from kubernetes service controller 2023-07-05 16:45:31 +02:00
Dr. Stefan Schimanski
616c959988
FIXUP: pkg/controlplane: move bootstrap controller to controllers/kubernetesservice 2023-07-04 16:38:14 +02:00
Dr. Stefan Schimanski
7b62d000a4
MOVE: pkg/controlplane: move bootstrap controller to controllers/kubernetesservice 2023-07-03 20:27:41 +02:00
Shihang Zhang
182cd425d3 graduate LegacyServiceAccountTokenTracking to GA 2023-05-19 10:33:34 -07:00
Jordan Liggitt
1daf74d25c
Initialize data if nil 2023-05-16 17:51:26 -04:00
Hao Ruan
c4e1b01416 replace spew methods with dump methods 2023-04-14 08:05:53 +08:00
Tim Hockin
bc302fa414
Replace uses of ObjectReflectDiff with cmp.Diff
ObjectReflectDiff is already a shim over cmp.Diff, so no actual output
or behavior changes
2023-04-12 08:48:03 -07:00
Antonio Ojea
6e78e3279a consider default a system namespace to be managed by the namespace controller
Change-Id: I08d68c18234404c1258aa003211d82e2e72dadb1
2023-03-10 17:49:53 +00:00
Antonio Ojea
eecfaf658e decouple system namespaces from bootstrap controller
Use an informer instead of polling.

Change-Id: Ib071e53addb914fcb31d8a1346cf61ca6d22520b
2023-03-10 17:49:47 +00:00
Andrew Sy Kim
3da0f1809c apiserver: update lease label key to apiserver.kubernetes.io/identity
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2023-01-13 15:37:22 -05:00
Shihang Zhang
569cd70a52 track legacy service account tokens 2022-10-24 09:37:53 -07:00
Andrew Sy Kim
c4c867dd96 add comments for Test_Controller in pkg/controlplane/controller/apiserverleasegc
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2022-10-18 20:40:21 -04:00
Andrew Sy Kim
4a89500478 add unit tests for apiserverleasegc controller
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2022-10-18 20:39:10 -04:00
Ravi Gudimetla
8b84a793b3 API Server Changes
This commit includes all the changes needed for APIServer. Instead of modifying the existing signatures for the methods which either generate or return stopChannel, we generate a context from the channel and use the generated context to be passed to the controllers which are started in APIServer. This ensures we don't have to touch APIServer dependencies.
2022-03-07 09:37:01 -05:00
Kubernetes Prow Robot
372103f4b8
Merge pull request #100672 from wangyx1992/structured-log
Structured Logging migration: modify logs of controller-manager
2021-09-22 20:27:10 -07:00
astraw99
e6df935fd3 unify worker num to workers 2021-08-09 15:46:04 +08:00
wangyx1992
7175d82a27 Structured Logging migration: modify logs of controller-manager
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-25 11:27:44 +08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Haowei Cai
e363709d73 add V(4) log when apiserver lease was deleted before this controller reacts 2020-11-10 15:32:16 -08:00
Haowei Cai
bfebc7aefd generated 2020-11-10 15:32:16 -08:00
Haowei Cai
1d43fd4694 add apiserver lease garbage collector 2020-11-10 15:12:14 -08:00
Daniel Smith
a86afc12df update scripts 2020-09-02 10:49:40 -07:00
Daniel Smith
1f0305fe1b partial 2020-09-02 10:48:26 -07:00