Commit Graph

556 Commits

Author SHA1 Message Date
Steve Kuznetsov 41c1f65bf6 pkg/storage/etcd3: correctly validate resourceVersions
In a number of tests, the underlying storage backend interaction will
return the revision (logical clock underpinning the MVCC implementation)
at the call-time of the RPC. Previously, the tests validated that this
returned revision was exactly equal to some previously seen revision.
This assertion is only true in systems where no other events are
advancing the logical clock. For instance, when using a single etcd
cluster as a shared fixture for these tests, the assertion is not valid
any longer. By checking that the returned revision is no older than the
previously seen revision, the validation logic is correct in all cases.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: eba25cdbbcc5d35e707516194f64d8ed363c2773
2022-03-23 12:44:49 -08:00
Anish Ramasekar e442eafb33 feat: prepare KMS data encryption for migration to AES-GCM
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
Co-authored-by: Monis Khan <mok@vmware.com>
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 90b42f91fd904b71fd52ca9ae55a5de73e6b779a
2022-03-16 17:54:10 +00:00
Steve Kuznetsov 42854c1734 pkg/storage/etcd3: be more precise in watch test
Previously, this test assumed that:
 - a global watch would return only an event for the key in question
 - only the delete event in question would be returned

Neither of these assumptions are correct for an etcd backend as long
as any other clients are interacting with the system. This commit
makes the watch more specific and extracts the correct event.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 2631c0a0f959bd67aa455045dce33e77150ab5f8
2022-03-23 12:59:53 -08:00
Abu Kashem 1b651c5994 add latency tracker for storage and transform
Kubernetes-commit: eca90856940e9251ecf3fde95c5e4d2d16f5ad68
2022-02-01 18:13:03 -05:00
Patrick Ohly ba3b8e9322 enhance and fix log calls
Some of these changes are cosmetic (repeatedly calling klog.V instead of
reusing the result), others address real issues:

- Logging a message only above a certain verbosity threshold without
  recording that verbosity level (if klog.V().Enabled() { klog.Info... }):
  this matters when using a logging backend which records the verbosity
  level.

- Passing a format string with parameters to a logging function that
  doesn't do string formatting.

All of these locations where found by the enhanced logcheck tool from
https://github.com/kubernetes/klog/pull/297.

In some cases it reports false positives, but those can be suppressed with
source code comments.

Kubernetes-commit: edffc700a43e610f641907290a5152ca593bad79
2022-02-16 12:17:47 +01:00
Steve Kuznetsov 25c879eec5 pkg/storage/etcd3: update test to time out, not panic
Without these select statements, this test runs until the package-global
timeout and causes a panic. This change makes the test fail faster and
more legibly.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: fc33d0176a5afb81927430d075165152f953c54e
2022-03-23 12:22:35 -08:00
Maciej Borsz f4edb394b0 Implement page size progressing for rare selectors.
Kubernetes-commit: a2ad9f9e4aba6aae6657a3189bdced6dbc8ba4b5
2022-03-07 15:44:59 +00:00
Steve Kuznetsov edb0c0eba4 pkg/storage/etcd3: use correct diff in tests
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 8903372e8b8d32f8b244f5087e3f2907b86f03bd
2022-03-23 12:33:57 -08:00
Steve Kuznetsov de7922ba23 pkg/storage/etcd3: refactor "too large" resourceVersions
When tests attempt to validate behavior in the case that a client asks
for a resource version that is "too large" for the underlying storage,
the previous implementation would simply add 1 to the latest revision
seen. This is only appropriate for storage backends that
  a) provide a continuous monotonic logical clock
  b) have no other events occurring while the test runs

For instance, when using a singe etcd backend as a shared fixture for
these tests, adding 1 to a previously-seen revision is not suffcient to
ensure that the resulting revision is "too large". By instead using the
largest possible integer value, we can be certain of this.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: b973cdc57cc6ee57684455cdb76db13a8c82cefa
2022-03-23 12:27:16 -08:00
Daniel Smith 7b0bc4f4b3 remove unneeded references
Kubernetes-commit: 2831f9a343ec405efce60d09da482a654971018e
2022-03-17 18:35:00 +00:00
Daniel Smith cbbb5800c3 find and replace
Kubernetes-commit: e405ae9ec8592bf028e351bab44de420908bac0d
2022-03-17 18:50:38 +00:00
astraw99 b0232c830b Fix function name of IsExist err
Kubernetes-commit: 79471695c2a16cb7c1fb17adff7765f07e2c9057
2022-03-19 23:06:51 +08:00
Steve Kuznetsov 3d5978d57e storage: etcd: clarify lease manager configurations
When the original commit created the lease manager, this comment was
added to set the default test reuse time to 1s. Even at that time, the
comment claimed it was setting 10s. Instead of using this value, though,
new tests that did not call `testSetup()` started to use the default
configuration for production. This commit clarifies the intent of this
comment, moves it next to the code block that it actually applies to,
and makes use of this test-specific logic everywhere.

