Commit Graph

1784 Commits (241f30b96931468488139f3c8b27faaa28d71513)

Author SHA1 Message Date
Kubernetes Submit Queue 093883433b Merge pull request #49656 from deads2k/server-36-admit-error
Automatic merge from submit-queue (batch tested with PRs 49237, 49656, 49980, 49841, 49899)

make admission tolerate object without objectmeta for errors

Not all object have ObjectMeta (see SARs for instance).  Admission should tolerate this condition without giving meaningless errors.

@derekwaynecarr ptal
@php-coder fyi
2017-08-02 19:11:11 -07:00
Kubernetes Submit Queue 22af024093 Merge pull request #49412 from bjhaid/etcd_healthz_endpoint
Automatic merge from submit-queue (batch tested with PRs 49989, 49806, 49649, 49412, 49512)

This adds an etcd health check endpoint to kube-apiserver

addressing https://github.com/kubernetes/kubernetes/issues/48215.

**What this PR does / why we need it**:
This ensures kube-apiserver `/healthz` endpoint fails whenever connectivity cannot be established to etcd, also ensures the etcd preflight checks works with unix sockets

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

**Special notes for your reviewer**:
This PR does not use the etcd client directly as the client object is wrapped behind the storage interface and not exposed directly for use, so I decided to reuse what's being done in the preflight. So this will only check fail for connectivity and not etcd auth related problems. I did not write tests for the endpoint because I couldn't find examples that I could follow for writing tests for healthz related endpoints, I'll be willing to write those tests if someone can point me at a relevant one.

**Release note**:
```release-note
Add etcd connectivity endpoint to healthz
```

@deads2k please help review, thanks!
2017-08-02 17:06:02 -07:00
Kubernetes Submit Queue e3c2482959 Merge pull request #50013 from deads2k/tpr-20-remove-bad-discovery
Automatic merge from submit-queue

cleanup dead installer code

cleans up some installer code that was dead and reorders a little of the flow to reduce complexity.

@kubernetes/sig-api-machinery-misc
2017-08-02 13:35:35 -07:00
Kubernetes Submit Queue 84e0326eb1 Merge pull request #49782 from supereagle/update-generated-deepcopy
Automatic merge from submit-queue (batch tested with PRs 50029, 48517, 49739, 49866, 49782)

Update generated deepcopy code

**What this PR does / why we need it**:
In generated deepcopy code, the method names in comments do not match the real method names.

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

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


**Release note**:
```release-note
NONE
```
2017-08-02 12:46:57 -07:00
Kubernetes Submit Queue 64a984bb62 Merge pull request #49891 from p0lyn0mial/sample_server_admission_plugin
Automatic merge from submit-queue (batch tested with PRs 49990, 49997, 44278, 49936, 49891)

adds an admission plugin to the sample apiserver.

**What this PR does / why we need it**:
adds an admission plugin to the sample apiserver.
the admission plugin checks whether `Flunder.Name` is not on the banned list.
including a unit test with various test scenarios.

**Special notes for your reviewer**:
https://github.com/kubernetes/kubernetes/issues/47868

**Release note**:

```
NONE
```
2017-08-02 10:21:50 -07:00
Kubernetes Submit Queue 4bda563b00 Merge pull request #49990 from jzhoucliqr/master
Automatic merge from submit-queue

fix sample-apiserver apiservice.yaml to add groupPriorityMinimum 

fix sample-apiserver apiservice.yaml example to add groupPriorityMinimum and versionPriority, which is added in v1.7 



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-08-02 09:41:25 -07:00
deads2k c287494162 cleanup dead installer code 2017-08-02 11:59:58 -04:00
Kubernetes Submit Queue 9067d35951 Merge pull request #48861 from mbohlool/openapi_aggr
Automatic merge from submit-queue (batch tested with PRs 49992, 48861, 49267, 49356, 49886)

Reintegrate aggregation support for OpenAPI

Reintegrating changes of #46734

Changes summary:

