Commit Graph

2407 Commits

Author SHA1 Message Date
Jordan Liggitt
a2a1463427 Test writing configurations with numeric names
Kubernetes-commit: 1f2feb2e7ec307fafa615e001ccb9bbac7d273db
2019-11-17 14:36:52 -05:00
Dr. Stefan Schimanski
145c0413a4 hack/pin-dependency.sh github.com/go-openapi/validate v0.19.5
Kubernetes-commit: ef88c43c0296e6004d0e3407a1336074897b309d
2019-11-15 13:48:59 +01:00
Kubernetes Publisher
0a8a1d7b7f Merge pull request #85305 from codenrhoden/remove-mount-pkg
Remove pkg/util/mount (moved out of tree)

Kubernetes-commit: 45e0080fd5883e3355233c9c22fa5bf242d525dd
2019-11-15 21:58:02 +00:00
Kubernetes Publisher
debe729c79 Merge pull request #85284 from yutedz/svr-check-close-ret
Check error return from closing connection

Kubernetes-commit: e3eeb7e2f000b3d51e856a1862a4fef249b6708c
2019-11-15 21:58:01 +00:00
Kubernetes Publisher
050872ffe7 Merge pull request #85272 from mm4tt/pager_fix
pager.go: don't set ResourceVersion on subsequent List calls

Kubernetes-commit: 452c8c9ad303933123ad1f0b208bc935315e8a67
2019-11-15 13:58:07 +00:00
Kubernetes Publisher
6f03b71b98 Merge pull request #85175 from liggitt/golang-org-comments
Add comments to explain golang.org replace directives

Kubernetes-commit: 24334444b46371e26594e1f6e594195a761b53d3
2019-11-14 22:01:10 +00:00
Travis Rhoden
af446e4f13 Remove pkg/util/mount (moved out of tree)
This patch removes pkg/util/mount completely, and replaces it with the
mount package now located at k8s.io/utils/mount. The code found at
k8s.io/utils/mount was moved there from pkg/util/mount, so the code is
identical, just no longer in-tree to k/k.

Kubernetes-commit: 0c5c3d8bb97d18a2a25977e92b3f7a49074c2ecb
2019-11-14 13:30:00 -07:00
Ted Yu
a4893d5271 Check error return from closing connection
Kubernetes-commit: 7bafa7d8f54326b69d41c92793eaa641d3a5b31b
2019-11-14 07:36:30 -08:00
Mateusz Matejczyk
d7b4c23325 pager.go: Don't set ResourveVersion on subsequent List calls
Ref. https://github.com/kubernetes/kubernetes/issues/85221#issuecomment-553748143

Kubernetes-commit: 977ca43d640d2a85e199a8a282e2df8ebd88055a
2019-11-14 11:34:59 +01:00
Kubernetes Publisher
1924198484 Merge pull request #84390 from robscott/endpointslice-beta
Promoting EndpointSlices to beta

Kubernetes-commit: 64f4be5b328a4df8a709b95604743086013a70e4
2019-11-14 10:07:05 +00:00
Kubernetes Publisher
1f4f5fa64a Merge pull request #85004 from deads2k/dynamic-agg-cert
dynamic reload cluster authentication info for aggregated API servers

Kubernetes-commit: 02af1dd62c4842e20e2ee7337edf032327b1c8ed
2019-11-14 10:07:03 +00:00
Kubernetes Publisher
74d7a2e0eb Merge pull request #85134 from LukeShu/lukeshu/event-docs-non-api
client-go/tools: Docs: Clarify what's "old" core/v1 and what's "new" events/v1beta1

Kubernetes-commit: 760af28f69a7cf7090abeca59e1e0703d161ace8
2019-11-14 10:07:00 +00:00
Kubernetes Publisher
5971a24b40 Merge pull request #84970 from atlassian/pdzwart/kubernetes/kubernetes/84959
- Delete backing string set from a threadSafeMap index when the string set length reaches 0.

Kubernetes-commit: 41be6d65d88728f443966da83b62d545684576ab
2019-11-14 10:06:59 +00:00
Jordan Liggitt
d3ab799453 Add comments to explain golang.org replace directives
Kubernetes-commit: 9f40e19d7ac9e2203c23814701468a26eee1964f
2019-11-12 23:54:26 -05:00
Luke Shumaker
f5d68cde58 client-go/tools: Docs: Clarify what's "old" core/v1 and what's "new" events/v1beta1
Kubernetes-commit: 2c4bb0fa4db88462a61995d9179fad801b00d69d
2019-11-12 08:30:24 -05:00
Kubernetes Publisher
dac3b9c76a Merge pull request #80284 from danielqsj/exec
Fix a racing issue in client-go UpdateTransportConfig

