Commit Graph

10808 Commits

Author SHA1 Message Date
Haowei Cai
597929a447 kube-aggregator: bump openapi aggregation log level 2019-03-29 09:59:42 -07:00
Jordan Liggitt
aa8e75c975 Explicitly flush headers when proxying 2019-03-29 11:34:48 -04:00
Kubernetes Prow Robot
2f62e8ff57 Merge pull request #75879 from hormes/watchcache_refactor
Refactor watchcache to pass function to create objects instead of the empty object  itself
2019-03-29 08:16:14 -07:00
fansong.cfs
b29e69c156 Refactor watchcache to support bookmark 2019-03-29 20:40:51 +08:00
Kubernetes Prow Robot
c28b3b1fdd Merge pull request #73937 from smarterclayton/report_errors
Report a watch error instead of eating it when we can't decode
2019-03-28 12:21:59 -07:00
Kubernetes Prow Robot
312eb890e6 Merge pull request #75760 from wojtek-t/follow_comment_from_critical_sections
Add explanation about forgetFunc in cacher
2019-03-27 18:41:26 -07:00
Kubernetes Prow Robot
a519e91256 Merge pull request #75748 from smarterclayton/request_scope_as_pointer
Make RequestScope be a pointer consistently for better memory use
2019-03-27 18:41:11 -07:00
Kubernetes Prow Robot
a8cbb22506 Merge pull request #74747 from liggitt/quota-deadlock
quota controller fixes
2019-03-27 09:04:48 -07:00
Clayton Coleman
8fede0b18a Make RequestScope be a pointer consistently for better memory use
RequestScope is a large struct and causes stack growth when we pass
it by value into multiple stack levels. Avoid the allocations for
this read only struct by passing a pointer.
2019-03-27 11:09:42 -04:00
Jordan Liggitt
05b764dbe3 Exclude custom transports when constructing AnonymousClientConfig() 2019-03-27 09:29:07 -04:00
wojtekt
605522b0c7 Add explanation about forgetFunc in cacher 2019-03-27 08:24:45 +01:00
WanLinghao
4ce05eb3f4 Fix a test build failed error 2019-03-27 14:21:43 +08:00
Clayton Coleman
316a87ce7d Avoid allocating the watch shim object more than once
We can reset and reuse this object repeatedly without triggering an
allocation.
2019-03-26 23:36:49 -04:00
Jordan Liggitt
0f9ebe5e16 Generated files 2019-03-26 23:15:39 -04:00
Jordan Liggitt
6eb082d6b0 Generate networkpolicies extensions/v1beta1 client 2019-03-26 23:15:39 -04:00
Kubernetes Prow Robot
42770799d3 Merge pull request #75743 from logicalhan/preshutdownerror
log preshutdowndown registration error if we encounter one
2019-03-26 19:27:00 -07:00
Kubernetes Prow Robot
feb9bb151c Merge pull request #75730 from wojtek-t/minor_perf_improvements
Avoid allocations in ByIndex() function
2019-03-26 18:11:16 -07:00
Kubernetes Prow Robot
df9e66628c Merge pull request #75717 from wojtek-t/reduce_critical_sections
Reduce critical sections in cacher::Watch function
2019-03-26 18:11:02 -07:00
Kubernetes Prow Robot
4b3eb60081 Merge pull request #75531 from dims/add-new-staging-repository-for-cri-api
New staging repository for cri-api
2019-03-26 18:10:49 -07:00
Davanum Srinivas
33081c1f07 New staging repository for cri-api
Change-Id: I2160b0b0ec4b9870a2d4452b428e395bbe12afbb
2019-03-26 18:21:04 -04:00
Kubernetes Prow Robot
1514bb2141 Merge pull request #75699 from smarterclayton/fast_encode
Avoid allocations when building SelfLinks and fast path escape
2019-03-26 15:10:29 -07:00
Kubernetes Prow Robot
531dbd409f Merge pull request #75445 from shinytang6/enhance/fmt
Replace all time.Now().Sub with time.Since
2019-03-26 13:55:17 -07:00
Han Kang
021f608294 log preshutdowndown registration error if we encounter one 2019-03-26 13:04:10 -07:00
Kubernetes Prow Robot
b0158cea16 Merge pull request #75399 from sttts/sttts-initial-bulk-openapi-merge
apiextensions: merge OpenAPI specs once after cache sync
2019-03-26 12:34:03 -07:00
Kubernetes Prow Robot
11d472ea01 Merge pull request #72179 from WanLinghao/sa_controller
Migrate the controller to use TokenRequest and rotate token periodically
2019-03-26 12:33:19 -07:00
Kubernetes Prow Robot
152f0a150e Merge pull request #75693 from smarterclayton/speed_up_time_json
Reduce allocations in metav1.Time JSON serialization
2019-03-26 11:17:33 -07:00
Clayton Coleman
389a8436b5 Avoid allocations when building SelfLinks and fast path escape
A self link should only require one allocation, and we should skip
url.PathEscape() except when the path actually needs it.