- Extracted all OpenAPI specs to new repo `kube-openapi`
- Make OpenAPI spec aggregator to copy and rename any non-requal model (even with documentation change only).
- Load specs when adding APIServices and retry on failure until successful spec retrieval or a 404.
- Assumes all Specs except aggregator's Spec are static 
- A re-register of any APIService will result in updating the spec for that service (Suggestion for TPR: they should be registered to aggregator API Server, Open for discussion if any more changes needed for another PR.)

fixes #48548
2017-08-02 05:15:57 -07:00
Kubernetes Submit Queue 35c3a51e2c Merge pull request #49992 from liggitt/debug-flake
Automatic merge from submit-queue (batch tested with PRs 49992, 48861, 49267, 49356, 49886)

Correctly handle empty watch event cache

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

Introduced by ada60236f7 which did not adjust the oldest available resourceVersion for an empty watch event cache.

Exposed by 74b9ba3b4d, which allowed controllers to get list results from etcd before the watch cache is ready (normally they list with resourceVersion=0 which serves the list request from the watch cache, blocking until it is ready)

When the watch cache had an empty cache of watch events, it currently allows establishing a watch as if it can deliver a watch event for its currently synced resourceVersion. This results in an off-by-one error which can result in a missed watch event.

Scenario:

bob:
1. creates object at resourceVersion=11

sally:
1. does a list API request, gets a list resourceVersion of 10 (just before bob creates the object)
2. starts watch handled by watch cache at resourceVersion=10

Watch cache:
1. initial list gets resourceVersion=11, including the item created by bob
2. when determining the initial watch events to send to sally's watch, there are no watch events in the cache, so no initial watch events are sent.
3. the cache listerwatcher watches etcd starting at resourceVersion=11, so future events are fed into the event cache and to sally's watch

The watch cache should have dropped sally's watch from resourceVersion=10 with a "gone" error, since it can't deliver the watch event for resourceVersion=11. This would force sally to relist (where she would get a list at resourceVersion=11) and rewatch (from resourceVersion=11)

This particularly affects tests that create CRD/TPRs and establish watches on the new types as the storage layer's watch cache is also populating for that type.

```release-note
Fix a bug in watch cache sometimes causing missing events after watch cache initialization.
```
2017-08-02 05:15:55 -07:00
Kubernetes Submit Queue ba118b408b Merge pull request #49858 from smarterclayton/openapi_perf
Automatic merge from submit-queue (batch tested with PRs 49871, 49422, 49092, 49858, 48999)

bump(github.com/googleapis/gnostic):0c5108395e2de

Pick up performance improvements to OpenAPI serialization.

Fixes #49776
2017-08-01 23:35:55 -07:00
Jordan Liggitt 0df769f540
Correctly handle empty watch event cache 2017-08-01 22:16:39 -04:00
Kubernetes Submit Queue f5b4f9a07d Merge pull request #49919 from liggitt/deconflict-reflector
Automatic merge from submit-queue (batch tested with PRs 49898, 49897, 49919, 48860, 49491)

Fix duplicate metrics collector registration attempted error

Fixes "duplicate metrics collector registration attempted" error seen in https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/batch/pull-kubernetes-unit/43931/
2017-08-01 17:57:16 -07:00
jzhoucliqr 590c31fe37 fix example apiservice.yaml to add groupPriorityMinimum and versionPriority 2017-08-01 16:47:15 -07:00
bjhaid 47d748c5dc This adds an etcd health check endpoint to kube-apiserver
addressing https://github.com/kubernetes/kubernetes/issues/48215.
2017-08-01 21:37:52 +00:00
Jordan Liggitt 1da4f4a745
Fix duplicate metrics collector registration attempted error 2017-08-01 11:30:30 -04:00
p0lyn0mial 78a088dc14 adds an admission plugin to the sample apiserver.
the admission plugin checks whether Flunder.Name is not on the banned list.
including a unit test with various test scenarios.
2017-08-01 17:13:28 +02:00
mbohlool 1806609596 Update Bazel 2017-08-01 03:37:18 -07:00
mbohlool 8c0580d89b Aggregate OpenAPI spec 2017-08-01 03:37:17 -07:00
mbohlool 400b77b48f Update main repo references to new kube-openapi repo 2017-08-01 03:37:16 -07:00
Kubernetes Submit Queue 6f992c9e51 Merge pull request #49692 from huangjiuyuan/fix-oidc-test
Automatic merge from submit-queue (batch tested with PRs 46519, 49794, 49720, 49692, 49821)

