Commit Graph

2760 Commits (331c52c0fd4890ce999bad29265600d16cbb7abd)

Author SHA1 Message Date
Kubernetes Submit Queue 331c52c0fd
Merge pull request #54861 from hzxuzhonghu/admission-webhook
Automatic merge from submit-queue (batch tested with PRs 53047, 54861, 55413, 55395, 55308). 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>.

cache admission webhook restClient

**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 #54860

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-10 07:00:40 -08:00
Kubernetes Submit Queue a43c6e41d5
Merge pull request #55291 from hzxuzhonghu/admission-initializer
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>.

remove redundant code in admission initializer

**What this PR does / why we need it**:
remove unused return error in `k8s.io\kubernetes\staging\src\k8s.io\apiserver\pkg\admission\initializer\initializer.go`

**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
```
2017-11-10 05:38:08 -08:00
Kubernetes Submit Queue d12d711ba6
Merge pull request #54849 from hzxuzhonghu/audit-graceful-shutdown
Automatic merge from submit-queue (batch tested with PRs 46581, 55426, 54849). 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 shutdown gracefully

**What this PR does / why we need it**:
apiserver shutdown gracefully and wait all non-long running requests finish before process exit.

**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 #54793

**Special notes for your reviewer**:
remove waitGroup, use atomic to count. 
**Release note**:

```release-note
NONE
```
2017-11-10 03:30:21 -08:00
Kubernetes Submit Queue 4e68d2511e
Merge pull request #55353 from david-mcmahon/eliminate-version-updates
Automatic merge from submit-queue (batch tested with PRs 55265, 54092, 55353, 53733, 55385). 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>.

Capture git export-subst strings in version.sh for 'git archive' use.

Eliminate the need to update pkg/version/base.go on release branch tagging.

This excellent solution brought to you by @ixdy.

 - [ ] Cherrypick to release-1.8
 - [ ] Cherrypick to release-1.7
 - [ ] Cherrypick to release-1.6?
 - [ ] Update kubernetes/release/anago to skip updating base.go files

ref https://github.com/kubernetes/release/pull/459
ref #16815 (somewhat related)
cc @javier-b-perez
2017-11-10 01:30:24 -08:00
hzxuzhonghu b845e26983 update bazel 2017-11-10 16:44:30 +08:00
hzxuzhonghu 42d9153a03 cache admission webhook restClient 2017-11-10 16:44:30 +08:00
hzxuzhonghu 3c44e2a616 update bazel and staging godep 2017-11-10 14:07:04 +08:00
hzxuzhonghu db4f0de280 gracefully shutdown apiserver after all non-long running requests finish 2017-11-10 14:06:52 +08:00
Kubernetes Submit Queue 61f210859d
Merge pull request #55282 from mbohlool/webhooks
Automatic merge from submit-queue (batch tested with PRs 55268, 55282, 55419, 48340, 54829). 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>.

 Add MutatingWebhookConfiguration type

As part of Mutating Webhook support, this PR adds the configuration for Mutating webhooks. It also renames existing ReadOnly webhook configurations from ExternalAdmissionHookConfiguration to ValidatingWebhookConfiguration. As part of the process some sub-types are also renamed.

Lastly, the mutating webhook configurations are sorted by name to make the serial executing of them deterministic.

ref: https://github.com/kubernetes/features/issues/492
2017-11-09 21:39:23 -08:00
David McMahon 9a9d11bb75 Capture git export-subst strings in version.sh for 'git archive' use.
Eliminate the need to update pkg/version/base.go on release branch tagging.
2017-11-09 16:36:27 -08:00
mbohlool 4568e0530c Update generated files for MutatingWebhookConfiguration 2017-11-09 15:33:50 -08:00
mbohlool fc5a613c17 Add MutatingWebhookConfiguration type 2017-11-09 14:00:14 -08:00
Anirudh 45ab57fddc Autogenerated 2017-11-09 12:48:23 -08:00
Anirudh 825821610c Added conditions to statefulset 2017-11-09 12:28:49 -08:00
mbohlool cb43840492 Update generated files 2017-11-09 11:39:52 -08:00
mbohlool 9ddea83a2c Rename ExternalAdmissionHookConfiguration to ValidatingWebhookConfiguration 2017-11-09 11:39:50 -08:00
Kubernetes Submit Queue e873b36a44
Merge pull request #55165 from deads2k/agg-01-resync
Automatic merge from submit-queue (batch tested with PRs 55403, 54660, 55165). 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>.

resync status on apiservices for aggregator

Adds a fairly tight (30 second) resync on the apiservices to force redetection of status.  The checks aren't very expensive and there are relatively few apiservices.  Taking a little resync pain here is cheaper than the fallout for all clients.
2017-11-09 10:15:17 -08:00
Kubernetes Submit Queue bab312dbcf
Merge pull request #54660 from munnerz/namespaced-informer-factory
Automatic merge from submit-queue (batch tested with PRs 55403, 54660, 55165). 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>.

code-generator: add NewFilteredSharedInformerFactory function

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

Adds a `namespace` option to the SharedInformerFactory constructor. This is useful when building controllers that may need to scope themselves to a namespace due to RBAC constraints.

Workarounds for this involve losing type safety if a user wants to use it for core APIs as well as a SharedInformerFactory type interface, as we have to deal with plain SharedIndexInformers (example here: https://github.com/jetstack-experimental/cert-manager/blob/master/pkg/util/kube/factory.go)

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

Fixes https://github.com/kubernetes/code-generator/issues/9

**Special notes for your reviewer**:

This will require updating all uses of SharedInformerFactory throughout the codebase. I'm going to follow up with later commits in this PR with these changes, but wanted to get this here to get some feedback on the way it's implemented.

**Release note**:

```release-note
NONE
```

/cc @sttts @nikhita @deads2k
2017-11-09 10:15:13 -08:00
Kubernetes Submit Queue 899f7ff97d
Merge pull request #55403 from sttts/sttts-client-gen-ext-group-list
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>.

code-generator: move kube group list out of client-gen

We had a hard-coded group list in the client-gen code for the internal Kubernetes api groups. For the external groups, we collected the actual GVs in update-codegen.sh. This PR does the latter for internal groups as well.
2017-11-09 09:42:51 -08:00
James Munnelly 9b1a1231da run hack/update-bazel.sh 2017-11-09 15:12:09 +00:00
James Munnelly 6a4b80fcab run hack/update-codegen.sh 2017-11-09 15:12:09 +00:00
James Munnelly e4d9f3bbb4 code-generator: add NewFilteredSharedInformerFactory function
Refactor to not change New*Informer constructors

Separate namespace and ListOptions filter
2017-11-09 15:09:58 +00:00
David Eads b7bc9b11dd resync status on apiservices for aggregator 2017-11-09 09:49:28 -05:00
Dr. Stefan Schimanski 12eb6a01eb code-generator: move kube group list out of client-gen 2017-11-09 15:06:43 +01:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski 7e62297b68 pkg/apis/core: fix code generation 2017-11-09 12:14:07 +01:00
Kubernetes Submit Queue ab44ec9d77
Merge pull request #54267 from ericchiang/audit-policy-file-without-kind-or-version
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>.

audit policy: reject audit policy files without apiVersion and kind

Closes https://github.com/kubernetes/kubernetes/issues/54254

/cc @sttts @CaoShuFeng @crassirostris @tallclair

/sig auth
/kind cleanup

```release-note
Audit policy files without apiVersion and kind are treated as invalid.
```
2017-11-08 22:56:34 -08:00
Kubernetes Submit Queue 0ff21718d1
Merge pull request #55356 from ericchiang/cert-manager-reduce-backoff
Automatic merge from submit-queue (batch tested with PRs 54773, 52523, 47497, 55356, 49429). 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>.

certificate manager: reduce max backoff from 128s to 32s

For TLS bootstrapping in bootkube we run a kubelet with a control plane run through static pods. That static control plane has an API server and controller manager that approve the kubelet's CSR.

Since the kubelet has to wait for the static control plane to come up to be approved, we hit this backoff every time and it actually adds a notable overhead to startup times.

https://github.com/kubernetes-incubator/bootkube/pull/663

If this choice is somewhat arbitrary, I'd like to see it lowered for 1.9.

/assign @jcbsmpsn @mikedanese 

```release-note
NONE
```
2017-11-08 22:11:57 -08:00
Kubernetes Submit Queue f34d3af809
Merge pull request #55242 from sttts/sttts-stop-cache-deadlock
Automatic merge from submit-queue (batch tested with PRs 55331, 55272, 55228, 49763, 55242). 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/tools/cache: fix possible deadlock when stopping a reflector

While getting Connection-Refused error, a reflector was retrying without stopping when the stopCh is closed.

The flaking TestCRD #54095 sometimes shows a deadlock in reflectors that should be shutdown, called from the storage cacher. So possibly this is related.
2017-11-08 17:13:31 -08:00
Kubernetes Submit Queue a701a42a82
Merge pull request #49763 from supereagle/versioned-group-clients
Automatic merge from submit-queue (batch tested with PRs 55331, 55272, 55228, 49763, 55242). 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>.

use versiond group clients from client-go

**What this PR does / why we need it**:
Some **Deprecated** group clients are still used, replace them with versioned group clients.

**Which issue this PR fixes**: fixes #49760

**Special notes for your reviewer**:
/assign @caesarxuchao

**Release note**:
```release-note
NONE
```
2017-11-08 17:13:27 -08:00
Kubernetes Submit Queue ee7f1b6e74
Merge pull request #55228 from sttts/sttts-validation-admission-tests
Automatic merge from submit-queue (batch tested with PRs 55331, 55272, 55228, 49763, 55242). 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: add validating admission tests

Follow-up of https://github.com/kubernetes/kubernetes/pull/54484

This includes tests
- in endpoint tests,
- in generic registry,
- in patch handler,
- in admission chain.
2017-11-08 17:13:24 -08:00
Kubernetes Submit Queue f644681a80
Merge pull request #55272 from janetkuo/ds-conditions
Automatic merge from submit-queue (batch tested with PRs 55331, 55272, 55228, 49763, 55242). 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>.

Add DaemonSet conditions

**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)*:
xref https://github.com/kubernetes/features/issues/353, #7856

**Special notes for your reviewer**: 
A `conditions` field is added to DaemonSetStatus for consistency. No valid DaemonSet condition type is supported yet. 
@kubernetes/sig-apps-api-reviews 

**Release note**:

```release-note
DaemonSet status now has a new field named "conditions", making it consistent with other workloads controllers.
```
2017-11-08 17:13:19 -08:00
Eric Chiang cba8939504 certificate manager: reduce max backoff from 128s to 32s 2017-11-08 16:24:01 -08:00
Kubernetes Submit Queue 255a1be780
Merge pull request #54780 from CaoShuFeng/patch-twice
Automatic merge from submit-queue (batch tested with PRs 54493, 52501, 55172, 54780, 54819). 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>.

partial fix crd patch failing

partial fix https://github.com/kubernetes/kubernetes/issues/53379

**Release note**:
```
NONE
```
2017-11-08 15:41:21 -08:00
Dr. Stefan Schimanski c558d2a351 apiserver: add validating admission tests
- in endpoint tests
- in generic registry
- in patch handler
- in admission chain
2017-11-08 20:45:40 +01:00
Dr. Stefan Schimanski 8d98c84627 reflector: exit retry loop on closed stopCh 2017-11-08 20:42:11 +01:00
Kubernetes Submit Queue 08781adf13
Merge pull request #54979 from smarterclayton/symlink
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>.

When cert dir is relative, cert rotation builds incorrect symlinks

Symlinks relative to a working directory were being constructed to the
wrong location, leading to failure to refresh client certs.

@liggitt
2017-11-07 22:35:54 -08:00
Janet Kuo b0c086eeb9 Autogen 2017-11-07 21:49:24 -08:00
Janet Kuo dc0167bd7f Add conditions to DaemonSet API 2017-11-07 21:49:24 -08:00
Kubernetes Submit Queue 84f2bf3a68
Merge pull request #54920 from tengqm/improve-cronjob-doc
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>.

Improve cronjob concurrency policy doc

**What this PR does / why we need it**:
The CronJob API documentation (https://kubernetes.io/docs/api-reference/v1.8/#cronjobspec-v1beta1-batch) did not clearly state what can be used as `concurrencyPolicy`. Instead, it only says that the default value is "Raw".

**Which issue(s) this PR fixes**:

**Special notes for your reviewer**:
This patch is not changing any code logic but it involves generated "code".

**Release note**:
```release-note
NONE
```
2017-11-07 21:34:11 -08:00
hzxuzhonghu 9d1e6d3e2c remove redundant code in admission initializer 2017-11-08 10:54:06 +08:00
Kubernetes Submit Queue 47d1973c18
Merge pull request #55175 from sttts/sttts-lock-registry-cleanup
Automatic merge from submit-queue (batch tested with PRs 53592, 52562, 55175, 55213). 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: protect registry cleanup against concurrent access

The mechanism uses global state during testing. Better protect it and fail early when a race is happening.

Related to https://github.com/kubernetes/kubernetes/issues/54095
2017-11-07 11:21:23 -08:00
Kubernetes Submit Queue d33077526a
Merge pull request #53273 from mikedanese/authtristate
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>.

add support for short-circuit deny in union authorizer

This change has no behavioral changes.

Fixes https://github.com/kubernetes/kubernetes/issues/51862

```release-note
Add support for the webhook authorizer to make a Deny decision that short-circuits the union authorizer and immediately returns Deny. 
```
2017-11-07 09:25:37 -08:00
Kubernetes Submit Queue eb578813cb
Merge pull request #55157 from sttts/sttts-etcd3-scheme
Automatic merge from submit-queue (batch tested with PRs 55061, 55157, 55231). 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: remove scheme arg from NewUnsecuredEtcd3TestClientServer

Not necessary anymore.
2017-11-07 06:03:16 -08:00
supereagle b694d51842 use versiond group clients from client-go 2017-11-07 14:47:22 +08:00
Kubernetes Submit Queue 5b7ce60fce
Merge pull request #54786 from shiywang/bump-protobuf
Automatic merge from submit-queue (batch tested with PRs 55093, 54966, 55047, 54971, 54786). 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>.

vendor update: github.com/golang/protobuf

When I'm working on PR: https://github.com/kubernetes/kubernetes/pull/54782, I met a problem here: https://github.com/golang/protobuf/issues/372, which I think we need to update our vendor of protobuf
and I ask Dr. Stefan for suggestion, here is our coversation


shiywang [5:09 PM] 
hi, Dr. Stefan i'm sorry to bother, I have a simple question, I was working on a pr which need to use protobuf custom field, and I run into this problem here: https://github.com/golang/protobuf/issues/372  which I think is due to our codebase's protobuf vendor is too old `vendor/github.com/golang/protobuf`,  do you think I can update that vendor to lastest one ?  also I noticed there's also an extend package called `vendor/github.com/gogo/protobuf/proto` what's the releationship between those two ?  which one should I update ?

sttts
[5:11 PM] 
hi

[5:11] 
don't know much about the proto internals either, @claytonc is probably the only one

[5:12] 
create a vendor/github.com/golang/protobuf bump PR and assign it to him

shiywang [5:12 PM] 
sounds good, thank you sir

so 
/assign @smarterclayton 
for suggestion, thanks

```release-note
NONE
```
2017-11-06 20:39:05 -08:00
Kubernetes Submit Queue b458838350
Merge pull request #54971 from itowlson/azure-sdk-v11.1.1
Automatic merge from submit-queue (batch tested with PRs 55093, 54966, 55047, 54971, 54786). 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>.

Upgrade Azure SDK to v11.1.1

**What this PR does / why we need it**: This fixes various Azure SDK bugs per the Azure SDK for Go changelogs:

* Fixed bug in which blob types were unmarshaled incorrectly
* Fixed various package names
* Miscellaneous unspecified storage bug fixes

This is also a prerequisite for a bug fix for running out of firewall rules when exposing large numbers of services from an Azure cluster.

**Which issue(s) this PR fixes**: None

**Special notes for your reviewer**:

1. I inadvertently committed a compatibility fix along with the dependency upgrade (which the guidelines say should have been two separate commits).  The offending file is `pkg/cloudprovider/providers/azure.go`.

2. We require an urgent bug fix for the firewall rules limit so it would be great if we could get this agreed quickly.  I have struggled with the dependency upgrade process a bit so if it looks wrong, please let me know as soon as you can!  Thanks!

**Release note**:

```release-note
Upgraded Azure SDK to v11.1.1.
```
2017-11-06 20:39:00 -08:00
Cao Shufeng 1e800350a2 partial fix crd patch failing
partial fixes https://github.com/kubernetes/kubernetes/issues/53379
2017-11-07 09:44:24 +08:00
Kubernetes Submit Queue 67c9e7419c
Merge pull request #54586 from DirectXMan12/bug/fix-incorrect-scale-and-hpa-gvks
Automatic merge from submit-queue (batch tested with PRs 53645, 54734, 54586, 55015, 54688). 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 Incorrect Scale Subresources and HPA e2e ScaleTargetRefs

The HPA e2es failed to actually set `apiVersion` on the created HPAs, which previous was ignored.  Since the polymorphic scale client was merged, this behavior is no longer tolerated (it was never correct to begin with, but it accidentally worked).

Additionally, the `apps` resources have their own version of scale.  Until `apps/v1beta1` and `apps/v1beta2` go away, we need to support those versions in the scale client.

Together, these broke some of the HPA e2es.

Fixes #54574

```release-note
NONE
```
2017-11-06 15:33:43 -08:00
Janet Kuo 948bd7bbc1 Add hook information when rejecting a request 2017-11-06 11:16:36 -08:00