Commit Graph

429 Commits

Author SHA1 Message Date
Antonio Ojea
756f1bfe99 add repair loop
Change-Id: I63464bdd5db706ddf7dc5d828b8d03ad532d7981
2023-03-14 22:58:11 +00:00
Antonio Ojea
b2c8190ee7 allow to set the service reference on the allocator 2023-03-14 22:58:11 +00:00
Antonio Ojea
b022475448 clusterip allocator based on IPAddress API
add a new ClusterIP allocator that uses the new IPAddress API resource
and an informer as the backend, instead a bitmap snapshotted on etcd.

Change-Id: Ia891a2900acd2682d4d169abab65cdd9270a8445
2023-03-14 22:58:11 +00:00
Kubernetes Prow Robot
7f0d1722f5
Merge pull request #115378 from aojea/aojea_allocator
add aojea as approver for networking APIs: services/allocators, netwo…
2023-01-29 16:14:49 -08:00
Kubernetes Prow Robot
5bb7326c36
Merge pull request #114418 from xuzhenglun/master
Reserve Nodeport Ranges For Dynamic And Static Port Allocation
2023-01-29 14:02:35 -08:00
Antonio Ojea
0461c48078 add aojea as approver for networking APIs: services/allocators, networking group, ...
Change-Id: Ia6542b21339f4a92a9c13c2b628038abe737d0f9
2023-01-29 00:10:06 +00:00
xuzhenglun
d48dd100bf
add kube_apiserver_nodeport_allocator_* to improve observability of ServiceNodePortStaticSubrange 2023-01-26 14:44:16 +08:00
xuzhenglun
c18c6e1b87
allocate nodeport with offset 2023-01-26 14:44:04 +08:00
Antonio Ojea
ea99593fa1 Fix panic on ClusterIP allocation for /28 subnets
The ClusterIP allocator tries to reserve on part of the ServiceCIDR
to allocate static IPs to the Services.

The heuristic of the allocator to obtain the offset was taking into
account the whole range size, not the IPs available in the range, the
subnet address and the broadcast address for IPv4 are not available.

This caused that for CIDRs with 16 hosts, /28 for IPv4 and /124 for
IPv6, the offset calculated was higher than the max number of available
addresses on the allocator, causing this to panic.

Change-Id: I6c6f527b0a600b3612be37769e405b8fb3dd33a8
2023-01-25 20:32:40 +00:00
TommyStarK
e2d8fc3f62 pkg/registry: Replace deprecated pointer function
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-01-04 10:38:09 +01: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
Antonio Ojea
29ea5076ea refactor current ipallocator
- rename files to match the allocator backend
- use t.Run for tests and cover large ranges
- add benchmarks
- check that thebitmap ip allocator satisfies the interface

goos: linux
goarch: amd64

pkg: k8s.io/kubernetes/pkg/registry/core/service/ipallocator
cpu: Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz
BenchmarkAllocateNextIPv4Size1048574
BenchmarkAllocateNextIPv4Size1048574-24    	 1517683
7373 ns/op	     135 B/op	       8 allocs/op
BenchmarkAllocateNextIPv6Size65535
BenchmarkAllocateNextIPv6Size65535-24      	 5607438
193.9 ns/op	      18 B/op	       2 allocs/op
PASS
2022-12-31 12:48:50 +00:00
Tim Hockin
ed3ebbaaa7
Remove TODO about API proxy checking for svc 2022-12-23 12:32:17 -08:00
Antonio Ojea
1b804fc87c Services API: warnings
The Services API should warn users about some IP addresses
representations, mainly because some of them are not allowed
by the golang std parsers since go 1.17

Specifically:

- IPv4 addresses with leading zeros, that may cause security risks
- IPv6 addresses in non canonical format, that may cause problems
with controllers hotlooping or cause security issues