fix missing verb at end of format string

**What this PR does / why we need it**:
A missing verb at end of format string in Errorf call happens in `vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc_test.go`, This PR fixes this problem.

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

**Special notes for your reviewer**:

**Release note**:

`NONE`
2017-08-01 03:04:46 -07:00
Kubernetes Submit Queue 1bc56825a2 Merge pull request #49742 from sakshamsharma/kms-plugin-registry
Automatic merge from submit-queue

Add KMS plugin registry

Allows supporting KMS services as encryption providers using a plugin mechanism similar to admission plugins.

Simplifies #48574 

Progresses #48522

@deads2k PTAL
2017-07-31 18:27:59 -07:00
Kubernetes Submit Queue 088c198224 Merge pull request #49747 from nikhita/conversion-gen-recursive-types
Automatic merge from submit-queue (batch tested with PRs 49651, 49707, 49662, 47019, 49747)

conversion-gen: support recursive types

Currently, conversion-gen goes into an infinite recursion for recursive types. This fixes it to support recursive types.

Needed for #47263. 

**Release note**:

```release-note
NONE
```

/cc @sttts
2017-07-31 16:57:01 -07:00
Kubernetes Submit Queue 72c6251508 Merge pull request #47019 from jessfraz/allowPrivilegeEscalation
Automatic merge from submit-queue (batch tested with PRs 49651, 49707, 49662, 47019, 49747)

Add support for `no_new_privs` via AllowPrivilegeEscalation

**What this PR does / why we need it**:
Implements kubernetes/community#639
Fixes #38417

Adds `AllowPrivilegeEscalation` and `DefaultAllowPrivilegeEscalation` to `PodSecurityPolicy`.
Adds `AllowPrivilegeEscalation` to container `SecurityContext`.

Adds the proposed behavior to `kuberuntime`, `dockershim`, and `rkt`. Adds a bunch of unit tests to ensure the desired default behavior and that when `DefaultAllowPrivilegeEscalation` is explicitly set.

Tests pass locally with docker and rkt runtimes. There are also a few integration tests with a `setuid` binary for sanity.

**Release note**:

```release-note
Adds AllowPrivilegeEscalation to control whether a process can gain more privileges than it's parent process
```
2017-07-31 16:56:58 -07:00
Kubernetes Submit Queue 0acb503ae1 Merge pull request #49651 from enisoc/v1beta2-initialized
Automatic merge from submit-queue (batch tested with PRs 49651, 49707, 49662, 47019, 49747)

StatefulSet: Remove `initialized` annotation from apps/v1beta2.

The annotation was already removed from apps/v1beta1 in #49251, but this copy survived due to another concurrent PR.

ref #41605
2017-07-31 16:56:50 -07:00
Clayton Coleman 7a458730d7
bump(github.com/googleapis/gnostic):0c5108395e2de
Pick up performance improvements to OpenAPI serialization.
2017-07-31 15:36:06 -04:00
supereagle a1c880ece3 update generated deepcopy code 2017-07-31 22:33:00 +08:00
Kubernetes Submit Queue 7be28a15cc Merge pull request #47665 from ironcladlou/gc-poll-types
Automatic merge from submit-queue (batch tested with PRs 49538, 49708, 47665, 49750, 49528)

Enable garbage collection of custom resources

