Commit Graph

1172 Commits

Author SHA1 Message Date
Arjun Naik fa550e796d Adds tests
Signed-off-by: Arjun Naik <arjun@arjunnaik.in>

Kubernetes-commit: 8ab226263a18fa16afdb6fd14da63544095a8937
2019-12-10 18:09:08 +01:00
Kubernetes Publisher 846b394714 Merge pull request #85577 from mgugino-upstream-stage/unready-node-timeout
kubectl/drain: add option skip-wait-for-delete-timeout

Kubernetes-commit: 93eb2e38a7800087f0ab2ae058cccd4dcceae8f9
2019-12-10 00:46:32 +00:00
Haosdent Huang 08def252f7 fix static check in kubectl/pkg/cmd/annotate.
Kubernetes-commit: 303c1a40bcee81fe14845d2af9dae2073f86ec52
2019-12-08 23:25:50 +08:00
Kubernetes Publisher b909fcb4a0 Merge pull request #85709 from tanjunchen/correct-404-ruls
correct  invalid  urls

Kubernetes-commit: 117a3a7f2a4f0229516b18c47fbcbaa223211878
2019-12-06 20:48:26 +00:00
tanjunchen 94234261fb correct invalid urls
Kubernetes-commit: efd61ae3e4826125d65ef7824e3243e2480c7205
2019-12-06 23:31:41 +08:00
Kubernetes Publisher 24f2b8d929 Merge pull request #82660 from sallyom/list-pods-dry-run-drain
When running `kubectl drain` in dry-run, list warnings and pods that would be deleted.

Kubernetes-commit: 646afd52ff93b069401a61dc3b4b9ec37a1d936a
2019-12-06 05:03:57 +00:00
Kubernetes Publisher a08e9829ac Merge pull request #85863 from nan-yu/pdb_status_renaming
Rename PodDisruptionsAllowed to DisruptionsAllowed in type PodDisruptionBudgetStatus

Kubernetes-commit: b8ce44f00669f09b26c2122ae243d47460c757a6
2019-12-06 01:04:10 +00:00
Kubernetes Publisher ce1b5846dc Merge pull request #85571 from mgugino-upstream-stage/drain-ignore-pdbs
kubectl/drain: add disable-eviction option

Kubernetes-commit: b42f21982c965630f82f053425ba067d818203f5
2019-12-05 00:45:21 +00:00
Kubernetes Publisher a3a0d014e5 Merge pull request #85293 from huffmanca/include_fstype_csi
Included FSType in CSI volumes

Kubernetes-commit: 2b6857db4d4226cc07180308fe8a8507abbc7700
2019-12-04 09:45:27 +00:00
Kubernetes Publisher 03dd8a5df9 Merge pull request #85574 from mgugino-upstream-stage/kubectl-drain-ctx
kubectl/drain: Add context support

Kubernetes-commit: 3e7c787d3ae8d03de55c1c3e64fd1d41437c6bd4
2019-12-04 09:45:25 +00:00
Kubernetes Publisher 23432852b0 Merge pull request #85644 from liggitt/meta-v1-table
Switch TableGenerator/TableConvertor interfaces to metav1

Kubernetes-commit: 050c9471c86e0d455c0cf44add3af8c98ab4e8b5
2019-12-04 09:45:23 +00:00
Kubernetes Publisher ae86c4ed25 Merge pull request #85490 from sallyom/set-resources-no-error-no-change
don't error if set-resources patch is empty

Kubernetes-commit: 7c87b5fb55ca096c007c8739d4657a5a4e29fb09
2019-12-04 09:45:21 +00:00
Kubernetes Publisher 21ad77b94e Merge pull request #85595 from zhouya0/add_test_coverage_with_kubectl_get_components
add test coverage with kubectl get components

Kubernetes-commit: ab0bfb304caa3f67d5c207c2356557cda90936b9
2019-12-04 09:45:19 +00:00
Nan Yu 656f993514 Rename PodDisruptionsAllowed to DisruptionsAllowed in type PodDisruptionBudgetStatus
Kubernetes-commit: 1fb0dd4ec5134014e466509163152112626d52c3
2019-12-03 11:22:23 -08:00
Jordan Liggitt 1d31df4756 fixup kubectl test
Kubernetes-commit: deb75da17bb1fa95e5b56fb1207ba247cd9953dd
2019-11-26 13:13:38 -05:00
Jordan Liggitt 74e4737411 Switch TableGenerator/TableConvertor interfaces to metav1
Kubernetes-commit: 36eb250cbb441984260ded6f7abeb796974031c3
2019-11-26 13:13:25 -05:00
Kubernetes Publisher c273777957 Merge pull request #85496 from tanjunchen/fix-invalid-urls
fix 1-12 number urls