x-ref: f230b000db

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 6aa37eb06247fb95a6a4ef61cbd50885e52055a0
2022-02-18 08:10:57 -08:00
Wojciech Tyczyński 58b4aa562f Fix potential race in dispatching watch event
Kubernetes-commit: 779f157ecfb24d0ee944f18e481bfa8cc8c94f6f
2022-02-22 17:14:15 +01:00
Wojciech Tyczyński 0b8c9f5ebf Avoid perfoming deep copies in watchcache if not needed
Kubernetes-commit: 0cb3a02bbede2f547ddd20e23e2bbc782ac3956c
2022-02-21 15:18:25 +01:00
Steve Kuznetsov 1501fbd930 storage: etcd: use cmp.Diff for comparisons
This commit simply modernizes the comparisons made in the storage tests
to use `cmp.Diff()` so that pointer comparisons and length checks do not
have to be made by hand. We also get nice diffs in the test output this
way instead of large pasted blobs.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: dfdd486f09321e9105fa747a8d1ac5a9a2a7a94a
2022-02-17 07:55:49 -08:00
Steve Kuznetsov fb315d8c17 store: etcd: TestWatch: use cmp.Diff
Modernize the comparisons used in the watch tests to use `cmp.Diff()` for
readability.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: d17a19b39d2dbdaf2cbbaad46de403d6d7ce0602
2022-02-18 06:51:36 -08:00
Steve Kuznetsov 557ecdf10d store: etcd: TestWatch: use sub-tests
This was the last test to not use sub-tests, so we can also remove the
indices that the expectation functions take as parameters now.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 9f7bb4264e0b79cbe7979c09f0e4c75a434a27bb
2022-02-18 06:50:05 -08:00
Wojciech Tyczyński b028a2ea8d Unify merge GetToList and List storage methods to single GetList
Kubernetes-commit: f3d56369f71f5106eeec8300e77bd69b172733da
2022-02-10 10:15:29 +01:00
Wojciech Tyczyński 9f8f72fea9 Change storage.Interface to utilize recurisve parameter
Kubernetes-commit: 3016b3d8f868a3041c7cb86695de09d7ab27cf3b
2022-02-10 09:58:31 +01:00
Steve Kuznetsov 9eba72652e storage: etcd: TestList: improve RV choices
In this test, the current implementation uses a nebulous "RV 1" for some
queries. The intent of this absolute choice is to probe etcd at a
version before any writes ocurred for the test. The particular test
fixture for etcd that is used starts at revision 1, so 1 is used.

This choice is hard to understand the meaning of for readers, though,
and is not valid for any other etcd fixture used for the tests. In order
to improve readability of the test as well as to make it more resilient
to the underlying store, this change updates the test to read the
revision of the underlying storage before making any writes and using
that revision when querying the storage in the tests.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: d2b42b6369ab8db9d0aa0b58dcdf6548ff489d70
2022-02-17 08:36:30 -08:00
Steve Kuznetsov 4074cf3cb4 storage: etcd: TestWatchError: improve readability
This test, as written, is *extremely* cryptic and hard to parse. Add a
comment and stop intentionally ignoring an error that only needs to be
ignored if we're being cryptic.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 50eed81923495f5ee1ac44436676ddbaf2a380fe
2022-02-17 15:46:05 -08:00
Steve Kuznetsov 67dd3e671d storage: etcd: pass contexts correctly in TestConsistentList
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 7272aca69d2602b0bcc97bb5cdc8139ba4687ceb
2022-02-16 13:18:27 -08:00
Steve Kuznetsov af1cb1cefe storage: transformers: pass a context.Context
When an envelope transformer calls out to KMS (for instance), it will be
very helpful to pass a `context.Context` to allow for cancellation. This
patch does that, while passing the previously-expected additional data
via a context value.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 27312feb9983c18d1daf00afba788727d024cdd0
2022-02-17 07:29:44 -08:00
Steve Kuznetsov dbc2925b64 storage: etcd: shorten sub-test names
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 4e166ff74d64042cbeabf72d908ffbf0243d4715
2022-02-16 14:10:43 -08:00
Steve Kuznetsov eaea50a0de storage: etcd: TestConditionalDelete: use sub-tests
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 7729691f5c08dd3aa05e3019190653648a52aba2
2022-02-16 13:29:16 -08:00
Steve Kuznetsov ce3e7f36a8 storage: etcd: TestUnconditionalDelete: use sub-tests
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: dbb00694f69a1f061d15fc3440a39c8ea360977d
2022-02-16 13:27:52 -08:00
Steve Kuznetsov a1c2b74171 storage: etcd: TestGuaranteedUpdate: use sub-tests
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: b6a66252174c59335d82e5b4990b930c8265a69c
2022-02-16 13:26:00 -08:00
Steve Kuznetsov cbb630c2dd storage: etcd: TestGetToList: use sub-tests
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: f1ded3b0c34c70c7a993d3c979571d96a29d56bc
2022-02-16 13:23:49 -08:00
Steve Kuznetsov ba213514c9 storage: etcd: remove a duplicate test case
This test case was a duplicate of the previous one.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 921e7525c074750a47818fdf89a4fe5c0b058f0f
2022-02-16 13:13:03 -08:00
Wojciech Tyczyński 46eb50ac00 Cleanup apiserver storage selflink references where possible
Kubernetes-commit: 9b2908ea3b98edbb1a8bcaf4e3e429283b2debfc
2022-01-19 21:13:25 +01:00
Madhav Jivrajani ffc1b941d4 cacher: Minor cleanup and refactor of code and tests
* Remove linter warnings.
* Cancel contexts to avoid leaks.
* Rename a few XXXThreadUnsafe to XXXLocked to
  maintain consistency.
  * A few are still called XXXThreadUnsafe mainly
    because those are safe to be called from the
    perspective that only one gorotuine will access
    them - not really called under a lock.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: c3081b48759db1f05a446f2acca7e05c4511ce2e
