Commit Graph

153 Commits

Author SHA1 Message Date
Jordan Liggitt b3ad9fb4e3 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

Replay of a9593d634c6a053848413e600dadbf974627515f

Kubernetes-commit: 15d9d196476d64482189f00f1cf1a2061aea5b35
2022-11-16 11:39:18 -05:00
Artur Żyliński 71b30218e5 Always log APF InitialSeats and FinalSeats values
Add apf_additionalLatency field, to have all WorkEstimate data

Kubernetes-commit: ed780fb06ebb401f599db1dc9295c73bbc1f565f
2022-07-13 10:38:11 +02: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
Maciej Wyrzuc 253e375283 Copy request in timeout handler
Kubernetes-commit: 44705c71401d327c6d596597adc55596973e89d0
2022-02-24 13:42:32 +00:00
Wojciech Tyczyński abc4243fac Record dropped requests in apiserver_request_total metric
Kubernetes-commit: 14396349954be57abea7162d7fe091e58a80ec4b
2022-03-23 16:16:36 +01:00
kerthcet 6316e03e25 fix: race detected in TestErrConnKilled
Signed-off-by: kerthcet <kerthcet@gmail.com>

Kubernetes-commit: dd75d3b9ecca72968bcb7ce50b39ec00e7415b41
2022-03-24 01:48:49 +08:00
jupblb c0c615eb7a Remove apf_fd from httplog
Since flowDistinguisher may hold data identifying a user accessing the
cluster this can be a source of a PII leak.

Kubernetes-commit: 94c92f78e5b02c27502f3b9d59b4e194e476a6f4
2022-03-10 12:59:00 +01:00
brianpursley 21a4aa1138 Fix wrong status code in unit test error messages.
Replace deprecated use of diff.ObjectReflectDiff() with cmp.Diff().

Kubernetes-commit: e9211d3279649795e40d9698f05e9752d111024a
2022-01-25 20:31:47 -05:00
Abu Kashem dc55a1a6cc fix flake in TestTimeoutHeaders
Kubernetes-commit: 2ae70e85d27ad30c29084b56572a817bc18b42e1
2022-02-07 10:34:20 -05:00
Jordan Liggitt 0edf32708d Fix header mutation race in timeout filter
Kubernetes-commit: 5b2a31f375755386b5cb2541b912f3561f7d6431
2022-01-04 22:57:29 -05:00
Abu Kashem 6bd59a523a apf: add a metric to count seat samples
Kubernetes-commit: bb15bdf15c1cc4d5a4380f3f6ed46d4adc9662a1
2021-11-23 11:36:09 -05:00
Abu Kashem b88c96a347 apf: add initial and final seats to httplog
Kubernetes-commit: be085b63455738d3f89fd804c84ae7ab0ac81008
2021-11-23 10:26:10 -05:00
Abu Kashem 1d83e4074a apf: ensure exempt request notes the classification
Kubernetes-commit: 8b2dd74c277d6a56a14e99830d39b23c5788c62e
2021-12-05 11:29:15 -05: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
Sergey Kanzhelev 95790548cb remove ReallyCrashForTesting and cleaned up some references to HandleCrash behavior
Kubernetes-commit: a11453efbc4a5575f7945af1c6fd4f7c00379529
2021-05-04 00:10:11 +00:00
Antonio Ojea 2f6960cc90 remove unused variable responseBodySize
Kubernetes-commit: 9336ff78f4a95cca8eb4a5cf528812d1bcac552c
2021-11-16 22:49:22 +01:00
Antonio Ojea 990b0d9a2e no lint unused variables
Kubernetes-commit: e82e0b38ffff895210fc6ce58bb347f77a828c01
2021-11-16 19:00:22 +01:00
Mike Spreitzer 4098be7694 Factored TimedObserver into less surprising pieces
Kubernetes-commit: ab64e852023965fd8873abcd50ff09cf79814d11
2021-11-15 14:59:30 -05:00
Mike Spreitzer 56b220f8cd Add metrics about watch counts seen by APF
Kubernetes-commit: 154bf6aab33c2486a9066f66ab3a056c1095cb9a
2021-10-25 03:31:47 -04:00
Wojciech Tyczyński 9ad8b586fc P&F: Update WatchTracker interface to pass more information
Kubernetes-commit: 12746f4bc15458d585ffd4c6e9d6066810e27361
2021-10-28 12:41:41 +02:00
Abu Kashem 9560ec6e92 introduce final seats for work estimate
Kubernetes-commit: 3d6cc118fee15313419bf7aa0082a2a608ec62f6
2021-09-24 15:18:27 -04:00
Abu Kashem 733c3f75e9 apf: print watch init latency in httplog
Kubernetes-commit: 9b21e11cf9f4cda7c985a588f60925f0766fac02
2021-10-01 10:18:19 -04:00
Abu Kashem 6013da2b94 apiserver: wrap ResponseWriter using abstraction
Kubernetes-commit: 0d50c969c587c8a6c16e0962118305ac652c5a6b
2021-09-20 11:21:56 -04:00
Abu Kashem 863c48fbc2 apf: rename WorkEstimate.Seats to InitialSeats
Kubernetes-commit: 5d67896adedbce27f01b59eb5f2054919a047f2b
2021-09-24 09:41:38 -04:00
Mike Spreitzer fa81877012 Rename httplog entry from "apf_d" to "apf_fd"
Because it is for the "Flow Distinguisher".