Kubernetes-commit: a3a2c4230d8cea0d192fb15835c47da3604bd95e
2019-11-26 02:26:06 +00:00
Kubernetes Publisher d134c5a987 Merge pull request #85556 from wojtek-t/fix_kubectl_conversions
Cleanup conversions in kubectl

Kubernetes-commit: c3184828cbc87b8fbac4c8ee2d6a5cafbe315137
2019-11-25 18:41:53 +00:00
zhouya0 6d82c82d12 add test coverage with kubectl get components
Kubernetes-commit: 07806d4300c5f410194c0dcd2da86c40bef42e1b
2019-11-25 17:57:56 +08:00
Michael Gugino ebda9f6262 kubectl/drain: add option skip-wait-for-delete-timeout
Currently, some circumstances may cause waitForDelete to
never succeed after the pod has been marked for deletion.
In particular, Nodes that are unresponsive and have
pods with local-storage will not be able to
successfully drain.

We should allow drain to ignore pods that have a
DeletionTimestamp older than a user-provided age.
This will allow controllers utilizing kubectl/drain
to optionally account for a pod that cannot be
removed due to a misbehaving node.

Kubernetes-commit: da53044abdf8c8a9771a5c3dfd861f0c4ec78c40
2019-11-23 20:00:06 -05:00
Michael Gugino fe592e7f80 kubectl/drain: Add context support
This commits allows specifying a context.Context
in the Helper type. This context is utilized to
cancel waitForDelete.

Kubernetes-commit: 8682e902f5487e04b893da7230125db0d7ae66b4
2019-11-23 13:58:59 -05:00
Michael Gugino feccbe3c28 kubectl/drain: add disable-eviction option
Currently, if eviction is supported during a drain operation,
eviction is always used.

This commit allows the user to specify disabling eviction.
This is particularly useful when you wish to ignore
PodDisruptionBudgets after a normal drain has failed for
some time.

Kubernetes-commit: 6c1d587d5142b95e6c169a198a086332a7e4d8ad
2019-11-23 11:18:52 -05:00
Naoki Oketani fe07b19cb4 Fix a bug in port-forward: named port not working with service
Kubernetes-commit: 73c1ab71e27eee0066ba637575e60093952f3ff1
2019-11-22 02:59:26 +09:00
tanjunchen 59fe764179 fix 1-12 number urls
Kubernetes-commit: 8f4a262d618ff5457268d7494e3720ee37b524b0
2019-11-21 11:17:46 +08:00
Kubernetes Publisher c390dc2e34 Merge pull request #85223 from sttts/sttts-crd-items-types
apiextensions: fix items+type logic in API due to broken go-openapi validation

Kubernetes-commit: 976712556e4bd22d5312a0af36b18127c709d54a
2019-11-21 02:31:11 +00:00
Sally O'Malley de3d4fcc02 don't error if set-resources patch is empty
Kubernetes-commit: ecd1c0747272ab908daa64b0f4b2b18a8cb18362
2019-11-20 19:22:18 -05:00
zhouya0 0833d7cba2 kubectl change podSecurityPolicy group
Kubernetes-commit: 7947b6ce6d8a498000d81b68fa674f88b1d7680a
2019-11-18 15:00:33 +08:00
Wojciech Tyczynski 24d21a0ee4 Fix kubectl conversions
Kubernetes-commit: bfa4188123ed334d4f5dda3a79994cadf663d8f2
2019-11-17 18:35:55 +01:00
Dr. Stefan Schimanski f605806477 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 fbc5d36fee Merge pull request #85305 from codenrhoden/remove-mount-pkg
Remove pkg/util/mount (moved out of tree)

Kubernetes-commit: 45e0080fd5883e3355233c9c22fa5bf242d525dd
2019-11-15 22:28:26 +00:00
Travis Rhoden 5790b8d2d7 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
Kubernetes Publisher 14ad457328 Merge pull request #84424 from mikedanese/expcache
Add an expiring cache for the caching token authenticator

Kubernetes-commit: 19b4017b5d5c5695403a9804f5ea3de11a436c04
2019-11-15 02:26:11 +00:00
Kubernetes Publisher 586878aa9d Merge pull request #85285 from liggitt/kubectl-resource-version
Fix --resource-version handling in kubectl

Kubernetes-commit: 141329fd2157a0791b93fae0160ce24d99808607
2019-11-15 02:26:09 +00:00
Kubernetes Publisher 0f4ee8ce68 Merge pull request #85175 from liggitt/golang-org-comments
Add comments to explain golang.org replace directives

Kubernetes-commit: 24334444b46371e26594e1f6e594195a761b53d3
2019-11-14 22:52:35 +00:00
Kubernetes Publisher edc096cc0a Merge pull request #84227 from soltysh/fix_scale_doc
Drop job from scale description