2022-02-10 13:44:34 +05:30
Madhav Jivrajani 4f2ee5cf42 cacher: Use watchCacheInterval to reduce lock contention
- Modify GetAllEventsSinceThreadUnsafe to return a watchCacheInterval
- Modify Watch() to compute a watchCacheInterval rather than a slice
  of all "initEvents" and pass this interval to process()
- Use interval::Next() to obtain events to process rather than obtain
  them all at once
- Modify tests accordingly to use interval
- On invalidation, stop processing and stop the watch.
- Make indexValidator injectable for testing
- Add unit test for verifying the behaviour of stopping the watch.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 7f2aa7ad3a61a52d0a780f904b291d063399c28a
2021-10-05 15:52:09 +05:30
Madhav Jivrajani 74fdb4a93b cacher: watchCacheInterval to reduce lock contention
watchCacheInterval serves as an abstraction over a source
of watchCacheEvents. It maintains a window of events over
an underlying source and these events can be served using
the exposed Next() API. The main intent for doing things
this way is to introduce an upper bound of memory usage
for starting a watch and reduce the maximum possible time
interval for which the lock would be held while events are
copied over.

The source of events for the interval is typically either
the watchCache circular buffer, if events being retrieved
need to be for resource versions > 0 or the underlying
implementation of Store, if resource version = 0.

Furthermore, an interval can be either valid or invalid at
any given point of time. The notion of validity makes sense
only in cases where the window of events in the underlying
source can change over time - i.e. for watchCache circular
buffer. When the circular buffer is full and an event needs
to be popped off, watchCache::startIndex is incremented. In
this case, an interval tracking that popped event is valid
only if it has already been copied to its internal buffer.
However, for efficiency we perform that lazily and we mark
an interval as invalid iff we need to copy events from the
watchCache and we end up needing events that have already
been popped off. This translates to the following condition:
  watchCacheInterval::startIndex >= watchCache::startIndex.
When this condition becomes false, the interval is no longer
valid and should not be used to retrieve and serve elements
from the underlying source.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 347607e97139959f33024a691d0561b1479aeeef
2021-12-05 23:17:00 +05:30
Davanum Srinivas c56bc7b872 OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9682b7248fb69733c2a0ee53618856e87b067f16
2022-01-03 10:59:47 -05:00
Patrick Ohly ec795ae204 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.

Kubernetes-commit: 9eaa2dc554e0c3d4485d4c916dfdbc2f517db2e0
2021-12-11 12:10:21 +01:00
Wojciech Tyczyński 067689be43 Graduate EfficientWatchResumption feature to GA
Kubernetes-commit: b7257a4d6a3f2382f4753322ec6d3458410b04f9
2021-12-10 10:20:51 +01:00
Wojciech Tyczyński b4935b065f Slightly improve reliability of storage List tests.
Kubernetes-commit: 8ca6c5922b9a0bafa8c83617d6930b981430334e
2021-12-10 12:05:32 +01:00
Davanum Srinivas b840d63feb Cleanup OWNERS files (No Activity in the last year)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 497e9c1971c9e7d0193bc6d11503ec4ad527f1d5
2021-12-10 15:18:50 -05:00
Wojciech Tyczyński a55c2c834e Unify List and GetToList functions of etcd3
Kubernetes-commit: 27db8e34cfc930972beb8b5a33c443e134bcd614
2021-11-22 13:30:25 +01:00
Wojciech Tyczyński 0002a597cd Unify List and GetToList functions of cacher.
Kubernetes-commit: c86543d9cb302859510604256fdb81ea1b0d46fb
2021-11-18 16:41:36 +01:00
Davanum Srinivas 56a3a30ae1 Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9405e9b55ebcd461f161859a698b949ea3bde31d
2021-12-09 21:31:26 -05:00
Wojciech Tyczyński 498feb7a9e Add watchcache metrics to tracking its progress
Kubernetes-commit: ba5e08223d3c199a8efb69248728d41e71d70cd0
2021-11-30 11:12:54 +01:00
Wojciech Tyczyński 71bfcaaea1 Simplify storage.Interface by merging Watch and WatchList functions.
Kubernetes-commit: 53653e9b0a7145c3b6e133c5639194ff79b3719d
2021-11-18 12:40:26 +01:00
Wojciech Tyczyński 93c06a1426 Minor watchcache cleanup
Kubernetes-commit: ace55542575fb098b3e413692bbe2bc20d2348ba
2021-10-29 14:06:49 +02:00
Madhav Jivrajani af19f84a96 cacher: refactor process() function
Split process() function into processEvents() and process().
This is done in anticipation of GetAllEventsSinceThreadUnsafe()
returning an entity using which events can be constructed and
not the events itself.

