Commit Graph

6116 Commits (b5e3acc5c0720851cf7542906630376e59b8810c)

Author SHA1 Message Date
Jordan Liggitt 1b0cc829f3 Update sample aggregated server yaml to work with e2e test image 2019-04-01 12:16:51 -04:00
Clayton Coleman 6801ce990a
Set list meta on PartialObjectMetadataList during transform 2019-04-01 11:59:18 -04:00
Clayton Coleman efde94a0bc Add ListMeta to PartialObjectMetadataList
Unfortunately the proto id is now inconsistent with other "correct" objects,
but to change it will require a breaking serialization change. Worth considering.
2019-04-01 10:48:39 -04:00
Kubernetes Prow Robot 782ed5ce13
Merge pull request #75835 from hormes/add_timeout_to_watch
add timeout support  for Watch()
2019-04-01 06:38:33 -07:00
Dr. Stefan Schimanski 7db60f678f staging/publishing: split rules for godeps and go.mod bot 2019-04-01 14:55:09 +02:00
Kubernetes Prow Robot b75e28fe73
Merge pull request #75595 from liggitt/client-go-instructions
Add preliminary go module instructions to client-go
2019-04-01 02:24:34 -07:00
fansong.cfs c676e234cc add timeout suuport for watch 2019-03-31 15:57:09 +08:00
Kubernetes Prow Robot e9c42a15f7
Merge pull request #73672 from WanLinghao/failure_domain_remove
Remove dead code about failure-domains option in kube-scheduler
2019-03-30 18:22:33 -07:00
Kubernetes Prow Robot 615c491040
Merge pull request #75858 from danielqsj/crdct
add possible values to CustomResourceDefinitionConditionType
2019-03-30 09:41:08 -07:00
danielqsj 9c772a2855 update generated files 2019-03-30 14:52:50 +08:00
danielqsj f07b9b6a3c add possible values to CustomResourceDefinitionConditionType 2019-03-30 14:52:18 +08:00
Haowei Cai 5809b6a428 document the usage of errCh 2019-03-29 10:14:44 -07:00
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
tiffany jernigan bc226a2a89 Updated client-go expiration cache to take in expiration policies 2019-03-22 07:38:35 +00:00
Kubernetes Prow Robot ab35bd0668
Merge pull request #75577 from mars1024/bugfix/use_add_in_enqueue
replace AddRateLimited with Add in enqueue func
2019-03-22 00:04:57 -07:00
Kubernetes Prow Robot 83d467c22e
Merge pull request #75270 from justincormack/uuid4
Use UUIDv4 not UUIDv1
2019-03-22 00:04:17 -07:00
Bruce Ma 0335867b56 replace AddRateLimited with Add in enqueue func 2019-03-22 11:40:23 +08:00
Clayton Coleman 435db312e1
Avoid using `%#v` for errors when %T is more informative
`%#v` may have significant performance costs in frequently invoked code.
2019-03-21 22:54:06 -04:00
Clayton Coleman ecd43f13cf
Avoid using `%#v` for errors when %T or %s would be more accurate
`%#v` may have significant performance costs in frequently invoked code.
2019-03-21 22:53:43 -04:00
Clayton Coleman 082aee343e
Avoid using `%#v` for errors when %T is clearer
`%#v` may have significant performance costs in frequently invoked code.
2019-03-21 22:53:07 -04:00
Jonathan Basseri ab7e2ff136 Fix fake clientsets in metrics.k8s.io.
The generated fake clientsets were using the API group "metrics" instead
of "metrics.k8s.io". This patch includes a test that fails without the
fix.

The `+groupName` annotation needed to be copied to the v1alpha1 and
v1beta1 packages to fix it.

