Commit Graph

97 Commits

Author SHA1 Message Date
Rob Scott
aa02b7a434
Updating e2e test to check EndpointSlices and Endpoints as well 2022-05-27 21:10:59 +00:00
Kubernetes Prow Robot
34a6a7ca11
Merge pull request #108316 from hyschumi/fix_unnecessary_handlecrash
endpointslice: remove unnecessary HandleCrash
2022-03-07 18:20:34 -08:00
Quan Tian
906e6d4670 Stop publishing Pod ResourceVersion in Endpoints and EndpointSlice API
The field is not used anywhere and its value may be stale as Endpoints
and EndpointSlice won't be updated if there is only Pod ResourceVersion
change..
2022-03-02 22:12:35 +08:00
hyschumi
d8536122b9 endpointslice: remove unnecessary HandleCrash 2022-02-24 09:59:09 +08:00
Antonio Ojea
60502c9b32 endpointslice: don't try to update topology cache if node informer error 2022-02-11 12:14:01 +01:00
Rob Scott
242c33615e
Improving performance of EndpointSlice controller metrics cache 2021-12-20 10:26:47 -08:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Rob Scott
9813ec7e8a
Updating TopologyCache to disregard unready endpoints in calculations 2021-11-18 13:54:09 -08:00
Rob Scott
d7a640d831
Excluding Control Plane Nodes from Topology Hints calculations 2021-10-01 15:12:38 -07:00
llhuii
e7350d126e TopologyAwareHints: add getHintsByZone unit test 2021-09-29 10:39:03 +08:00
llhuii
528cd30145 TopologyAwareHints: fix getHintsByZone bug
The bug could result in the EndpointSlice controller unnecessarily updating
EndpointSlices associated with a Service that had Topology Aware Hints enabled.
2021-09-28 09:02:24 +08: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
Rob Scott
f24d917d3c
Adding more detailed logging for Topology Hints 2021-09-02 15:46:14 -07:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Kubernetes Prow Robot
6acc62da75
Merge pull request #99997 from JornShen/extract_ep_and_epm_share_code_to_pkg
Extracting same code of endpointslice and endpointslicemirror into a new shared EndpointSlice package
2021-07-05 13:25:38 -07:00
cndoit18
51717256f9
fix(timezone): the timezone is standardized to UTC
Signed-off-by: cndoit18 <cndoit18@outlook.com>
2021-06-03 23:55:39 +08:00
jornshen
6c63ef147c extract same code of es and esm to pkg
migrate files:
endpointset.go
endpointslice_tracker.go
endpointslice_tracker_test.go
errors.go
2021-05-14 15:15:35 +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
Kubernetes Prow Robot
0c054510a8
Merge pull request #101367 from BinacsLee/binacs-controller-endpointslice-cleanup
code cleanup: append slice without check
2021-04-23 19:28:00 -07:00
BinacsLee
d7a4ed9c65 code cleanup: append slice without check 2021-04-22 18:29:30 +08:00
wangyx1992
fd51e654af cleanup: fix errors in wrapped format and log capitalization in controller
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-22 15:40:54 +08:00
Rob Scott
50b377fe4e
Updating Topology Aware Hints to support "Auto" value for annotation
Previously only "auto" was supported, a value that was inconsistent with
Kubernetes naming patterns.
2021-03-31 15:58:42 -07:00
Rob Scott
730d7dc1c0
Updating EndpointSlice controllers to avoid duplicate creations
This updates the StaleSlices() method in EndpointSliceTracker to also
ensure that the tracker does not have more slices than have been
provided.

Co-Authored-By: Swetha Repakula <srepakula@google.com>
2021-03-10 13:13:13 -08:00
Rob Scott
1dcf09c1bf
Adding support for TopologyAwareHints to EndpointSlice Controller 2021-03-08 15:37:46 -08:00
Swetha Repakula
1925d94b18 Graduate EndpointSlice Controllers to GA
- EndpointSlice controller will stop writing to Topology field
 - EndpointSlice controller will only provide NodeName and Zone on
 EndpointSlices
2021-03-06 15:58:47 -08:00
Swetha Repakula
6f5329d4c0 Remove EndpointSliceNodeName feature gate logic
- feature gate has graduated to GA and will always be enabled, so no
 longer need to check if enabled