Subsequently, this commit also moves updating resource version
for initEvents from Watch() to the processEvents() func.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: aab7cd3d8a66f425022ca5b2a2bd0d3019efe526
2021-10-29 14:41:10 +05:30
Dr. Stefan Schimanski c0ff3feb85 apiserver/watchcache: doc watch event fan-out to blocked watchers better
Kubernetes-commit: 94b2bb1d3dcfe7973329cc56024f449adde4086c
2021-10-08 17:05:27 +02:00
Dr. Stefan Schimanski 2f0da0d2ea apiserver/storage: free etcd kv early in list decoding loop
Kubernetes-commit: dbf98e42664c8a3a104fe06e0e362497fca2902d
2021-10-08 14:05:26 +02:00
wojtekt a7cc30c9b3 Optimize watchcache by not starting a gorotuine for all Get/List requests setting RV=0
Kubernetes-commit: 37f93fc63d988c2f1ea11f467d2f73a43d1fa5b9
2021-09-24 14:14:19 +02:00
Mike Spreitzer 889106eff7 Add metrics about handling LIST requests
Add metrics that illuminate the costs of handling LIST requests.

Kubernetes-commit: bf424292db185546c474b27b963fd27bdbafc72f
2021-09-01 18:18:23 -04:00
wojtekt b898581360 Migrate to k8s.io/utils/clock in apiserver
Kubernetes-commit: 859a98c0358610e2c127cd2fba1be601ca975188
2021-09-14 20:36:07 +02:00
Lukasz Szaszkiewicz 8fa48ed99b etcd-client starts retrying transient errors from the etcd cluster
This PR enables unaryClientInterceptor in conjunction with Prometheus interceptor.
Previously it was simply overwritten by the Prometheus interceptor.
As a result etcd client didn't attempt to retry certain errors.

The unaryClientInterceptor is important because it knows how to retry all sorts of errors from the etcd cluster. It will make the API server more resilient to failures -  end users won't see certain errors.
The full list of retriable (codes.Unavailable) errors can be found at https://github.com/etcd-io/etcd/blob/main/api/v3rpc/rpctypes/error.go#L72

Kubernetes-commit: 83171562b0954b2e19eb69943f01a44779cc7a8f
2021-09-15 16:40:44 +02:00
Mike Spreitzer 31ec50ec43 Plumb the schema.GroupResource into etcd3 Store struct
Kubernetes-commit: 6f8019aae95db85552381f7e7066a52fef61be7a
2021-09-13 16:54:34 -04:00
tiloso ab3cca3647 Fix staticcheck in apiserver and client-go pkgs
Kubernetes-commit: 830a137d2ea70663cd94403595313b95ac40ffe8
2021-06-19 22:03:46 +02:00
Mike Spreitzer b225af44fe Introduce storagebackend.ConfigForResource
This is a Config specialized for a GroupResource.
It will support generating new resource-specific metrics.

Kubernetes-commit: 85bcd243aa3c8769a5904a1aea44ce704f5e7174
2021-08-29 01:06:12 -04:00
Stephen Augustus 771ffe6475 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 481cf6fbe753b9eb2a47ced179211206b0a99540
2021-08-12 17:13:11 -04:00
Nicolas Mitchell 1cd62ac37f add backticks to comments containing `<` or `>`
Kubernetes-commit: 340555476a4926e10c9ffac8b283cd77ca088c5d
2021-08-21 10:59:50 -07:00
Abu Kashem bd2ef9810a apf: estimate list width
Kubernetes-commit: 296c18ec323328bf1c6a621a9ca3a094d78bb9d0
2021-06-22 19:38:00 -04:00
Jordan Liggitt 29227fd4ee Avoid spurious calls to update/delete validation
Kubernetes-commit: 561ce035b5b7d577ddb5bb30657bc1f8b399e109
2021-08-05 17:21:40 -04:00
Abu Kashem feb4eefe1c apiserver: add callback to get notified of object count
Kubernetes-commit: 2c60feffbee690af4632d068158e640abe10f678
2021-07-14 16:44:34 -04:00
Antonio Ojea 42a99cd0a2 decouple timeBudget from real clock
instead of using a goroutine refreshing the budget, obtain
the value from the last time the budget was accessed.

Kubernetes-commit: dd2c38306000eeb1720afc8346165a6caab09259
2021-07-20 13:54:59 +02:00
Paco Xu d0159b4bbf Revert "use PermitWithoutStream=true for etcd: send pings even without active stream"
Kubernetes-commit: 1280a365e4a2407efb9aba9e701eeb1a5a69a2f0
2021-07-12 11:47:55 +08:00
Ryan Phillips 7afffd8ef3 Revert "apiserver: add callback to get notified of object count"
Kubernetes-commit: d95b14e1abfb5ec87248e5dd826b89d0c738af42
2021-07-08 13:56:39 -05:00
David Ashpole 4d188ce1c3 Add distributed tracing to the etcd client
Kubernetes-commit: 71f810bb71ed7b87e02c91ebb879363f32dcfaac
2021-06-25 11:54:53 -07:00
Davanum Srinivas fe1610f3fe switch from golang-lru to the one in k8s.io/utils
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 79d0c6cdc10293c9bfe644ce31dc186a936579b0
2021-07-07 13:45:07 -04:00
pacoxu 6640c869f9 use PermitWithoutStream=true for etcd: send pings even without active streams
Signed-off-by: pacoxu <paco.xu@daocloud.io>