Change-Id: Ife50a651d1b22dc4c318e42bd3e5f2e5f88ecbcd
2022-12-16 11:54:05 +00:00
Tim Hockin
dd0a50336e
ServiceInternalTrafficPolicyType: s/Type//
Rename ServiceInternalTrafficPolicyType => ServiceInternalTrafficPolicy
2022-12-11 13:48:31 -08:00
Tim Hockin
d0e2b06850
ServiceExternalTrafficPolicyType: s/Type//
Rename ServiceExternalTrafficPolicyType => ServiceExternalTrafficPolicy
2022-12-11 13:48:27 -08: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
Andy Voltz
29f4862ed8 Promote ServiceInternalTrafficPolicy to GA 2022-11-03 13:17:03 -04:00
Laszlo Janosi
82ce61afc7 KEP-1435 Mixed Protocol values in LoadBalancer Service GA
Removed the unit tests that test the cases when the MixedProtocolLBService feature flag was false - the feature flag is locked to true with GA
Added an integration test to test whether the API server accepts an LB Service with different protocols.
Added an e2e test to test whether a service which is exposed by a multi-protocol LB Service is accessible via both ports.
Removed the conditional validation that compared the new and the old Service definitions during an update - the feature flag is locked to true with GA.
2022-11-02 13:44:52 +02:00
Kubernetes Prow Robot
d754183866
Merge pull request #112163 from aojea/static_allocation_ga
graduate ServiceIPStaticSubrange to GA
2022-10-14 17:31:18 -07:00
JunYang
1706de24d2 use klog.InfoS instead of klog.V(0).Info and log structured(registry part) 2022-09-22 14:59:43 +08:00
Antonio Ojea
c5a07b2e05 graduate ServiceIPStaticSubrange to GA 2022-09-02 07:13:18 +02:00
JunYang
2db4dea565 use klog.InfoS instead of klog.V(0).InfoS 2022-08-25 18:46:34 +08:00
Antonio Ojea
5ec9d4a530 doc services healthcheckNodePort is inmutable 2022-08-05 11:51:50 +02:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Abirdcfly
00b9ead02c cleanup: remove duplicate import
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-14 11:25:19 +08:00
Tim Hockin
55232e2ef7 Rename IPFamilyPolicyType => IPFamilyPolicy 2022-07-06 15:42:26 -07:00
Antonio Ojea
975a678ecf services strategy no longer depends on IPFamilies
since the refactor on the Service API registry, the strategy for
service no longer needs to keep information about the cluster
configuration and its ipFamilies.
2022-06-10 11:06:02 +02:00
Kubernetes Prow Robot
68fc207cd9
Merge pull request #110027 from zlabjp/fix-ipallocator-metrics
Fix cluster IP allocator metrics
2022-05-25 11:48:31 -07:00
Wojciech Tyczyński
b5550a3452 Cleanup portallocator/ipallocator interfaces 2022-05-23 12:19:24 +02:00
Takashi Kusumi
187af7781a Fix cluster IP allocator metrics 2022-05-13 22:33:30 +09:00
Kubernetes Prow Robot
c50579afb1
Merge pull request #109873 from wojtek-t/migrate_repair_to_new_events
Migrate ipallocator and portallocator to new Events API
2022-05-11 05:01:14 -07:00
Takashi Kusumi
15fac8ab96 Fix ServiceIPStaticSubrange assigns duplicate IP addresses 2022-05-10 17:56:31 +09:00
Wojciech Tyczyński
f1d901861b Migrate ipallocator and portallocator to new Events API 2022-05-09 09:37:47 +02:00
Wojciech Tyczyński
1b72a0f5a7 Clean storage shutdown for allocators 2022-05-06 12:01:06 +02:00
Wojciech Tyczyński
80060a502c Implement Destroy() method for all registries 2022-04-19 15:59:13 +02:00
Kubernetes Prow Robot
e8e0fe9e87
Merge pull request #106792 from aojea/reserved_allocator
KEP-3070: Reserve Service IP Ranges For Dynamic and Static IP Allocation
2022-03-25 13:53:58 -07: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
Antonio Ojea
ec0881a920 feature gate for service IP allocation prioritized
Add feature gate ServiceIPStaticSubrange to enable a new strategy
in the Service IP allocators, so the IP range is is subdivided and
dynamic allocated addresses are allocated preferently from the
upper range.
2022-03-23 18:47:23 +01:00
Antonio Ojea
96d71f01eb new bitmap allocator with offset
Implement a new bitmap allocator using an allocation strategy that accepts
and offset and subdivides the range based on this offset, prioritizing the
upper range for dynamic allocation.
2022-03-23 17:58:37 +01: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
Xudong Liu
c8a6c7f338 promote load balancer class to GA
Signed-off-by: Xudong Liu <xudongliuharold@gmail.com>
2022-03-21 16:16:13 -07:00
Tim Hockin
e927ce85b6 service REST: Call Decorator(old) on update path
This is causing a bug when upgrading from older releases to 1.23 because
of Service's maybe-too-clever default-on-read logic.

Service depends on `Decorator()` to be called upon read, to
back-populate old saved objects which do not have `.clusterIPs[]` set.
This works on read, but the cache saves the pre-decorated type (as it is
documented)

In 1.23, this code was refactored and it seems some edge-case handling
was inadvertently removed (I have not confirmed exactly what happened).

Test by aojea
2022-01-30 11:25:17 -08:00
Andrew Sy Kim
f68f478e66 core/v1: update unit tests to not expect internalTrafficPolicy when Service Type=ExternalName
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2022-01-04 14:48:04 -05:00
Andrew Sy Kim
438b90fbc4 core/v1: drop Service spec.internalTrafficPolicy on read when type is ExternalName
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2022-01-04 14:36:19 -05:00
Lars Ekman
1ef96752da Mark ServiceLBNodePortControl as GA 2021-12-16 16:48:58 +01:00
Kubernetes Prow Robot
3128afa69a
Merge pull request #106296 from thockin/svc-logging-cleanup
Clean up some service logging
2021-11-10 11:51:38 -08:00