Add a fuzz test to build random strings and verify them against
the optimized implementation. Add a new BenchmarkWatchHTTP_UTF8 that
covers when we have unicode names in the self link.

```
> before
BenchmarkGet-12          	   10000	    118863 ns/op	   17482 B/op	     130 allocs/op
BenchmarkWatchHTTP-12    	   30000	     38346 ns/op	    1893 B/op	      29 allocs/op

> after
BenchmarkGet-12               	   10000	    116218 ns/op	   17456 B/op	     130 allocs/op
BenchmarkWatchHTTP-12         	   50000	     35988 ns/op	    1571 B/op	      26 allocs/op
BenchmarkWatchHTTP_UTF8-12    	   50000	     41467 ns/op	    1928 B/op	      28 allocs/op
```

Saves 3 allocations in the fast path and 1 in the slow path (the
slow path has to build the buffer and then call url.EscapedPath
which always allocates).
2019-03-26 11:38:47 -04:00
wojtekt
7d46e27db1 Avoid allocations in ByIndex() function 2019-03-26 14:14:42 +01:00
Dr. Stefan Schimanski
a7f9ffd39f apiextensions: merge OpenAPI specs once after cache sync 2019-03-26 11:01:29 +01:00
wojtekt
010cb44808 Reduce critical sections in watchache 2019-03-26 08:44:51 +01:00
Kubernetes Prow Robot
e7eb742c19 Merge pull request #75657 from guilhermeoki/docs/sample-controller
sample-controller: update README
2019-03-25 17:45:00 -07:00
Clayton Coleman
b405cdf85b Reduce allocations in metav1.Time JSON serialization
Time has a limited set of allowed characters and so can bypass part of
the expensive checking done for valid JSON characters.

```
BenchmarkGet-12          	   10000	    111846 ns/op	   17273 B/op	     130 allocs/op
BenchmarkWatchHTTP-12    	   50000	     37830 ns/op	    1886 B/op	      29 allocs/op

BenchmarkGet-12          	   20000	    115917 ns/op	   17344 B/op	     130 allocs/op
BenchmarkWatchHTTP-12    	   50000	     36741 ns/op	    1775 B/op	      24 allocs/op
```

Can improve CRD watch performance by 5-10% for small objects.
2019-03-25 18:17:04 -04:00
Kubernetes Prow Robot
0fd410c4fc Merge pull request #75486 from misterikkit/metrics-client
Fix fake clientsets in metrics.k8s.io.
2019-03-25 12:10:46 -07:00
WanLinghao
244b244f9d Migrate the controller to use TokenRequest and rotate token periodically 2019-03-25 14:54:22 +08:00
Guilherme Oki
54e3f0f8a9 sample-controller: update README 2019-03-25 00:12:53 -03:00
Kubernetes Prow Robot
ec64aef25f Merge pull request #74321 from yastij/signal-undecorated-storage-event
use cache size to signal undecorated storage
2019-03-24 03:21:05 -07:00
Kubernetes Prow Robot
9f15368c5c Merge pull request #75576 from smarterclayton/bad_2
Remove use of `%#v` in frequently accessed code
2019-03-22 23:59:05 -07:00
Kubernetes Prow Robot
206ecb4ab8 Merge pull request #71326 from shomron/issue-71277-polluntil-leak
Fix goroutine leak in pkg/util/wait PollUntil()
2019-03-22 20:57:06 -07:00
Kubernetes Prow Robot
3312da83c9 Merge pull request #75602 from smarterclayton/kubelet_proto
Kubelet should request protobuf from the apiserver
2019-03-22 15:46:34 -07:00
Kubernetes Prow Robot
994582965d Merge pull request #75496 from andrewsykim/area-cloudprovider-label
add area/cloudprovider label for changes in pkg/cloudprovider & k8s.i…
2019-03-22 15:46:21 -07:00
Clayton Coleman
89620d5667 Report a watch error instead of eating it when we can't decode
Clients are required to handle watch events of type ERROR, so instead
of eating the decoding error we should pass it on to the client. Use
NewGenericServerError with isUnexpectedResponse to indicate that we
didn't get the bytes from the server we were expecting. For watch, the
415 error code is roughly correct and we will return an error to the
client that makes debugging a failure in either server watch or client
machinery much easier.