Kubernetes-commit: 37c7c904e1f3730c8a1dc37c5428132a6af3a6f7
2019-11-14 22:52:33 +00:00
Christian Huffman fc490f462d Included FSType in CSI volumes
Kubernetes-commit: bbae978d4a0885a6135afb713e252ec4fa41a277
2019-11-14 11:18:40 -05:00
Jordan Liggitt 25e7825a5b Fix --resource-version handling in kubectl
Kubernetes-commit: 0ac8345d3a4c5ee38fd3fc2c40976ba876d815e7
2019-11-14 09:24:42 -05:00
Kubernetes Publisher c85971996e Merge pull request #84390 from robscott/endpointslice-beta
Promoting EndpointSlices to beta

Kubernetes-commit: 64f4be5b328a4df8a709b95604743086013a70e4
2019-11-14 11:33:28 +00:00
Jordan Liggitt 163af6a908 Add comments to explain golang.org replace directives
Kubernetes-commit: 9f40e19d7ac9e2203c23814701468a26eee1964f
2019-11-12 23:54:26 -05:00
Mike Danese f2f06b692c Add an expiring cache for the caching token authenticator
And maybe the webhook authorizer cache.

This cache has two primary advantages over the LRU cache used currently:

- Cache hits don't acquire an exclusive lock.
- More importantly, performance doesn't fallover when the access pattern
  scans a key space larger than an arbitrary size (e.g. the LRU
  capacity).

The downside of using an expiring cache here is that it doesn't have a
maximum size so it's suspectible to DoS when the input is user
controlled. This is not the case for successful authentications, and
successful authentications have a natural expiry so it might be a good
fit here.

It has some a few differences compared to:

3d7318f29d/staging/src/k8s.io/client-go/tools/cache/expiration_cache.go

- Expiration is not entirely lazy so keys that are never accessed again
  are still released from the cache.
- It does not acquire an exclusive lock on cache hits.
- It supports per entry ttls specified on Set.

The expiring cache (without striping) does somewhere in between the
simple cache and striped cache in the very contrived contention test
where every iteration acquires a write lock:

```
$ benchstat simple.log expiring.log
name      old time/op    new time/op    delta
Cache-12    2.74µs ± 2%    2.02µs ± 3%  -26.37%  (p=0.000 n=9+9)
name      old alloc/op   new alloc/op   delta
Cache-12      182B ± 0%      107B ± 4%  -41.21%  (p=0.000 n=8+9)
name      old allocs/op  new allocs/op  delta
Cache-12      5.00 ± 0%      2.00 ± 0%  -60.00%  (p=0.000 n=10+10)

$ benchstat striped.log expiring.log
name      old time/op    new time/op    delta
Cache-12    1.58µs ± 5%    2.02µs ± 3%  +27.34%  (p=0.000 n=10+9)
name      old alloc/op   new alloc/op   delta
Cache-12      288B ± 0%      107B ± 4%  -62.85%  (p=0.000 n=10+9)
name      old allocs/op  new allocs/op  delta
Cache-12      9.00 ± 0%      2.00 ± 0%  -77.78%  (p=0.000 n=10+10)

$ benchstat simple.log striped.log expiring.log
name \ time/op    simple.log   striped.log  expiring.log
Cache-12          2.74µs ± 2%  1.58µs ± 5%   2.02µs ± 3%
name \ alloc/op   simple.log   striped.log  expiring.log
Cache-12            182B ± 0%    288B ± 0%     107B ± 4%
name \ allocs/op  simple.log   striped.log  expiring.log
Cache-12            5.00 ± 0%    9.00 ± 0%     2.00 ± 0%
```

I also naively replacemed the LRU cache with the expiring cache in the
more realisitc CachedTokenAuthenticator benchmarks:

https://gist.github.com/mikedanese/41192b6eb62106c0758a4f4885bdad53

For token counts that fit in the LRU, expiring cache does better because
it does not require acquiring an exclusive lock for cache hits.

For token counts that exceed the size of the LRU, the LRU has a massive
performance drop off. The LRU cache is around 5x slower (with lookups
taking 1 milisecond and throttled to max 40 lookups in flight).