Kubernetes-commit: 48ddf3be87789c92e6824c9ce536c76d008f5c19
2019-11-12 10:08:11 +00:00
Kubernetes Publisher
a56922bade Merge pull request #84692 from smarterclayton/protocol_errors
Fix watch negotiation when using a non-default mime type in the client

Kubernetes-commit: c28921f248a8e6c923096154c6e87efcc188b9f0
2019-11-11 06:10:43 +00:00
Clayton Coleman
9bbcc2938d Always negotiate a decoder using ClientNegotiator
This commit performs two refactors and fixes a bug.

Refactor 1 changes the signature of Request to take a RESTClient, which
removes the extra copy of everything on RESTClient from Request. A pair
of optional constructors are added for testing. The major functional
change is that Request no longer has the shim HTTPClient interface and
so some test cases change slightly because we are now going through
http.Client code paths instead of direct to our test stubs.

Refactor 2 changes the signature of RESTClient to take a
ClientContentConfig instead of ContentConfig - the primary difference
being that ClientContentConfig uses ClientNegotiator instead of
NegotiatedSerializer and the old Serializers type. We also collapse
some redundancies (like the rate limiter can be created outside the
constructor).

The bug fix is to negotiate the streaming content type on a Watch()
like we do for requests. We stop caching the decoder and simply
resolve it on the request. We also clean up the dynamic client
and remove the extra WatchSpecificVersions() method by providing
a properly wrapped dynamic client.

Kubernetes-commit: 3b780c64b89606f4e6b21f48fb9c305d5998b9e5
2019-11-10 16:52:08 -05:00
Pete de Zwart
ab63be7642 - Delete backing string set from a threadSafeMap index when the string set length reaches 0.
- Added thread_safe_store_test exercising new index backing string set delete at 0 functionality.

- TestThreadSafeStoreDeleteRemovesEmptySetsFromIndex logic nesting inverted.

- Added test case for usage of an index where post element delete there is non-zero count of elements and expect the set to still exist.

- Fixed date.

- Fixed awprice nits.

- Fix bazel.

Kubernetes-commit: 29a051388a719e0359969b8431de8e38e955e2a6
2019-11-08 16:57:06 +11:00
Ryan Phillips
52589237eb kubelet: add certificate rotation error metric
Kubernetes-commit: 8e50c55e6bf715d9067376a9e7f136ffacb0a3ee
2019-11-05 16:51:40 -06:00
David Eads
7a5b91a7ca dynamic reload cluster authentication info for aggregated API servers
Kubernetes-commit: 3aede35b3b042e8a626e8fb9e1e181e73cd29d0a
2019-11-04 13:46:28 -05:00
David Eads
4bda71482c create utilities inspecting server TLS certs
Kubernetes-commit: e44352f31a8d506d77d2757dbb354fd539826c92
2019-11-12 10:10:26 -05:00
Clayton Coleman
881cd219a8 dynamic: The dynamic client no longer needs a special cased watch
By correctly handling content type negotiation, we can avoid the
need for a special version of watch and use the same code path as
typed clients.

Kubernetes-commit: 3f94f80b0a79293e54d7080aaf7a64d7df8b1d4a
2019-11-03 15:10:12 -05:00
matte21
ce6197e865 Fix error in periodic resyncs description
Make it clear that periodic resyncs fire update notifications, not
create notifications as the old comments incorrectly stated.

Kubernetes-commit: 3ae8c864de24a2ad42321c9cbd71099a2b6dcef3
2019-10-28 14:23:37 +01:00
matte21
85843e6e02 Clarify that OnUpdate can mask delete and recreate
Kubernetes-commit: ff543ddfc09adf3d0abdf42f9d9fbd57c3ab4b43
2019-10-28 14:12:22 +01:00
Rob Scott
370c449f1e Promoting EndpointSlices to beta
Kubernetes-commit: a7e589a8c689d1a6c0c21d47c5e6c97267822875
2019-10-25 14:59:10 -07:00
ashish-billore
b284cb9910 Updated command to start in-cluster deployment
Updated the --image-pull-policy=Never option with default
'IfNotPresent'. 'Never' causes the pod to be in
state: ErrImageNeverPull

Kubernetes-commit: 7400cf937b9fcc31dc29caa8d90800940602b934
2019-09-17 19:58:02 +09:00
Suresh Kumar Ponnusamy
6a6b2af8ea Support TLS Server Name overrides in kubeconfig file
Signed-off-by: Suresh Kumar Ponnusamy <suresh.ponnusamy@freshworks.com>