Kubernetes-commit: 849dbe034b3e4398922c383e09900b464a60db69
2021-04-29 16:27:08 +08:00
wojtekt cd8b524e3f Avoid code duplication in watchcache
Kubernetes-commit: 2df05df6982df93e4ced37d1236f0366069d5838
2021-07-07 09:40:58 +02:00
Abu Kashem d929410e13 apiserver: add callback to get notified of object count
Kubernetes-commit: 1002b0d163dd948334f10b0e25d0e91d253791e8
2021-06-18 10:44:07 -04:00
njuptlzf 4e8f1a1c5a Fix staticcheck failures
Kubernetes-commit: 93365919b501f4b7dcd0cf3ce84c34a584efc17f
2021-04-02 12:23:30 +08:00
Jordan Liggitt 4bb06f3c4d Simplify running embedded etcd server in tests
Kubernetes-commit: 01760927b82cf28bc6ba5b6364fda3c9f8c5c0b1
2021-06-15 12:07:46 -04:00
Jordan Liggitt aafb67c9b2 Quiet grpc info logs in apiserver
Kubernetes-commit: 503f5e1b52812f1bc5bb66d9b02a8f32cc5dccd9
2021-06-15 18:50:54 -04:00
Jordan Liggitt 2f8b9e4dbc Fix etcd egress dialer addr parsing
Kubernetes-commit: a26c392de176494f2c425f712bc49fc399e9ce6d
2021-06-14 18:02:59 -04:00
Jordan Liggitt aaf5f32453 Quiet embedded etcd logs
Kubernetes-commit: f283deee6b65be2b435ec192b6444f969f9d2a42
2021-06-04 00:43:11 -04:00
Jordan Liggitt 8492f8d104 Drop use of deprecated clientv3.SetLogger
Kubernetes-commit: 52b629efbc8be30901192880b8005e7362f9a69f
2021-05-19 09:10:05 -04:00
Jordan Liggitt 6365bf9124 Switch to go.etcd.io/etcd/client/v3
Kubernetes-commit: 2979c3325e3ac4023dd19c435f3a995074328751
2021-03-23 11:01:52 -04:00
Jordan Liggitt 5d270fd014 Drop etcd v2 support from test util
Kubernetes-commit: 77ab4bdbbcc84ebb10645d810a087d272f16f803
2021-03-23 10:54:43 -04:00
Shihang Zhang 4a6863aa9a the last upperbound of kms latency metric is too small
Kubernetes-commit: 6d7c83f2cd19455107bc02bc98fed2296bb46dca
2021-02-23 14:19:25 -08:00
wojtekt 5290a24345 Implement support for watch initialization in P&F
Kubernetes-commit: 0cc217647ca8be0820973b970124a072c27b6575
2021-05-07 12:49:06 +02:00
xiaofei.sun 4f1bee1bff fix watch_cache_capacity metrics
Kubernetes-commit: e3841e91c81e842f2a591b80b67d46c3f7f7adde
2021-06-01 21:42:45 +08:00
Mengxue Zhang 15750850e0 specify pod name and hostname in indexed job
Kubernetes-commit: e64e34e0298d27d4099b632f5b7c1ba38fc66561
2021-04-29 03:33:36 +00:00
Maciej Borsz 770eb2bc44 Update watcher.go
Kubernetes-commit: 532e35ba31e4df0a2df7dd5f2930035ce9379559
2021-05-07 16:07:34 +02:00
卢振兴10069964 549cbbf8de fix broken link in some files
Kubernetes-commit: b29a5fb0746f772b38da570cd8fdc77396ffca31
2021-04-13 08:43:24 +08:00
JUN YANG 2a99e7e764 Fix misspelling of condition.
Signed-off-by: JUN YANG <yang.jun22@zte.com.cn>

Kubernetes-commit: 6c566f6dfa5b76d105ce24b3b0cb7f5e3d50d018
2021-03-14 00:17:58 +08:00
caozhiyuan 5a479e600e fix hardcoding and format error log
Kubernetes-commit: c468a02718402bf42ffc0cd8cdbdf805fdf903a2
2021-04-14 20:19:41 +08:00
njuptlzf b86a0eee08 Add more test code for SelectionPredicate
Kubernetes-commit: 5468db05f0ca33e78ebf96420281097d28971140
2021-04-09 22:28:51 +08:00
Monis Khan 2ad661f8c5 Prune stale entries from OWNERS files
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 91241eac9b7a7e62cc31e663147294bf6dc8f875
2021-04-07 10:38:27 -04:00
Han Kang d21d96225a bump the deprecated version to 1.22
Change-Id: Ibefaa94151704fcaaa920541bbb9a8ad714c1d24