```
$ benchstat before.log after.log
name                                                  old time/op    new time/op    delta
CachedTokenAuthenticator/tokens=100_threads=256-12      3.60µs ±22%    1.08µs ± 4%  -69.91%  (p=0.000 n=10+10)
CachedTokenAuthenticator/tokens=500_threads=256-12      3.94µs ±19%    1.20µs ± 3%  -69.57%  (p=0.000 n=10+10)
CachedTokenAuthenticator/tokens=2500_threads=256-12     3.07µs ± 6%    1.17µs ± 1%  -61.87%  (p=0.000 n=9+10)
CachedTokenAuthenticator/tokens=12500_threads=256-12    3.16µs ±17%    1.38µs ± 1%  -56.23%  (p=0.000 n=10+10)
CachedTokenAuthenticator/tokens=62500_threads=256-12    15.0µs ± 1%     2.9µs ± 3%  -80.71%  (p=0.000 n=10+10)

name                                                  old alloc/op   new alloc/op   delta
CachedTokenAuthenticator/tokens=100_threads=256-12        337B ± 1%      300B ± 0%  -11.06%  (p=0.000 n=10+8)
CachedTokenAuthenticator/tokens=500_threads=256-12        307B ± 1%      304B ± 0%   -0.96%  (p=0.000 n=9+10)
CachedTokenAuthenticator/tokens=2500_threads=256-12       337B ± 1%      304B ± 0%   -9.79%  (p=0.000 n=10+10)
CachedTokenAuthenticator/tokens=12500_threads=256-12      343B ± 1%      276B ± 0%  -19.58%  (p=0.000 n=10+10)
CachedTokenAuthenticator/tokens=62500_threads=256-12      493B ± 0%      334B ± 0%  -32.12%  (p=0.000 n=10+10)

name                                                  old allocs/op  new allocs/op  delta
CachedTokenAuthenticator/tokens=100_threads=256-12        13.0 ± 0%      11.0 ± 0%  -15.38%  (p=0.000 n=10+10)
CachedTokenAuthenticator/tokens=500_threads=256-12        12.0 ± 0%      11.0 ± 0%   -8.33%  (p=0.000 n=10+10)
CachedTokenAuthenticator/tokens=2500_threads=256-12       13.0 ± 0%      11.0 ± 0%  -15.38%  (p=0.000 n=10+10)
CachedTokenAuthenticator/tokens=12500_threads=256-12      13.0 ± 0%      10.0 ± 0%  -23.08%  (p=0.000 n=9+10)
CachedTokenAuthenticator/tokens=62500_threads=256-12      17.0 ± 0%      12.0 ± 0%  -29.41%  (p=0.000 n=10+10)
```

Benchmarked with changes in #84423

Bugs: #83259 #83375

Kubernetes-commit: 9167711fd18511ffc9c90ee306c462be9fc7999b
2019-10-26 12:19:07 -07:00
Rob Scott 56eaaf1668 Promoting EndpointSlices to beta
Kubernetes-commit: a7e589a8c689d1a6c0c21d47c5e6c97267822875
2019-10-25 14:59:10 -07:00
Kubernetes Publisher b031036a44 Merge pull request #84971 from robscott/endpointslice-iptypes
Splitting IP address type into IPv4 and IPv6 for EndpointSlices

Kubernetes-commit: c5609071d805036b251f22ce122bbf13ca94bff7
2019-11-14 11:33:26 +00:00
Kubernetes Publisher 9aa870a398 Merge pull request #84194 from jackkleeman/describe-netpol
Fix incorrect message on describe netpol

Kubernetes-commit: b9030ff666772b76c6bb96c147a52341a9be94b9
2019-11-14 11:33:24 +00:00
Kubernetes Publisher 62986ac78f Merge pull request #85135 from wojtek-t/delete_unnecessary_conversions_1
Eliminate couple unnecessary conversions

Kubernetes-commit: 402e551ca27499a9dc211dd6e4eca21d9aa9d089
2019-11-14 11:33:22 +00:00
wojtekt 7f6186e3c1 Eliminate couple unnecessary conversions
Kubernetes-commit: 067d173266303c5c9a4281e962d3662c34a78053
2019-11-12 14:19:14 +01:00
Kubernetes Publisher 169c48cabb Merge pull request #85035 from gongguan/fix_diff_panic
fix kubectl diff panic

Kubernetes-commit: f610133f69f2d858a54361ab77f54eb74e145e70
2019-11-11 22:34:30 +00:00
Kubernetes Publisher afc56dffd2 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:53:37 +00:00
louisgong ae926dc56e fix kubectl diff panic
Kubernetes-commit: 4f13f2739a3a33c7ed4b86b98054972c0fde4579
2019-11-09 20:34:51 +08:00
Rob Scott 4118a67aeb Splitting IP address type into IPv4 and IPv6 for EndpointSlices
Kubernetes-commit: 0fa9981e0106d7f0d6f9c88fc49d4cdf779c95c1
2019-11-06 22:46:04 -08:00
Clayton Coleman 4ca8f5ecfe test: kubectl unit tests should be using codecs without conversion
Tests are also refactored to use the simpler RESTClient code path.

Kubernetes-commit: 8a9b8c87c40ee65751828d9dd02f4f642588f0ce
2019-11-03 15:20:10 -05:00