Commit Graph

57 Commits

Author SHA1 Message Date
Takashi Kusumi
15fac8ab96 Fix ServiceIPStaticSubrange assigns duplicate IP addresses 2022-05-10 17:56:31 +09:00
Wojciech Tyczyński
1b72a0f5a7 Clean storage shutdown for allocators 2022-05-06 12:01:06 +02: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
Tom Payne
21755f9ec0 Speed up counting of bits in allocator
Benchmark:

goos: linux
goarch: amd64
pkg: k8s.io/kubernetes/pkg/registry/core/service/allocator
cpu: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz

Before:

BenchmarkCountBits-8     9459236               140.4 ns/op

After:

BenchmarkCountBits-8    140667842                9.541 ns/op
2021-10-01 17:09:56 +02:00
Tom Payne
125312a8cf Add extra test and benchmark for count bits 2021-10-01 17:08:36 +02:00
Mike Spreitzer
85bcd243aa Introduce storagebackend.ConfigForResource
This is a Config specialized for a GroupResource.
It will support generating new resource-specific metrics.
2021-09-01 16:54:26 -04:00
Tim Hockin
907fceb206 Remove unused NewContiguousAllocationMap
This was used at some point in the past and never removed.  We are not
in the business of hosting unused code.
2021-08-15 14:12:14 -07:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
wojtekt
8b98305858 Remove variadic argument from storage interface 2020-11-02 16:08:23 +01:00
wojtekt
fbd65a265a Pipe newFunc to etcd3 storage layer 2020-09-15 08:19:12 +02:00
Kubernetes Prow Robot
342bcf55e8
Merge pull request #89937 from aojea/portAllocator2
portAllocator sync local data before allocate
2020-06-18 19:03:10 -07:00
Joe Betz
4c99949ae6 Add GetOptions and ListOptions to storage interface 2020-06-03 10:21:38 -07:00
Antonio Ojea
e3df13439a fix service allocation concurrency issues
The service allocator is used to allocate ip addresses for the
Service IP allocator and NodePorts for the Service NodePort
allocator. It uses a bitmap backed by etcd to store the allocation
and tries to allocate the resources directly from the local memory
instead from etcd, that can cause issues in environment with
high concurrency.

It may happen, in deployments with multiple apiservers, that the
resource allocation information is out of sync, this is more
sensible with NodePorts, per example:

1. apiserver A create a service with NodePort X
2. apiserver B deletes the service
3. apiserver A creates the service again

If the allocation data of apiserver A wasn't refreshed with the
deletion of apiserver B, apiserver A fails the allocation because
the data is out of sync. The Repair loops solve the problem later,
but there are some use cases that require to improve the concurrency
in the allocation logic.

We can try to not do the Allocation and Release operations locally,
and try instead to check if the local data is up to date with etcd,
and operate over the most recent version of the data.
2020-04-20 09:50:00 +02:00
Tobias Klauser
811f9d8abf Use OnesCount8 from math/bits to implement countBits
This allows to drop the bitCounts table. Also, bits.OnesCount8 can be
intrinsified to a single instruction on several GOARCHes.
2020-03-26 16:58:48 +01:00
danielqsj
5bc0e26c19 unify alias of api errors under pkg and staging 2019-12-26 16:42:28 +08:00
Jordan Liggitt
bb90f0ff94 Install APIs directly for tests 2019-12-13 11:56:29 -05:00
Ted Yu
2374f9ad7c Propagate error from NewEtcd 2019-08-14 16:46:23 -07:00
wojtekt
ee13be2884 Propagate error from creating cacher and storage decorators up 2019-07-15 20:48:30 +02:00
wojtekt
a756e20cb5 Update autogenerated files 2019-07-01 15:02:49 +02:00
wojtekt
7497260e54 Move etcd/testing to etcd3/testing 2019-07-01 15:02:49 +02:00
Lubomir I. Ivanov
e29c6e1b38 go-1.12: fix 'go vet' failures 2019-03-01 18:48:17 +02:00
Jeff Grafton
23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
hzxuzhonghu
70e45eccf2 Replace "golang.org/x/net/context" with "context" 2018-03-22 20:57:14 +08:00
Jeff Grafton
ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Jeff Grafton
efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Dr. Stefan Schimanski
bec617f3cc Update generated files 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Davanum Srinivas
00bcbd1311 Fix TestCRD Flake
The DestroyFunc functions returned by generic.NewRawStorage is never
called when we do a StartTestServer() in the test suite. For a quick
hack for now, added TrackStorageCleanup/RegisterStorageCleanup and
CleanupStorage. Note that unless TrackStorageCleanup is called (which
is called only from the test suite) the other two methods are
no-ops essentially. So no change in behavior at runtime. This vastly
brings down the number of goroutines that are left behind when this
test is executed and should reduce if not eliminate the flakiness
of TestCRD
2017-10-29 09:50:12 -04:00
Jeff Grafton
aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Jeff Grafton
a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton
33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Mike Danese
a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Tim Hockin
348f7a7036 Don't use global rand for nodeport and IP allocs
Seed it at contruction.
2017-03-16 17:25:07 -07:00
Dr. Stefan Schimanski
6af3210d6f Update generated files 2017-02-03 08:15:46 +01:00
Dr. Stefan Schimanski
536460e1d9 Mechanical fixup imports: pkg/genericapiserver 2017-02-03 08:15:45 +01:00
Dr. Stefan Schimanski
80b96b441b Mechanical import fixup: pkg/storage 2017-02-03 07:33:43 +01:00
Dr. Stefan Schimanski
de2eee391a Update bazel 2017-02-02 15:19:04 +01:00
Dr. Stefan Schimanski
871fc426b3 pkg/storage: move errors here from pkg/api/errors/storage 2017-02-02 15:17:34 +01:00
deads2k
1ef5d26079 move pkg/storage to apiserver 2017-01-31 19:07:33 -05:00
deads2k
aea12038b4 move storage/storagebackend to apiserver 2017-01-27 08:49:55 -05:00
Dr. Stefan Schimanski
3d9449a353 genericapiserver: fix imports 2017-01-19 13:06:47 +01:00
deads2k
77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
deads2k
633e9d98fc use apimachinery packages instead of client-go packages 2017-01-13 14:04:54 -05:00
Timothy St. Clair
fbc5323dad Refactor registry to use store vs. etcd 2017-01-12 09:23:38 -06:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Jeff Grafton
20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Mike Danese
161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Tim Hockin
f75bed8682 Add a ForEach() to bitmap allocator 2016-12-26 21:59:27 -08:00
Mike Danese
c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Kubernetes Submit Queue
16a9c0b49c Merge pull request #37692 from wojtek-t/storage_resource_version_for_get
Automatic merge from submit-queue

Handle RV in Get calls to storage interface.

Ref #37473
2016-12-03 11:44:29 -08:00