Kubernetes-commit: e7ee76efc0813da419045c80cc06a513fba6fc37
2021-03-29 07:54:12 -07:00
Han Kang 4ac82c26cf rename apiserver_storage_object_counts to conform to best practices (apiserver_storage_objects)
Change-Id: I8c08a37cd3ed7c943a6691185f750e55d389dd3a

Kubernetes-commit: 50e6f15deec3f9b9ffe52accd6aab5f9560b88ad
2021-03-10 04:32:27 -08:00
Yu Yi 09fb3448ff metrics: promote apiserver_storage_object_counts to stable
- rename etcd_object_counts to apiserver_storage_object_counts

CONTEXT https://github.com/kubernetes/kubernetes/issues/98270
FIXES https://github.com/kubernetes/kubernetes/issues/98270

Kubernetes-commit: 77950ba79b8b56bae34291093c69006975c7b775
2021-03-04 14:42:42 +00:00
Han Kang f16dfd3478 add myself to owners for etcd metrics
Kubernetes-commit: 5bc56ef4e6a255a0ca7ec86fbe9a078c284eab1a
2021-03-04 07:46:34 -08:00
Nikhita Raghunath b0b0548e35 *: remove mbohlool from reviewers
Kubernetes-commit: dc3f59c8819d2985939645f4f08cfd98678295e3
2021-02-16 10:45:13 +05:30
Nikhita Raghunath 2b88377b23 *: remove madhusudancs from reviewers
Kubernetes-commit: 6b12c96a9b7fe4d7c03d0dfed447edd6b1055067
2021-02-16 10:40:42 +05:30
Jiaxin Shan dfad5032fb Fix ALPHA stability level reference link
Kubernetes-commit: e01a21469b9719f7d0e84021c032cd8f0016b5d2
2021-01-31 15:37:07 -08:00
Ling Samuel 59be6d306d api-server add --lease-max-object-count
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>

Kubernetes-commit: c8db72c38c34a965800bd9d570c495c45f142186
2020-12-07 10:45:44 +08:00
Wenjia 15c145e78b Remove unused expectedRV in store_test TestGet
expectedRV is defined in tests struct  but not set in test cases, removing the unnecessary checking

Kubernetes-commit: f8f36c672776bb00b2d53c5d49e92b1bfb608516
2021-01-21 11:27:57 -08:00
Maciej Borsz 5d1582cdd6 Print queue lengths on watch termination
Kubernetes-commit: 8f8beeabb7deb04624c70444012ebc8ba59d990f
2021-01-20 09:32:00 +01:00
pacoxu b74ce63ea5 fix static check for vendor/k8s.io/apiserver/pkg/storage/etcd3/
Kubernetes-commit: aaa7084a4a548795c987b29dffb48749531b60a4
2021-01-07 11:21:50 +08:00
Maciej Borsz 8313c177f0 Improve logging in cacheWatcher
Kubernetes-commit: b78f0b31063b7d47781a1ce9ee4ed6c118fb949f
2021-01-11 12:33:52 +01:00
Ling Samuel bd7da186cc apiserver add metric etcd_lease_object_counts
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>

Kubernetes-commit: 7e9fe39cd7c3ee67fcc29e6ca0836917c5a4e9e1
2020-12-07 10:45:44 +08:00
Abu Kashem 2d4e2517cc reduce buckets for etcd_request_duration_seconds
Kubernetes-commit: a7bd404d9b29adae2160acd31081a3aeb49ccaa5
2020-11-20 09:48:24 -05:00
Maciej Borsz 255da953aa Add 'apiserver_terminated_watchers_total'
Kubernetes-commit: 342ad48feb2629ebc832c0b85c52b4eb04d81498
2021-01-08 10:55:44 +01:00
wojtekt 3de94d4883 Unify variable naming between GuaranteedUpdate and Delete in storage
Kubernetes-commit: d0726e4b1354b1c8c3978b96ab7b01d13a2b6340
2020-12-16 09:28:44 +01:00
wojtekt ddcc69d4f7 Use current state from watchcache to avoid etcd get for deletions
Kubernetes-commit: 7bab6a9c6ed7d4e54da3e010a7bf0a30786d28f9
2020-11-03 17:30:26 +01:00
wojtekt 8c25869e43 Add suggestion to storage interface Delete method
Kubernetes-commit: c2d61896f45967cdea15072b7a12faeb635b5dc5
2020-11-03 13:21:00 +01:00
yuanhuaiwang ceb54fd8a6 improve watchCache metrics
Kubernetes-commit: 58e4fae1daafd88dbcc5bd38601397f13d391744
2020-12-02 16:19:20 +08:00
Ling Samuel f673ce24f7 apiserver add --lease-reuse-duration-seconds to config lease reuse duration
Signed-off-by: Ling Samuel <lingsamuelgrace@gmail.com>

Kubernetes-commit: c99567005db15d220f2b792e98af735c5aa24f6e
2020-12-02 17:35:10 +08:00
Ken Sipe 3c3ae0913c fixing unwanted editor changes
Signed-off-by: Ken Sipe <kensipe@gmail.com>

Kubernetes-commit: 3de47dc05853131dcfc588bf2043207487cdd7c4
2020-06-25 17:31:38 -05:00
Ken Sipe b60943f03a fix S1019 use of make
Signed-off-by: Ken Sipe <kensipe@gmail.com>