As a result, tests using this fake clientset work as expected.
2019-03-21 10:41:57 -07:00
Levi Blackstone a9cba032de
Check for required name parameter in dynamic client
The Create, Delete, Get, Patch, Update and UpdateStatus
methods in the dynamic client all expect the name
parameter to be non-empty, but did not validate this
requirement, which could lead to a panic. Add explicit
checks to these methods.
2019-03-21 09:28:36 -06:00
shinytang6 5c9f4d9dc6 replace time.Now().Sub with time.Since 2019-03-21 18:02:55 +08:00
Kubernetes Prow Robot ed4258e5c0
Merge pull request #75264 from smarterclayton/optimize_rbac_visit
Avoid allocating when performing VisitRulesFor on service accounts
2019-03-20 19:19:35 -07:00
Kubernetes Prow Robot 59140d6474
Merge pull request #75295 from DataDog/lbernail/strict-arp-flag
[kube-proxy/ipvs] Add flag to enable strict ARP
2019-03-20 07:41:51 -07:00
Kubernetes Prow Robot 5229bce04f
Merge pull request #75279 from danielqsj/admission-metrics
remove the deprecated admission metrics
2019-03-20 07:41:22 -07:00
Kubernetes Prow Robot b3be84dcc5
Merge pull request #75240 from kairen/update-client-go-example
client-go: update leader election example
2019-03-20 05:24:23 -07:00
Kubernetes Prow Robot 481de197c0
Merge pull request #75156 from smarterclayton/diff_invalid
Handle nil interface inputs to diff.ObjectReflectDiff
2019-03-20 00:55:01 -07:00
Kubernetes Prow Robot 6f9bf5fe98
Merge pull request #71548 from smarterclayton/watch_converted
Support Table and PartialObjectMetadata on watch
2019-03-19 22:42:22 -07:00
Andrew Sy Kim e2ad79a302 add area/cloudprovider label for changes in pkg/cloudprovider & k8s.io/cloud-provider
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-03-19 21:16:20 -07:00
Kubernetes Prow Robot 6a2936dcbf
Merge pull request #74642 from SataQiu/fix-golint-20190227
Fix golint failures in client-go/scale/scheme/appsint, client-go/scale/scheme/extensionsint, client-go/scale/scheme
2019-03-19 20:14:54 -07:00
Kubernetes Prow Robot 0685b04b2a
Merge pull request #74592 from lou-lan/delete-blank
delete duplicate empty blanks
2019-03-19 20:14:41 -07:00
Kubernetes Prow Robot a6677d6f3e
Merge pull request #73409 from yue9944882/bugfix/compatible-with-nil-authorizer
Fixes authz compatibility w/ nil authorizer in apiserver
2019-03-19 19:00:52 -07:00
Kubernetes Prow Robot 86f6279bb9
Merge pull request #72919 from liggitt/crd-quiet-conflict
Avoid logging normal conflict/notfound error responses in CRD controllers
2019-03-19 19:00:38 -07:00
Yassine TIJANI 8261d3d9a6 use cache size to signal undecorated storage 2019-03-19 23:48:07 +01:00
Kyle Bai 8a82b21f46 client-go: update leader election example 2019-03-19 15:48:02 +08:00
WanLinghao f510f49955 Remove dead code about failure-domains option in kube-scheduler 2019-03-18 14:25:04 +08:00
Haowei Cai df1ee5e778 generated 2019-03-13 15:16:50 -07:00
Clayton Coleman 4c87a14e6b
Avoid allocating when performing VisitRulesFor on service accounts
Service account authorization checks are done frequently and were
observed to perform 7% of allocations on a system running e2e tests.
The allocation comes from when we walk the authorization rules to
find matching service accounts.

Optimize the check for service account names to avoid allocating.
2019-03-13 17:40:21 -04:00
Kubernetes Prow Robot e7d09ceb50
Merge pull request #75289 from dims/update-http2-dep-go-1.12
Update golang.org/x/net/... dependencies to release-branch.go1.12
2019-03-13 04:33:46 -07:00
Kubernetes Prow Robot 93402fc8e8
Merge pull request #75277 from jennybuckley/fix-ints
Fix server side apply int/float bug
2019-03-12 17:36:40 -07:00
Kubernetes Prow Robot cc8afb25fc
Merge pull request #74040 from ajatprabha/issue_73648
add ResourceVersion to DeleteOptions.Preconditions
2019-03-12 15:44:38 -07:00
Kubernetes Prow Robot 0977ab69ad
Merge pull request #75157 from aaron-prindle/version-check-apply
Added version check between patch and live object in server side apply
2019-03-12 13:19:06 -07:00
Justin Cormack 0fb4b81c3f
Use UUIDv4 not UUIDv1
UUIDv1 has several disadvantages:
 - it encodes the MAC address of the host, which is a potential privacy issue
 - it uses the clock of the host, which reveals time information
 - the clock is very coarse, hence the complex code handling duplicates

UUIDv4 is simply a 122 bit random number encoded into the UUID format, which
has no problems with duplicates or locking.

Use the google/uuid library, as newer versions of pborman/uuid just wrap the
Google upstream.

Note that technically a random UUID might fail, but Go ensures that this
should not take place, as it will block if entropy is not available.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2019-03-12 16:03:21 +00:00
Davanum Srinivas 2aa1348e6c
Update to go 1.12 version of golang.org/x/net
Change-Id: I3f2fa5d7b6811c9eca58992318d19e44ec9131fd
2019-03-12 11:30:24 -04:00
Laurent Bernaille 09f821ddb5 [kube-proxy/ipvs] Add flag to enable strict ARP 2019-03-12 15:56:22 +01:00
Prasad Ghangal 317ecf58cc
Update golang.org/x/net/... dependencies to release-branch.go1.11
- latest grpc-ecosystem/go-grpc-middleware

Change-Id: Ida7d01e4606f6e0313e1355db6e85be0c0ef1dd1
2019-03-12 09:48:52 -04:00
ajatprabha 4bd0c4ad56
update generated-protobuf 2019-03-12 17:00:42 +05:30
ajatprabha c2755f6685
update generated-swagger-docs 2019-03-12 17:00:42 +05:30
ajatprabha fe3b9f486f
update testDeleteWithResourceVersion 2019-03-12 17:00:41 +05:30
ajatprabha 4ddc198c39
pin ResourceVersion precondition only when specified 2019-03-12 17:00:41 +05:30