Commit Graph

3565 Commits (b0dd166fa300e5e2181b344d150b7706abb932aa)

Author SHA1 Message Date
Kubernetes Submit Queue 0254399884
Merge pull request #61105 from lcfang/test0313-2
Automatic merge from submit-queue (batch tested with PRs 57871, 61094, 60459, 61089, 61105). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove the outdated TODO

**What this PR does / why we need it**:

remove the outdated TODO in [a7d6340ad2/staging/src/k8s.io/apiserver/pkg/registry/rest/meta.go (L42))

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-20 23:34:42 -07:00
Kubernetes Submit Queue ad432fa6bd
Merge pull request #60971 from CaoShuFeng/audit_throttle_burst
Automatic merge from submit-queue (batch tested with PRs 60919, 60953, 61085, 61083, 60971). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[advanced audit]fix comment about throttle burst

/assign @sttts

**Release note**:
```release-note
NONE
```
2018-03-20 20:34:38 -07:00
Kubernetes Submit Queue 32d6a9356d
Merge pull request #61083 from hzxuzhonghu/bug-fix-0313
Automatic merge from submit-queue (batch tested with PRs 60919, 60953, 61085, 61083, 60971). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix bug in apiserver.k8s.io RootScopedKinds

RootScopedKinds in group ` apiserver.k8s.io` should be `AdmissionConfiguration`

**Release note**:

```release-note
NONE
```
2018-03-20 20:34:35 -07:00
Kubernetes Submit Queue 4c8657c087
Merge pull request #61003 from CaoShuFeng/amdission_controller_glog_v2
Automatic merge from submit-queue (batch tested with PRs 61003, 61031, 60360, 58349, 60922). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

log enabled admission controller in order

This change log enabled mutating and validating admission controller
in order.

ref: https://github.com/kubernetes/kubernetes/pull/60838/files#r173295334



**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-20 18:34:26 -07:00
Kubernetes Submit Queue 691a7d4358
Merge pull request #60759 from hzxuzhonghu/etcd-flag-validate
Automatic merge from submit-queue (batch tested with PRs 60759, 60531, 60923, 60851, 58717). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

validate EtcdOptions.EtcdServersOverrides in EtcdOptions.Validate

move `EtcdOptions.EtcdServersOverrides` validation from `BuildStorageFactory` to `EtcdOptions.Validate`, which fails fast in kube-apiserver startup.

**Release note**:

```release-note
NONE
```
2018-03-20 15:34:27 -07:00
Kubernetes Submit Queue de1a0e3249
Merge pull request #60925 from aleksandra-malinowska/debug-curl-fix
Automatic merge from submit-queue (batch tested with PRs 60696, 60876, 60901, 60925, 60428). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve debug curl command

When logging debug curl command, add single quotes around URL and headers. This prevents quietly removing any parameters after '&' when running resulting command and improves formatting.

```release-note
NONE
```
2018-03-20 13:36:21 -07:00
Kubernetes Submit Queue 7543ddde4c
Merge pull request #60901 from ixdy/client-go-bazel
Automatic merge from submit-queue (batch tested with PRs 60696, 60876, 60901, 60925, 60428). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

client-go/util/cert go_library shouldn't depend on testdata

**What this PR does / why we need it**: 981dd8dc66 (diff-eb996d3ca3a215d7d93faaaffb77dbd7) accidentally added a testdata dependency on the go_library rule, rather than the go_test. This breaks vendoring of this rule into other bazel projects that prune out tests and testdata.

Only the unit test depends on testdata, so the BUILD file should reflect that, too.

x-ref https://github.com/kubernetes/test-infra/pull/6835#discussion_r173010769

**Release note**:

```release-note
NONE
```

cc @BenTheElder @krzyzacy
2018-03-20 13:36:18 -07:00
Kubernetes Submit Queue f44f7dffa2
Merge pull request #60696 from wrfly/patch-1
Automatic merge from submit-queue (batch tested with PRs 60696, 60876, 60901, 60925, 60428). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix non-nil ptr in struct convert

**What this PR does / why we need it**:
Fix an issue.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #35335

**Special notes for your reviewer**:
Thanks for other contributer's debug.

**Release note**:

```release-note
NONE
```
2018-03-20 13:36:10 -07:00
Kubernetes Submit Queue e6ba628b07
Merge pull request #60855 from cheftako/local-up
Automatic merge from submit-queue (batch tested with PRs 60710, 60855, 60873, 60895, 60862). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix local cluster leaking memory.