Enhance the garbage collector to periodically refresh the resources it monitors (via discovery) to enable custom resource definition GC (addressing #44507 and reverting #47432).

This is a replacement for #46000.

/cc @lavalamp @deads2k @sttts @caesarxuchao 

/ref https://github.com/kubernetes/kubernetes/pull/48065

```release-note
The garbage collector now supports custom APIs added via CustomeResourceDefinition or aggregated apiservers. Note that the garbage collector controller refreshes periodically, so there is a latency between when the API is added and when the garbage collector starts to manage it.
```
2017-07-29 05:28:53 -07:00
Kubernetes Submit Queue 740ca9a052 Merge pull request #49538 from supereagle/versioned-coreclient
Automatic merge from submit-queue (batch tested with PRs 49538, 49708, 47665, 49750, 49528)

Use the core client with version

**What this PR does / why we need it**:
Replace the **deprecated** `clientSet.Core()` with `clientSet.CoreV1()`.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-07-29 05:28:49 -07:00
huangjiuyuan c85d29f5fa fix missing verb at end of format string 2017-07-29 13:47:48 +08:00
Saksham Sharma 68a32c06b4 Add cloudprovidedkms provider support 2017-07-28 15:32:27 -07:00
Saksham Sharma b76c63a9f0 Add unit tests for KMS transformer initialization 2017-07-28 15:32:27 -07:00
Saksham Sharma 49989439d7 Add KMS plugin registry 2017-07-28 15:32:27 -07:00
mbohlool 56fd5853b3 Revert "Separate Build and Serving parts of OpenAPI spec handler"
This reverts commit 0a886ffaf8.
2017-07-28 14:02:36 -07:00
mbohlool 88868402b8 Revert "Aggregate OpenAPI specs"
This reverts commit 1a1d9a0394.
2017-07-28 14:02:36 -07:00
Kubernetes Submit Queue 0f6a64453c Merge pull request #49688 from wojtek-t/skip_cacher_if_not_initialized
Automatic merge from submit-queue (batch tested with PRs 49581, 49652, 49681, 49688, 44655)

Don't use cacher if uninitialized

Ref #49684
2017-07-28 13:45:51 -07:00
Nikhita Raghunath c4656c3d02 conversion-gen: support recursive types
Currently, the conversion-gen goes into an infinite recursion
for recursive types.

rename: currentlyBuildingTypes -> alreadyVisitedTypes

use a cachingEqual func

update comment
2017-07-29 00:43:27 +05:30
Kubernetes Submit Queue b341939d6d Merge pull request #49400 from caesarxuchao/add-OWNERS
Automatic merge from submit-queue

copy OWNERS to k8s.io/api

`staging/src/k8s.io/api/OWNERS` is combination of `pkg/api/OWNERS` and `pkg/apis/OWNERS`. Other `OWNERS` files are copied from `pkg/apis/<group_name>/OWNERS`.

Since this PR is essentially copying files, so we don't need approval from everyone listed in the OWNERS.
2017-07-28 11:50:35 -07:00
Kubernetes Submit Queue 537ced9a1d Merge pull request #49778 from resouer/fix-nil
Automatic merge from submit-queue

Fix crd delete nil pointer in example

**What this PR does / why we need it**:
When error is `IsAlreadyExists`, crd will be nil, then `defer` statement will `nil pointer`.

**Release note**:

```release-note
NONE
```
2017-07-28 11:50:13 -07:00
Kubernetes Submit Queue 3cd5beceb4 Merge pull request #49117 from shyamjvs/add-size-metrics-to-apiserver
Automatic merge from submit-queue

Add apiserver metric for response sizes

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

This should help us understand GET/LIST call latencies better. It'll also help catch differences in object sizes across kubemark and real cluster.
I'm labelling the metrics by namespace (hoping that there won't be toooo many of them).

/cc @smarterclayton @gmarek 
cc @kubernetes/sig-scalability-misc @kubernetes/sig-api-machinery-misc @lavalamp @wojtek-t
2017-07-28 11:50:00 -07:00
Kubernetes Submit Queue c06e8f03d9 Merge pull request #49694 from huangjiuyuan/fix-selector-test
Automatic merge from submit-queue (batch tested with PRs 49712, 49694, 49714, 49670, 49717)

fix arg type error in printf

**What this PR does / why we need it**:
A value of wrong type is passed as arg to a `Errorf` in `vendor/k8s.io/apimachinery/pkg/fields/selector_test.go`, This PR fixes this problem.

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

**Special notes for your reviewer**:

**Release note**:

`NONE`
2017-07-28 08:15:02 -07:00
Dan Mace d08dfb92c7 Enable garbage collection of custom resources
Enhance the garbage collector to periodically refresh the resources it
monitors (via discovery) to enable custom resource definition GC.