Kubernetes-commit: be717abb8317ed309a9d2139856a8e87fad76a16
2021-09-15 17:10:11 -04:00
Abu Kashem db8aff032b apf: update apf logic to use v1beta2
Kubernetes-commit: 28f2b42a4116a9223113e8b152e02a4f1e602ff4
2021-08-16 17:53:57 -04:00
Mike Spreitzer 06debee006 Remove race condition from TestApfExecuteWatchRequestsWithInitializationSignal
Kubernetes-commit: b78baaad5ff4bcaf12e5de9e7e35f8fadba1c25b
2021-08-31 17:40:03 -04:00
Abu Kashem 033ff70436 Revert "Merge pull request #104281 from tkashem/not-ready-429"
This reverts commit fc5863b8b276e0789f717859e8cce58d7d060181, reversing
changes made to 027fe2554fd18343b8be39eddc8ff6570a6c390f.

Kubernetes-commit: f9f08725907b7db2104ee5fe9f82ab0752726533
2021-08-31 10:10:46 -04:00
Maciej Borsz 02f98184b3 Add APF's priorityLevel to httplog.go
Kubernetes-commit: 6db63869b0fd0551382dec1b30b649fda4289444
2021-08-13 13:00:07 +02:00
Abu Kashem f3ae70d0cf send retry-after until ready
Kubernetes-commit: 6e3923d0a4f4720d2d9f628eb9c073d2d3ee291a
2021-08-10 12:03:21 -04:00
Abu Kashem 030819c510 apiserver: refactor WithRetryAfter server filter
Kubernetes-commit: 83889ae5940036d89b9822a1e38f0f939308e408
2021-08-09 18:25:29 -04:00
Abu Kashem ffb869e08f apiserver: add a new mode for graceful termination
add a new mode for graceful termination with the new server run option
'shutdown-send-retry-after'
- shutdown-send-retry-after=true: we initiate shutdown of the
  HTTP Server when all in-flight request(s) have been drained. during
  this window all incoming requests are rejected with status code
  429 and the following response headers:
    - 'Retry-After: N' - client should retry after N seconds
    - 'Connection: close' - tear down the TCP connection
- shutdown-send-retry-after=false: we initiate shutdown of the
  HTTP Server as soon as shutdown-delay-duration has elapsed. This
  is in keeping with the current behavior.

Kubernetes-commit: 3182b69e970bd1fd036ff839fdf811f14e790244
2021-07-14 10:39:29 -04:00
wojtekt b4c306e1e8 Rename width to workEstimate in P&F code
Kubernetes-commit: 73211256e8f15cf84ee69d6fe8258c3a912e0f94
2021-07-13 15:10:58 +02:00
wojtekt 280558d490 Add additional APF test for handling other panic types
Kubernetes-commit: faed88bb7200cc4693b7a3f9cecff1a99ea1fc95
2021-07-14 16:36:38 +02:00
wojtekt 242c8c8a1c Optimize APF support for watch initialization to fix the pod startup time regression.
Kubernetes-commit: ef435b85b47618d0d463ac93e9758d75c2998681
2021-07-13 10:22:30 +02:00
wojtekt fbc127e994 Add watch tracker to APF for request cost estimation
Kubernetes-commit: cea1dcfeed2fc4e8ab89cd43e5a0e402251c8df5
2021-06-15 10:49:42 +02:00
Abu Kashem cf5c77fde9 apf: add additional latency into width
Kubernetes-commit: 24e19229101d242d924ce98a562be3864dde9eae
2021-06-27 12:45:24 -04:00
Antonio Ojea 5a7fb85083 deflake TestClientReceivedGOAWAY test
The test was flaking because the test was creating more connections
than expected.