Kubernetes-commit: a4d05d51d95d30ebe90ec8f652c9a794caa44d53
2020-06-25 17:26:42 -05:00
Ken Sipe 92af261bb8 fix SA2006 value of err not used
Signed-off-by: Ken Sipe <kensipe@gmail.com>

Kubernetes-commit: a549d0a75e3a09d26f3a316982ff3711be4ed1d2
2020-06-25 17:23:37 -05:00
Ken Sipe 5d58b175c8 fix S1021 var declaration
Signed-off-by: Ken Sipe <kensipe@gmail.com>

Kubernetes-commit: 6c49299739a9819c3672248517ab3d6636d1d8c6
2020-06-25 17:10:34 -05:00
Ken Sipe 8877e7bd70 fix S1039 unnecessary use of fmt.Sprintf
Signed-off-by: Ken Sipe <kensipe@gmail.com>

Kubernetes-commit: 168677400c964fe823b985db35b5e1473db17b0f
2020-06-25 17:04:41 -05:00
wojtekt 649d11a350 Fix TestStartingResourceVersion flakiness
Kubernetes-commit: 37b0004978ebc77838c1a83cf5211f5216e7b3b4
2020-11-18 08:36:05 +01:00
chenyw1990 e6daad296e Fix cacheWatcher leak when time jump to the future and jump back
Kubernetes-commit: 36d5db95f8598bc64071c663c6f44a453c662102
2020-11-05 22:02:41 +08:00
Patrik Cyvoct 29daf09387 fix case when HC timeout is 0
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>

Kubernetes-commit: 6af838c3d1027f41d286ef21b2e52ae60315a358
2020-10-28 11:45:50 +01:00
Patrik Cyvoct ddd0b07a5a Allow configuration of etcd healthcheck timeout
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>

Kubernetes-commit: 2e430ba622817b534642fd93098f87ea7f983aee
2020-07-20 09:22:13 +02:00
wojtekt 942f220e85 Remove variadic argument from storage interface
Kubernetes-commit: 8b98305858b107369f2c9b9fd8ef1c5b0da078c0
2020-11-02 15:52:51 +01:00
wojtekt 0f83389bec Fix cacher test after bumping fakeBudget timeout to 2 seconds
Kubernetes-commit: f62e61c28f11a39c1fb4cfda5842bb648ee24eb9
2020-10-27 15:25:31 +01:00
wojtekt e0edc885d5 Fix cacher test flakiness
Kubernetes-commit: 6eb71c4089f69c7cc35ef2fd13bba4329b5716b9
2020-10-26 15:29:51 +01:00
wojtekt cdc93483b8 Watch bookmarks may contain version of objects of other types
Kubernetes-commit: 0bd8104809922aae504fc9be2e853650ecd17b8a
2020-09-29 12:27:20 +02:00
Daniel Smith 7e305c53b5 fix goroutine that lives too long
Kubernetes-commit: 9a2e0fcb18bc9feb327122edc95a968a8d423af7
2020-09-28 10:50:47 -07:00
wojtekt c4fb001eda Enable progress notify events in watchcache
Kubernetes-commit: a94fb5369d5e77b3fcafd1296bac072a1d6e13fe
2020-08-31 13:15:36 +02:00
wojtekt e40efde837 Implement etcd3 progress-notify feature in etcd3 layer
Kubernetes-commit: 56e72841b6005740453828a9f4f7a9a1b9a831f6
2020-08-31 12:40:41 +02:00
wojtekt a5000473c1 Pipe newFunc to etcd3 storage layer
Kubernetes-commit: fbd65a265a47ffe081aaac2f794a55034333d11d
2020-08-31 11:58:45 +02:00
Abu Kashem bd49a32a3f count of etcd object should be limited to the specified resource
Currently count includes keys from different resource(s) if the keys
are a prefix of the specified resource/key.

Consider the following keys:
A: <storage-prefix>//foo.bar.io/machines
B: <storage-prefix>//foo.bar.io/machinesets
If we ask for the count of key A, the result will also include the
keys from key B since key B shares the same prefix as key A.

Append a separator to mark the end of the key, this will exclude all
other keys from a different resource that is a prefix of the specified
key.

Kubernetes-commit: 7e445867aa4d37a67591faf6e5508abaea69d216
2020-09-11 17:07:09 -04:00
Abu Kashem 2819f102d4 Make similar buckets for api and etcd request duration histogram
Make similar buckets for the apiserver_request_duration_seconds and
the etcd_request_duration_seconds histogram so that the result is
more comparable side by side.

etcd_request_duration_seconds uses the default buckets provided by
prometheus client library:
DefBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}

apiserver_request_duration_seconds on the other hand uses more fine
grained buckets, and the maximum bucket size is 60s. Both histograms
should use similar bucket sizes so they are more comparable side by side.