Kubernetes-commit: 37c81ed79ac6836bce4b96f888aa407dc18d747c
2019-08-28 10:51:14 +05:30
Robert Krawitz
c02e303b36 Report api request throttling at v=3
Kubernetes-commit: e7cc2c2d280f319b78462a37d32c5c7f1e6e5567
2019-07-26 12:59:34 -04:00
danielqsj
0dd469e42b Fix data race in client-go UpdateTransportConfig
Kubernetes-commit: 7518a44b18d8b225a9572f1e0c902776eb4a6eb0
2019-07-18 12:46:03 +08:00
Wayne Witzel III
4562e6a9dd add tests for NewFilteredDynamicSharedInformerFactory namespace
Signed-off-by: Wayne Witzel III <witzelw@vmware.com>

Kubernetes-commit: 2064d90e92430f96e440cfc4fc03a69b4243bc6c
2019-06-20 13:04:36 -04:00
Jack Kleeman
a493c8da9a Add ReloadCertFromDisk flag to rest.Config and to kubeconfig which allows the provided client certificate files to be reloaded from disk (currently on every use)
Close outbound connections when using a cert callback and certificates rotate. This means that we won't get into a situation where we have open TLS connections using expires certs, which would get unauthorized errors at the apiserver

Attempt to retrieve a new certificate if open connections near expiry, to prevent the case where the cert expires but we haven't yet opened a new TLS connection and so GetClientCertificate hasn't been called.

Move certificate rotation logic to a separate function

Rely on generic transport approach to handle closing TLS client connections in exec plugin; no need to use a custom dialer as this is now the default behaviour of the transport when faced with a cert callback. As a result of handling this case, it is now safe to apply the transport approach even in cases where there is a custom Dialer (this will not affect kubelet connrotation behaviour, because that uses a custom transport, not just a dialer).

Check expiry of the full TLS certificate chain that will be presented, not only the leaf. Only do this check when the certificate actually rotates. Start the certificate as a zero value, not nil, so that we don't see a rotation when there is in fact no client certificate

Drain the timer when we first initialize it, to prevent immediate rotation. Additionally, calling Stop() on the timer isn't necessary.

Don't close connections on the first 'rotation'

Remove RotateCertFromDisk and RotateClientCertFromDisk flags.

Instead simply default to rotating certificates from disk whenever files are exclusively provided.

Add integration test for client certificate rotation

Simplify logic; rotate every 5 mins

Instead of trying to be clever and checking for rotation just before an
expiry, let's match the logic of the new apiserver cert rotation logic
as much as possible. We write a controller that checks for rotation
every 5 mins. We also check on every new connection.

Respond to review

Fix kubelet certificate rotation logic

The kubelet rotation logic seems to be broken because it expects its
cert files to end up as cert data whereas in fact they end up as a
callback. We should just call the tlsConfig GetCertificate callback
as this obtains a current cert even in cases where a static cert is
provided, and check that for validity.

Later on we can refactor all of the kubelet logic so that all it does is
write files to disk, and the cert rotation work does the rest.

Only read certificates once a second at most

Respond to review

1) Don't blat the cert file names
2) Make it more obvious where we have a neverstop
3) Naming
4) Verbosity

Avoid cache busting

Use filenames as cache keys when rotation is enabled, and add the
rotation later in the creation of the transport.

Caller should start the rotating dialer

Add continuous request rotation test

Rebase: use context in List/Watch

Swap goroutine around

Retry GETs on net.IsProbableEOF

Refactor certRotatingDialer

For simplicity, don't affect cert callbacks

To reduce change surface, lets not try to handle the case of a changing
GetCert callback in this PR. Reverting this commit should be sufficient
to handle that case in a later PR.

This PR will focus only on rotating certificate and key files.
Therefore, we don't need to modify the exec auth plugin.

Fix copyright year

Kubernetes-commit: 929b1559a0b855d996257ab3ad5364605edc253d
2019-06-14 22:08:58 +01:00
Mike Danese
0caa50056a rest.Config: support configuring an explict proxy URL
With support of http, https, and socks5 proxy support. We already
support configuring this via environmnet variables, but this approach
becomes inconvenient dealing with multiple clusters on different
networks, that require different proxies to connect to. Most solutions
require wrapping clients (like kubectl) in bash scripts.

Part of: https://github.com/kubernetes/client-go/issues/351