This implementation caches Unstructured structs for any kinds not
covered by a shared informer. The existing meta-only codec only supports
compiled types; an improved codec which supports arbitrary types could
be introduced to optimize caching to store only metadata for all
non-informer types.
2017-07-28 10:00:10 -04:00
Harry Zhang 66a2ee5a61 Fix crd delete nil pointer 2017-07-28 21:12:52 +08:00
Kubernetes Submit Queue e87f809da0 Merge pull request #49219 from jmillikin-stripe/case-insensitive-request-header-group
Automatic merge from submit-queue (batch tested with PRs 49081, 49318, 49219, 48989, 48486)

Use case-insensitive header keys for `--requestheader-group-headers`.

This flag is documented as being case-insensitive, but the code was
doing a case-sensitive map lookup.

**Release note**:
```release-note
Bug fix: Parsing of `--requestheader-group-headers` in requests should be case-insensitive.
```
2017-07-28 04:03:40 -07:00
Kubernetes Submit Queue 44b0eeed13 Merge pull request #48907 from thomastaylor312/bump_oidc_dep
Automatic merge from submit-queue (batch tested with PRs 47738, 49196, 48907, 48533, 48822)

Bumps go-oidc version to include fix for jwt header parsing

**What this PR does / why we need it**:
This bumps the go-oidc dependency to use a fix merged in https://github.com/coreos/go-oidc/pull/153 for OIDC providers that don't set an `Expires` header

**Which issue this PR fixes** : 
Partially addresses #42654 
Also related: https://github.com/coreos/go-oidc/issues/136

**Special notes for your reviewer**:
None

**Release note**:
```release-note
NONE
```
2017-07-28 03:10:32 -07:00
Kubernetes Submit Queue 85f19ec6e9 Merge pull request #47738 from php-coder/code_simplification
Automatic merge from submit-queue (batch tested with PRs 47738, 49196, 48907, 48533, 48822)

ParseEncryptionConfiguration: simplify code

**What this PR does / why we need it**:
Reorder `if`-s to make code a bit more readable. It also improves godoc comment and error message.

**Release note**:
```release-note
NONE
```

PTAL @sakshamsharma
2017-07-28 03:10:29 -07:00
Kubernetes Submit Queue 829526079d Merge pull request #48905 from p0lyn0mial/sample_server_admission_initializer
Automatic merge from submit-queue (batch tested with PRs 49238, 49595, 43494, 47897, 48905)

adds an admission plugin initializer to the sample apiserver.

**What this PR does / why we need it**:
this PR adds an admission plugin initializer to the sample apiserver.
the plugin initializer is going to be used by an admission plugin
that will use generated informers/listers to list the cluster-scoped resources.

#47868

**Release note**:

```
NONE
```
2017-07-28 02:13:04 -07:00
Kubernetes Submit Queue 7056b5ba70 Merge pull request #49238 from janetkuo/apps-v1beta2-rs
Automatic merge from submit-queue (batch tested with PRs 49238, 49595, 43494, 47897, 48905)

Add apps/v1beta2.ReplicaSet

~Depends on #48746~ (merged)
~Depends on #49357~ (merged)
xref: #49135

```release-note
Add a new API object apps/v1beta2.ReplicaSet
```
2017-07-28 02:12:51 -07:00
Wojciech Tyczynski 74b9ba3b4d Don't use cacher if uninitialized 2017-07-28 08:12:48 +02:00
Kubernetes Submit Queue 270206e9c3 Merge pull request #49736 from caesarxuchao/fix-link
Automatic merge from submit-queue

Update the link to client-gen doc

The doc itself also needs update, i'll create an issue.
2017-07-27 22:03:35 -07:00
Kubernetes Submit Queue 803cb9303b Merge pull request #49495 from deads2k/controller-12-toleration
Automatic merge from submit-queue (batch tested with PRs 49665, 49689, 49495, 49146, 48934)

make it possible to allow discovery errors for controllers

Update the discovery client to return partial discovery information *and* an error.  Since we can aggregate API servers, discovery of some resources can fail independently.  Callers of this function who want to tolerate the errors can, existing callers will still get an error and fail in normal blocks.

@kubernetes/sig-api-machinery-misc @sttts
2017-07-27 21:45:34 -07:00