2021-03-04 09:57:15 -08:00
Swetha Repakula
be2ef551d1 Graduate EndpointSliceNodeName feature gate to GA
- Feature gate can be removed when EndpointSlice v1beta1 is removed
  - Remove test cases where feature gate is disabled
2021-03-03 18:13:51 -08:00
Rob Scott
e1542606c2
Updating EndpointSlice controller to wait for cache to be updated
This updates the EndpointSlice controller to make use of the
EndpointSlice tracker to identify when expected changes are not present
in the cache yet. If this is detected, the controller will wait to sync
until all expected updates have been received. This should help avoid
race conditions that would result in duplicate EndpointSlices or failed
attempts to update stale EndpointSlices. To simplify this logic, this
also moves the EndpointSlice tracker from relying on resource versions
to generations.
2021-03-02 09:43:46 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
wzshiming
98eb869d63 Speed up pkg/controller/endpointslice unit tests 2021-02-05 15:28:37 +08:00
Rob Scott
4c9c9bb5a0 Adding myself as an approver for EndpointSlice controller
This also adds me as a reviewer for the Endpoints controller.
2021-01-31 22:34:39 -08:00
Antonio Ojea
561133ccf1 fix slice controller logging for services ipfamily 2021-01-05 12:52:04 +01:00
Rob Scott
84e4b30a3e
Updates related to PR feedback
- Remove feature gate consideration from EndpointSlice validation
- Deprecate topology field, note that it will be removed in future
release
- Update kube-proxy to check for NodeName if feature gate is enabled
- Add comments indicating the feature gates that can be used to enable
alpha API fields
- Add comments explaining use of deprecated address type in tests
2020-11-12 12:30:50 -08:00
Rob Scott
d985438772
Updating EndpointSlice controllers to support NodeName field 2020-11-11 16:50:36 -08:00
Andrew Sy Kim
7cf19e5fb7 endpointslice API: rename 'accepting' condition to 'serving' condition
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-11-05 19:18:45 -05:00
Andrew Sy Kim
17cf1b4415 endpointslice controller: add test cases to TestSyncServiceFull for terminating endpoints
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-11-05 19:18:45 -05:00
Andrew Sy Kim
2947f5ce4f endpointslice controller: refactor TestSyncServiceFull to use test tables
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-11-05 19:18:45 -05:00
Andrew Sy Kim
1c603e90ef endpointslice controller: set new conditions 'accepting' and 'terminating'
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-11-05 19:18:45 -05:00
Khaled Henidak (Kal)
6675eba3ef
dual stack services (#91824)
* api: structure change

* api: defaulting, conversion, and validation

* [FIX] validation: auto remove second ip/family when service changes to SingleStack

* [FIX] api: defaulting, conversion, and validation

* api-server: clusterIPs alloc, printers, storage and strategy

* [FIX] clusterIPs default on read

* alloc: auto remove second ip/family when service changes to SingleStack

* api-server: repair loop handling for clusterIPs

* api-server: force kubernetes default service into single stack

* api-server: tie dualstack feature flag with endpoint feature flag

* controller-manager: feature flag, endpoint, and endpointSlice controllers handling multi family service

* [FIX] controller-manager: feature flag, endpoint, and endpointSlicecontrollers handling multi family service

* kube-proxy: feature-flag, utils, proxier, and meta proxier

* [FIX] kubeproxy: call both proxier at the same time

* kubenet: remove forced pod IP sorting

* kubectl: modify describe to include ClusterIPs, IPFamilies, and IPFamilyPolicy

* e2e: fix tests that depends on IPFamily field AND add dual stack tests

* e2e: fix expected error message for ClusterIP immutability

* add integration tests for dualstack

the third phase of dual stack is a very complex change in the API,
basically it introduces Dual Stack services. Main changes are:

- It pluralizes the Service IPFamily field to IPFamilies,
and removes the singular field.
- It introduces a new field IPFamilyPolicyType that can take
3 values to express the "dual-stack(mad)ness" of the cluster:
SingleStack, PreferDualStack and RequireDualStack
- It pluralizes ClusterIP to ClusterIPs.

The goal is to add coverage to the services API operations,
taking into account the 6 different modes a cluster can have:

- single stack: IP4 or IPv6 (as of today)
- dual stack: IPv4 only, IPv6 only, IPv4 - IPv6, IPv6 - IPv4

* [FIX] add integration tests for dualstack

* generated data

* generated files

Co-authored-by: Antonio Ojea <aojea@redhat.com>
2020-10-26 13:15:59 -07:00
Kubernetes Prow Robot
60dd999b48
Merge pull request #94443 from aojea/slicesLabels
endpointslice controller should mirror parent service labels
2020-10-02 18:23:04 -07:00
Antonio Ojea
b7d8045b81 endpoinslices must mirror services labels
Implement, in the endpoint slice controller, the same logic
used for labels in the legacy endpoints controller.

The labels in the endpoint and in the parent must be equivalent.
Headless services add the well-known IsHeadlessService label.
Slices must have two well known labels: LabelServiceName and
LabelManagedBy.
2020-09-21 19:50:15 +02:00
Kubernetes Prow Robot
97e4059092
Merge pull request #94730 from robscott/endpointslice-service-fix
Ensuring EndpointSlices are recreated after Service recreation
2020-09-18 18:38:27 -07:00
Rob Scott
de02323a9d
Ensuring EndpointSlices are recreated after Service recreation
This fixes a bug that occurred when a Service was rapidly recreated.
This relied on an unfortunate series of events:

1. When the Service is deleted, the EndpointSlice controller removes it
from the EndpointSliceTracker along with any associated EndpointSlices.
2. When the Service is recreated, the EndpointSlice controller sees that
there are still appropriate EndpointSlices for the Service and does
nothing. (They have not yet been garbage collected).
3. When the EndpointSlice is deleted, the EndpointSlice controller
checks with the EndpointSliceTracker to see if it thinks we should have
this EndpointSlice. This check was intended to ensure we wouldn't
requeue a Service every time we delete an EndpointSlice for it.

This adds a check in reconciler to ensure that EndpointSlices it is
working with are owned by a Service with a matching UID. If not, it will
mark those EndpointSlices for deletion (assuming they're about to be
garbage collected anyway) and create new EndpointSlices.
2020-09-15 21:37:15 -07:00
Stephen Solka
203679cc61 prefer NoError/Error over Nil/NotNil 2020-09-04 18:35:52 -04:00
Rob Scott
9180cf2346
Updating EndpointSlice controller to wait for all caches to be synced
Previously the EndpointSlice controller was not waiting for
EndpointSlices or Nodes to be synced.
2020-08-18 12:11:44 -07:00
Rob Scott
4cfe4403b4
Updating EndpointSlice controllers to return if error encountered
Previously the controllers would proceed with additional creates,
updates, or deletes if 1 failed. That could potentially result in
scenarios where an EndpointSlice create or update failing while a delete
worked. This updates the logic so that removals will not happen if
additions fail.
2020-08-12 09:58:03 -07:00
Dan Winship
e46572ef4b Improve EndpointController's handling of headless services under dual-stack
EndpointController was accidentally requiring all headless services to
be IPv4-only in clusters with IPv6DualStack enabled.

This still leaves "legacy" (ie, IPFamily-less) headless services as
always IPv4-only because the controller doesn't currently have easy
access to the information that would allow it to fix that.
(EndpointSliceController had the same problem already, and still
does.) This can be fixed, if needed, by manually setting IPFamily,
and the proposed API for 1.20 will handle this situation better.
2020-07-17 15:26:21 -04:00
Dan Winship
9fb6e2ef55 Fix Endpoint/EndpointSlice pod change detection
The endpoint controllers responded to Pod changes by trying to figure
out if the generated endpoint resource would change, rather than just
checking if the Pod had changed, but since the set of Pod fields that
need to be checked depend on the Service and Node as well, the code
ended up only checking for a subset of the changes it should have.

In particular, EndpointSliceController ended up only looking at IPv4
Pod IPs when processing Pod update events, so when a Pod went from
having no IP to having only an IPv6 IP, EndpointSliceController would
think it hadn't changed.
2020-07-17 15:22:59 -04:00
Quan Tian
087682584d Fix memory leak in endpointSliceTracker
endpointSliceTracker creates a set of resource versions for each
service, the resource versions in the set could be deleted when
endpointslices are deleted, but the set and its key in the map is never
deleted, leading to memory leak.

This patch deletes the set if the service is deleted, and stops
initializing an empty set when "read-only" methods "Has" and "Stale" are
called.
2020-07-08 00:15:30 +08:00
Rob Scott
3f593710a7
Ensuring EndpointSlice controller does not create EndpointSlices for Services that are being deleted.
This should ensure that the controller does not conflict with garbage collection.
2020-07-01 12:45:49 -07:00