**What this PR does / why we need it**:
Local cluster is leaking memory due to mutation detector being enabled.
In addition there is no warning in the logs that this could be the
issue.
Added a log warning when this feature is enabled to make debugging this
issue easier for other cases of this.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #60854 

**Special notes for your reviewer**:

**Release note**:
```release-note
None
```
2018-03-20 10:34:37 -07:00
Kubernetes Submit Queue e2f6bd672d
Merge pull request #60489 from yue9944882/remove-redundant-fake-discovery
Automatic merge from submit-queue (batch tested with PRs 59637, 60611, 60788, 60489, 60687). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove redundant fake discovery code

**Special notes for your reviewer**:
This PR removes fake discovery from `testing` package.
It is already moved to:
[9c57bf74b3/staging/src/k8s.io/client-go/discovery/fake/discovery.go (L34))


**Release note**:

```release-note

```
2018-03-20 04:34:43 -07:00
Kubernetes Submit Queue 18d9e1c450
Merge pull request #60702 from hzxuzhonghu/kube-apiserver-cleanup
Automatic merge from submit-queue (batch tested with PRs 60363, 59208, 59465, 60581, 60702). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver clean code

**What this PR does / why we need it**:

1. clean up some redundant code in kube-apiserver startup

1. comment on `preparedGenericAPIServer`, which is just a wrapper of `GenericAPIServer`.



**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-20 02:37:26 -07:00
Kubernetes Submit Queue 5be9578e34
Merge pull request #58731 from yue9944882/feature/beginport-and-offset-expr-port-range
Automatic merge from submit-queue (batch tested with PRs 60457, 60331, 54970, 58731, 60562). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

implement begin-port+offset port range parsing

**What this PR does / why we need it**:

Allocate specific numbers of port from a host by indicating a begin port and its offsets.
This can be used for kube-proxy configuration.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #58730

**Special notes for your reviewer**:

**Release note**:

```release-note
"beginPort+offset" format support for port range which affects kube-proxy only
```
2018-03-19 23:42:18 -07:00
Kubernetes Submit Queue c64f19dd1b
Merge pull request #59728 from wgliang/master.append
Automatic merge from submit-queue (batch tested with PRs 59740, 59728, 60080, 60086, 58714). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

more concise to merge the slice

**What this PR does / why we need it**:
more concise to merge the slice

**Special notes for your reviewer**:
2018-03-19 21:34:30 -07:00
Kubernetes Submit Queue eefd72557e
Merge pull request #53880 from wackxu/kubeconfig
Automatic merge from submit-queue (batch tested with PRs 51423, 53880). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

prevent the same path load multiple times

**What this PR does / why we need it**:

prevent the same path load multiple times,if there are several same path, we only load one time

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #53723

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-19 19:35:26 -07:00
Kubernetes Submit Queue c13d9ffea9
Merge pull request #60739 from tallclair/audit-buffer
Automatic merge from submit-queue (batch tested with PRs 60737, 60739, 61080, 60968, 60951). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix default auditing options.

- Log backend defaults to blocking mode (backwards compatability)
- Webhook backend defaults to throttled
- Fix webhook validation
- Add options test

**Which issue(s) this PR fixes**:
Fixes #60719

**Special notes for your reviewer**:
This PR is an alternative fix to https://github.com/kubernetes/kubernetes/pull/60727. If the rollback goes in first, I'll rebase this on a roll-forward.

**Release note**:
-->
```release-note
NONE
```
2018-03-13 12:26:57 -07:00
Kubernetes Submit Queue b651ed5ea7
Merge pull request #60998 from jpbetz/etcd-3.1.12
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump to etcd 3.1.12 to pick up critical fix