Disabling connection pooling removes the flakes, and no more connections
are created that the necessary.

Kubernetes-commit: 4d11c3cd8cb18c1e246a7a6b8e9a791177c49d31
2021-06-18 00:38:02 +02:00
Abu Kashem 3c7f54740f apf: add plumbing to estimate width" of a request
- add plumbing that allows us to estimated "width" of a request
- the default implementation returns 1 as the "width" of all
  incoming requests, this is in keeping with the current behavior.

Kubernetes-commit: 9b72eb1929a64b9d5a5234090a631ba312fb4d41
2021-05-11 07:03:05 -04:00
Abu Kashem 9421ee44c4 apf: fix flake in test
Kubernetes-commit: 8847a25026711f51ae694fe8288e285a48e70675
2021-06-01 20:07:51 -04:00
wojtekt 9b71cff19c Fix watch rejections in P&F filter
Kubernetes-commit: 8054b0f808d116658ac086e4b71fb34d1502cd57
2021-06-02 08:22:29 +02:00
wojtekt d000916ae7 Address watch panics in P&F handler and extend testing.
Kubernetes-commit: d9d51541a87ec627160d7d6a1fcd4b357a0fa493
2021-05-27 14:49:54 +02:00
wojtekt 5290a24345 Implement support for watch initialization in P&F
Kubernetes-commit: 0cc217647ca8be0820973b970124a072c27b6575
2021-05-07 12:49:06 +02:00
Abu Kashem b84fa01322 add more context to post timeout request activities
Kubernetes-commit: 66587afb60b10569aa4ed35d53a4a91fcc40abd2
2021-04-09 12:09:35 -04:00
Abu Kashem bb69e234a6 apiserver: improve correlation by using the audit ID
- when we forward the request to the aggregated server, set the audit
  ID in the new request header. This allows audit logs from aggregated
  apiservers to be correlated with the kube-apiserver.
- use the audit ID in the current tracer
- use the audit ID in httplog
- when a request panics, log an error with the audit ID.

Kubernetes-commit: b607ca1bf3e1cf6152c446ea61ac7fdd9014e1f1
2021-03-02 19:27:43 -05:00
Abu Kashem f1a76db888 apiserver: manage audit ID associated with a request
Manage the audit ID early in the request handling logic so that it can
be used by different layers to improve correlation.
- If the caller does not specify a value for Audit-ID in the request
  header, we generate a new audit ID
- If a user specified Audit-ID is too large, we truncate it
- We echo the Audit-ID value to the caller via the response
  Header 'Audit-ID'

Kubernetes-commit: 31653bacb9b979ee2f878ebece7e25f79d3f9aa6
2021-03-02 19:22:39 -05:00
Abu Kashem 1e7338b1ea use request received timestamp in httplog
Kubernetes-commit: 71199664be6d26e435a78566818379ff43110352
2021-03-02 18:05:51 -05:00
answer1991 db01b261c4 disable flaky TestClientReceivedGOAWAY test case
Kubernetes-commit: d6f9369126dcaa3c94902108ec1aa3d01f658163
2021-03-15 21:12:22 +08:00
answer1991 43c20c5bfe enable goaway testcases which will not flake any more with new golang.org/x/net version.
Kubernetes-commit: f1b23fe7679f3c650cabcd13a60b5a08b8cda36f
2021-02-05 23:34:30 +08:00
Shiming Zhang 4180bf5339 Fix flake test timeout
Kubernetes-commit: bd2655be235a00fe9db47dfe03220b691599f5f0
2021-02-23 13:59:31 +08:00