Kubernetes-commit: 9d8441f17d90c46eca6390a522e8771bed10e0ba
2020-08-20 11:49:15 -04:00
Nikhita Raghunath 3151c1befa apimachinery: remove inactive members from OWNERS
Kubernetes-commit: db495ea9837cf840639a4e02085253fb341e12b5
2020-07-11 19:28:24 +05:30
wojtekt 6e6045833c Fix bug for inconsistent lists served from etcd
Kubernetes-commit: a5b60c352d4457d96a90ddf1479f0833ef36f7d4
2020-08-14 14:51:56 +02:00
Joe Betz 97937c66f2 Revert nested trace PR#88936
Kubernetes-commit: 02cf58102a61b6d1e021e256381ff750573ce55d
2020-07-20 09:55:05 -07:00
Joe Betz 7a467399ac Enable nested tracing, add request filter chain tracing incl. authn/authz tracing
Kubernetes-commit: b12ac0abc64adb71d97fbde12f373b1424631f20
2020-03-06 16:11:21 -08:00
wojtekt cd5511f16a Fix bug in reflector not recovering from "Too large resource version" errors
Kubernetes-commit: 3704174f95c7311e025284ef30bb56945fa6e7cc
2020-06-26 09:45:29 +02:00
Joe Betz ee219411ed Add ResourceVersionMatch parameter to make Resource Version semantics consistent for list
Kubernetes-commit: e214f2408b59c745c199645547948a8ad2a87ac2
2020-05-29 10:44:26 -07:00
AkashSarda e0d29c69be Migrate API server logs to Structured logging framewrok
Kubernetes-commit: af60e7b34d59d635740880a03e7e2587ec9ba041
2020-06-17 21:06:35 +00:00
wojtekt 8a4e4b61c9 Add initialization logs to watchcache
Kubernetes-commit: 34b2cf7d2e1c09e10d97ec83e413c41ea7364d80
2020-06-18 13:55:23 +02:00
gongguan 5dbb27a1df remove deprecated cacher CacheCapacity config
Kubernetes-commit: 12c838136b09005e0cbc831096643195ef24cb89
2020-06-05 21:34:36 +08:00
gongguan 915ec02699 restore event Gone test
Kubernetes-commit: f3cbfc3f7e4bf38978b118933d4e626125a9d80f
2020-06-16 11:07:07 +08:00
gongguan 1da8aeae17 improve Clock as Cacher Config
Kubernetes-commit: 0f7de876a5e931a57ba6347b81e8e28d360c788a
2020-06-15 23:57:11 +08:00
Wojciech Tyczynski 54e40d4b2d Revert "Revert "Rely on default watch cache capacity and ignore its requested size""
Kubernetes-commit: 7787ebc85b87eb7bc00f234f4e52eed3d987d5dd
2020-05-27 14:19:38 +02:00
Gaurav Singh 72110f9b1f Code review changes
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Kubernetes-commit: 6a28f1995a4d0749d4871f80c0d8e2989e833a78
2020-05-19 16:42:20 -04:00
Gaurav Singh 7dd66e9272 Fix bug
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Kubernetes-commit: 549214ca8c6f7e05fcbb0c8c045251819b039947
2020-05-17 17:54:28 -04:00
Gaurav Singh 168bf11368 Fix data race in cacher whitebox test
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Kubernetes-commit: 3dc7098cae4c699e30ed9ae85005446f8322fe99
2020-05-17 17:51:49 -04:00
Joe Betz 5b75cf0ff9 Add GetOptions and ListOptions to storage interface
Kubernetes-commit: 4c99949ae6b4a74e4ffda0caba86c151c23d579e
2020-05-29 10:48:33 -07:00
wojtekt 8371df6187 Watch should return "too old RV" if it can't serve it.
Kubernetes-commit: ef1e5b6d3ac25431d890bfe4f540d9aa956a856d
2020-05-25 20:46:27 +02:00
Tim Allclair 5d41955c07 Remove tallclair from some OWNERS files
Kubernetes-commit: 029a144ae9e143ea3f648a8d14fdddb7c845246d
2020-02-20 15:07:06 -08:00
Jordan Liggitt d501f7b597 Revert "Rely on default watch cache capacity and ignore its requested size"
This reverts PR 91260

Kubernetes-commit: 6249f287e1d3d9fb63b60961c8625a82d7db360e
2020-05-23 09:21:22 -04:00
wojtekt 31ffec3302 Rely on default watch cache capacity and ignore its requested size
Kubernetes-commit: 99dff90d613e2014873dc2fae0a00acaf95c3bd2
2020-05-19 18:13:28 +02:00
Davanum Srinivas 5879417a28 switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
wojtekt 6332f98216 Update duration to be kept in watchcache
Kubernetes-commit: d1de6295bb8047cbfd2a4ecbb0d264197f4cd8a4
2020-05-04 17:21:40 +02:00
Wojciech Tyczynski 4589c74d5e Send watch bookmarks every minute
Kubernetes-commit: 9f1e4620379028754f2da4223adf4d1a445e90f4
2020-04-27 18:41:31 +02:00
Wojciech Tyczynski 7686f3528b Revert "Send watch bookmarks every minute"
Kubernetes-commit: 1cb98ed2376b1f7777ca3d7bfac98cbb5f8b9ce3
2020-04-27 17:07:27 +02:00
wojtekt f1c77ba823 Send watch bookmarks every minute
Kubernetes-commit: d4b532e7190c2ad12a0317ff946e2cd0b33f0ada
2020-04-17 19:42:26 +02:00