We do not alter the behavior when it appears the response is an EOF
or other disconnection.
2019-03-22 16:40:53 -04:00
Clayton Coleman
0489d0b1cf Unify runtime.SerializerInfo with negotiate.AcceptedMediaTypes
There was no reason to have two types and this avoids ~10% of allocations
on the GET code path.

```
BenchmarkGet-12          	  100000	    109045 ns/op	   17608 B/op	     146 allocs/op

BenchmarkGet-12          	  100000	    108850 ns/op	   15942 B/op	     132 allocs/op
```
2019-03-22 13:24:25 -04:00
Clayton Coleman
59b4f47b22 Avoid 3 object creations when no dryRun parameter is provided
These allocations should only occur rarely.

```
BenchmarkGet-12          	  100000	    108013 ns/op	   17732 B/op	     149 allocs/op

BenchmarkGet-12          	  100000	    109045 ns/op	   17608 B/op	     146 allocs/op
```
2019-03-22 13:24:24 -04:00
Clayton Coleman
83c41eab1d Avoid an allocation on all requests when checking for an old user agent
ReplaceAllStrings always allocates, while scanning a relatively short
regex twice is slightly more CPU immediately but less later.

```
BenchmarkGet-12          	  100000	    108824 ns/op	   17818 B/op	     152 allocs/op

BenchmarkGet-12          	  100000	    108013 ns/op	   17732 B/op	     149 allocs/op
```
2019-03-22 13:24:24 -04:00
Clayton Coleman
58fb665646 IsListType uses reflection and is expensive for hot paths
IsListType was causing ~100 allocations for a non list object. It is
used in a wide range of code, so perform a more targeted check.

The use of `%#v` in a hot return path for `fmt.Errorf()` was the main
victim.

Replace `%#v` with a typed error and create a cache of types that are
lists with a bounded size (probably not necessary, but safer).

```
BenchmarkGet-12          	  100000	    119635 ns/op	   20110 B/op	     206 allocs/op
BenchmarkWatchHTTP-12    	  100000	     65761 ns/op	    7296 B/op	     139 allocs/op

BenchmarkGet-12          	  100000	    109085 ns/op	   17831 B/op	     152 allocs/op
BenchmarkWatchHTTP-12    	  200000	     33966 ns/op	    1913 B/op	      30 allocs/op
```
2019-03-22 13:24:24 -04:00
Clayton Coleman
7d53ad1fb0 Kubelet should request protobuf from the apiserver
The kubelet was not asking for application/vnd.kubernetes.protobuf
on list and get calls. It looks like we lost that code when we
moved to cert rotation. Clean up the client initialization path
and make sure that all non-dynamic clients use protobuf by default.
2019-03-22 12:42:20 -04:00
Clayton Coleman
2e1506558a Add benchmark for naive endpoint Get so we can measure it
Baseline:

```
BenchmarkGet-12          	  100000	    119635 ns/op	   20110 B/op	     206 allocs/op
BenchmarkWatchHTTP-12    	  100000	     65761 ns/op	    7296 B/op	     139 allocs/op
```
2019-03-22 11:43:39 -04:00
Kubernetes Prow Robot
e739b55374 Merge pull request #75585 from tiffanyfay/cache
Updated client-go expiration cache to take in expiration policies
2019-03-22 07:06:20 -07:00
Jordan Liggitt
3a988cfb8c Add preliminary go module instructions to client-go 2019-03-22 09:47:51 -04:00
Kubernetes Prow Robot
1e184775aa Merge pull request #75214 from deads2k/health
provide verbose output when health check fails
2019-03-22 05:22:31 -07:00