etcd [3.1.12](https://github.com/coreos/etcd/releases/tag/v3.1.12) (as well as 3.2.17 and 3.3.2) was released yesterday to fix a bug critical to kubernetes:

Fix [mvcc "unsynced" watcher restore operation](https://github.com/coreos/etcd/pull/9297).
- "unsynced" watcher is watcher that needs to be in sync with events that have happened.
- That is, "unsynced" watcher is the slow watcher that was requested on old revision.
- "unsynced" watcher restore operation was not correctly populating its underlying watcher group.
- Which possibly causes [missing events from "unsynced" watchers](https://github.com/coreos/etcd/issues/9086).

This will be backported to 1.9 as well.

Release note:
```release-note
Upgrade the default etcd server version to 3.1.12 to pick up critical etcd "mvcc "unsynced" watcher restore operation" fix.
```

cc @gyuho @wojtek-t @shyamjvs @timothysc @jdumars
2018-03-13 09:11:10 -07:00
Kubernetes Submit Queue 25c8871bd0
Merge pull request #61004 from CaoShuFeng/audit_webhook_initialBackoff
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix option --audit-webhook-initial-backoff

Before this change, --audit-webhook-initial-backoff has no effect

@crassirostris @sttts 



**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-13 08:07:14 -07:00
lcfang 9be76ec461 remove the outdated TODO 2018-03-13 20:31:01 +08:00
hzxuzhonghu f66c9b388f fix bug in apiserver.k8s.io install 2018-03-13 14:47:05 +08:00
Kubernetes Submit Queue fd3cbc9bbf
Merge pull request #60995 from caesarxuchao/webhook-serializer
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Let webhook controller uses a local scheme that understand admissionReview

An alternative to #60965.
Fix #60963.
Fix kubernetes/sample-apiserver#21.

Created a scheme that only understands admission/v1beta1 and use it to
encode/decode admissionReviews.

cc @sttts
2018-03-12 07:02:27 -07:00
Cao Shufeng 5bc5cd1b2c fix option --audit-webhook-initial-backoff
Before this change, --audit-webhook-initial-backoff has no effect
2018-03-10 17:50:57 +08:00
Cao Shufeng 76aaba6d24 log enabled admission controller in order
This change log enabled mutating and validating admission controller
in order.
2018-03-10 16:20:12 +08:00
Joe Betz e2a25f9b54 Bump to etcd 3.1.12 to pick up critical fix 2018-03-09 14:28:23 -08:00
Chao Xu 3ab516035d Make admission webhooks work in custom apiservers.
Created a scheme that only understands admission/v1beta1 and use it to
encode/decode admissionReviews.

Also made the NegotiationSerializer setup static
2018-03-09 13:54:27 -08:00
Cao Shufeng c6f72c20d1 [advanced audit]fix comment about throttle burst 2018-03-09 22:31:02 +08:00
yue9944882 68ad76bf53 move enum into function local 2018-03-09 14:20:58 +08:00
Kubernetes Submit Queue 71b40cbce5
Merge pull request #60943 from jennybuckley/webhook-https-url
Automatic merge from submit-queue (batch tested with PRs 60906, 60943). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make admission webhooks honor scheme part of url

**What this PR does / why we need it**:
Bug fix, allow webhooks to use the scheme provided in clientConfig, instead of defaulting to http.
(more in issue)

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #60942

```release-note
Bug fix, allow webhooks to use the scheme provided in clientConfig, instead of defaulting to http.
```

/kind bug
/sig api-machinery
2018-03-08 15:18:46 -08:00
Kubernetes Submit Queue 56195fd1d3
Merge pull request #60891 from shyamjvs/go-back-to-etcd-3.1.10
Automatic merge from submit-queue (batch tested with PRs 60891, 60935). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Rollback etcd server version to 3.1.11 due to #60589

Ref https://github.com/kubernetes/kubernetes/issues/60589#issuecomment-371171837

The dependencies were a bit complex (so many things relying on it) + the version was updated to 3.2.16 on top of the original bump.
So I had to mostly make manual reverting changes on a case-by-case basis - so likely to have errors :)

/cc @wojtek-t @jpbetz 

```release-note
Downgrade default etcd server version to 3.1.11 due to #60589
```

(I'm not sure if we should instead remove release-notes of the original PRs)
2018-03-08 12:45:46 -08:00
jennybuckley 7d5696eb6d Make admission webhooks not ignore scheme 2018-03-08 11:35:13 -08:00
Tim Allclair e004257919 Fix default auditing options.
- Log backend defaults to blocking mode (backwards compatability)
- Fix webhook validation
- Add options test
2018-03-08 11:03:44 -08:00
Aleksandra Malinowska 42f756aeb0 Improve debug curl command 2018-03-08 13:56:44 +01:00
Shyam Jeedigunta 21f5e69f08 Rollback etcd server version to 3.1.11 due to #60589 2018-03-08 13:07:15 +01:00
Kubernetes Submit Queue a0844c17bf
Merge pull request #60682 from hanxiaoshuai/update0302
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update Mount propagation version in comment

**What this PR does / why we need it**:
Mount propagation feature was moved to beta in PR [#59252](https://github.com/kubernetes/kubernetes/pull/59252), so update the comment.
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #60657 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-07 17:20:04 -08:00
Jeff Grafton 4c60b776fc client-go/util/cert go_library shouldn't depend on testdata 2018-03-07 14:48:53 -08:00
Kubernetes Submit Queue bad8e0d91c
Merge pull request #60838 from CaoShuFeng/amdission_controller_glog
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

log enabled admission controller in order

After switching to --enable-admission-plugins/--disable-admission-plugins, some admission controller may start silently. And these admission controllers may modify or forbid objects. This pull request does a lot of help for admin to trouble shooting.

/assign @hzxuzhonghu @sttts 

**Release note**:
```release-note
NONE
```
2018-03-07 11:21:13 -08:00
Cao Shufeng 4c6db2516a log enabled admission controller in order 2018-03-07 10:18:11 +08:00
Kubernetes Submit Queue f196b7c752
Merge pull request #60805 from ericchiang/oidc-owners
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

oidc: add rithujohn191 as a reviewer

cc @rithujohn191

/sig auth
/kind documentation

```release-note
NONE
```
2018-03-06 16:04:42 -08:00
Walter Fender 07ba609b50 Fix local cluster leaking memory.
Local cluster is leaking memory due to mutation detector being enabled.
In addition there is no warning in the logs that this could be the
issue.
Added a log warning when this feature is enabled to make debugging this
issue easier for other cases of this.
Fixed import ordering as per @liggitt
2018-03-06 13:44:11 -08:00
Kubernetes Submit Queue 9aae9b58a5
Merge pull request #59836 from jpbetz/etcd-3.2.16-patch-upgrade
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump etcd server patch version to 3.2.16

etcd 3.2.16 contains a critical fix for HA clusters: https://github.com/coreos/etcd/pull/9281

Also, update newly added tests to use `REGISTRY` make variable.

Release note:
```release-note
Upgrade the default etcd server version to 3.2.16
```
2018-03-06 10:00:53 -08:00
hzxuzhonghu f380ac8cec move EtcdServersOverrides to EtcdOptions flags validate 2018-03-06 18:38:18 +08:00
Kubernetes Submit Queue 04634cb198
Merge pull request #60454 from erictune/update-sample-apiserver-readme
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update README.md of sample-apiserver.

Mention CRDs as option.
Link to CRD vs Aggr. docs.
Mention apiserver-builder as alternative.

```release-note
NONE
```
2018-03-06 00:09:59 -08:00
Kubernetes Submit Queue 5066a67caa
Merge pull request #59840 from jennybuckley/webhooks-on-webhooks
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Prevent webhooks from affecting admission requests for WebhookConfiguration objects

**What this PR does / why we need it**:
As it stands now webhooks can be added to the system which make it impossible for a user to remove that webhook, or two webhooks could be registered which make it impossible to remove each other.

The first commit of this will add a test to make sure webhook deletion is never blocked by a webhook. This test will fail until the second commit is added which will prevent webhooks from affecting admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects in the admissionregistration.k8s.io group

- [x] Test that webhook deletion is never blocked by a webhook ([test fails before second commit](https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/59840/pull-kubernetes-e2e-gce/23731/))
- [x] Prevent webhooks from being called on admission requests for [Validating|Mutating]WebhookConfiguration objects
- [x] Document this new behavior maybe in another PR

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Part of fixing #59124 (Verifies that it can remove the broken webhook.)

**Release note**:
```release-note
ValidatingWebhooks and MutatingWebhooks will not be called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects in the admissionregistration.k8s.io group
```
2018-03-05 19:09:33 -08:00
hzxuzhonghu 0feecc376c apiserver clean code 2018-03-06 10:31:50 +08:00
jennybuckley b4abf56312 Run hack/update-all.sh 2018-03-05 16:36:11 -08:00
jennybuckley 58b43ad27d Prevent webhooks from affecting admission requests for webhooks 2018-03-05 16:35:52 -08:00
Joe Betz 04c6d0ab26 Bump etcd server patch version to 3.2.16 2018-03-05 13:58:51 -08:00
Eric Chiang 3561f23128
oidc: add rithujohn191 as a reviewer 2018-03-05 10:44:33 -08:00
Aleksandra Malinowska 09606310ac Fix initializing watch cache 2018-03-05 15:28:14 +01:00
wrfly 03792059cb fix non-nil ptr struct convert
Signed-off-by: wrfly <mr.wrfly@gmail.com>
2018-03-03 15:01:02 +08:00
Eric Tune af4aec6976 Update README.md of sample-apiserver.
Mention CRDs as option.
Link to CRD vs Aggr. docs.
Mention apiserver-builder as alternative.
2018-03-02 16:56:29 -08:00