Kubernetes-commit: f3f666d5f1f6f74a8c948a5c64af993696178244
2019-05-03 13:50:17 -07:00
danielqsj
51f3d77844 clean SinceInMicroseconds, convert to SinceInSeconds
Kubernetes-commit: ab182552b485ceed96c3b05d284ae9480377daf8
2019-04-15 16:18:01 +08:00
Clayton Coleman
4b146a95cd Remove deprecated-dynamic client
It is now unused.

Kubernetes-commit: c416ee584c178bb89c6cd11c93b504f2098fac0f
2019-02-12 00:31:54 -05:00
Kubernetes Publisher
3c0d1af94b Merge pull request #83840 from liggitt/json-iter
bump json-iterator dependency

Kubernetes-commit: 3387d6cfc73235fd554e5039b85abb7700eaf126
2019-11-09 10:22:09 +00:00
Kubernetes Publisher
f8f007fd45 Merge pull request #84911 from yue9944882/chore/bump-kube-openapi
Pin kube-openapi vendor to 30be4d16710a

Kubernetes-commit: dd6faa5da791c06fa23ff668e4463c3ad2b23340
2019-11-08 07:01:06 +00:00
Kubernetes Publisher
e55a71a3e0 Merge pull request #82705 from deads2k/agg-authn-publish
use controller to publish cluster authentication info

Kubernetes-commit: a5fe905be420d518892e8e8b682902deef82d1c6
2019-11-07 19:01:07 +00:00
yue9944882
656c97889d update k8s.io/kube-openapi to 30be4d16710a
Kubernetes-commit: 8e7606f32898b294fc25152ff8bd34f62d6221d3
2019-11-07 18:39:08 +08:00
Kubernetes Publisher
a537b3b527 Merge pull request #83520 from jpbetz/reflector-relist-rv
Avoid going back in time in Reflector relist (revived)

Kubernetes-commit: 8ed2f4775a0d2b13c4be790cdfc1f34bc8b6522b
2019-11-07 03:03:46 +00:00
Kubernetes Publisher
6f1579c35d Merge pull request #82809 from liggitt/go-1.13-no-modules
update to use go1.13.4

Kubernetes-commit: 695c3061dd92a6b6950f8adf0341ceb4a8dd44d7
2019-11-07 03:03:44 +00:00
Jordan Liggitt
d4d115c905 hack/update-vendor.sh
Kubernetes-commit: 297570e06a88db23e16dbdbf6ce3173fe0ae376c
2019-11-05 14:11:10 -05:00
Kubernetes Publisher
a57d0056db Merge pull request #84807 from clarklee92/ModifyTheStatusCode
Modify the status code number to HTTP status semantics

Kubernetes-commit: 43b102a83cc1d2b97a6a59f1c14967a840df2c35
2019-11-06 23:00:57 +00:00
Kubernetes Publisher
d7ea50d263 Merge pull request #84801 from mikedanese/lebug
Fix panic on configmap and lease lock implementations

Kubernetes-commit: 17d99dfbbee90b1889427874589423e4836d7108
2019-11-06 07:00:52 +00:00
Kubernetes Publisher
d063930b33 Merge pull request #84139 from sshukun/fix-typo
Fix typo in k8s.io/client-go/tools/cache/index.go

Kubernetes-commit: d297780ff6e95308bbf8b0db5ab415825014859f
2019-11-06 07:00:50 +00:00
clarklee92
d3a5e5f798 Modify the status code number to HTTP status semantics
Signed-off-by: clarklee92 <clarklee1992@hotmail.com>

Kubernetes-commit: f86f5ee14ef3c8adf9855ce16dcc57beca949719
2019-11-06 00:45:35 +08:00
Kubernetes Publisher
52092c3c67 Merge pull request #83474 from msau42/topology-ga
CSI Topology ga

Kubernetes-commit: 1d1385af915098abd8bd23ab397ee0aeaa244f1e
2019-11-05 03:03:21 +00:00
Kubernetes Publisher
a7c4a955b2 Merge pull request #84534 from sambdavidson/serverRotMetric
Add a kubelet serving cert age metric

Kubernetes-commit: 0ed66351739608660fef27de55d8e0dff6570f28
2019-11-04 19:01:07 +00:00
Mike Danese
d46fe40533 also fix nil panic in lease and add tests for #84729
Kubernetes-commit: 7907b29551c7ef87bbe398ac02836b4c87246d3d
2019-11-04 10:40:48 -08:00
Ted Yu
93a8bb4af0 Prevent panic due to Annotations being nil map
Kubernetes-commit: c5792784e1ae689cb4c949b9c556ee1e4896064a
2019-11-04 10:04:31 -08:00