Commit Graph

1808 Commits (aac4d5382d8ea632360a08369f5adfdebce7c2c3)

Author SHA1 Message Date
Christoph Blecker aac4d5382d
Move remaining cert helper functions to client-go/util/cert
- Move public key functions to client-go/util/cert
- Move pki file helper functions to client-go/util/cert
- Standardize on certutil package alias
- Update dependencies to client-go/util/cert
2017-08-03 13:17:07 -07:00
Kubernetes Submit Queue 66bfab8915 Merge pull request #49924 from dixudx/increase_deployment_default_RevisionHistoryLimit
Automatic merge from submit-queue

Increase default value of apps/v1beta2 DeploymentSpec.RevisionHistoryLimit to 10

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

All controllers that use the `RevisionHistoryLimit` field have a default value of 10 for the field, except for `Deployment`, which has a default of 2. We should increase it to 10 for consistency on its default value across controllers.

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

**Special notes for your reviewer**:
/cc @janetkuo @foxish @liyinan926

**Release note**:

```release-note
Increase default value of apps/v1beta2 DeploymentSpec.RevisionHistoryLimit to 10
```
2017-08-03 10:58:51 -07:00
Kubernetes Submit Queue 2bd0b3dd26 Merge pull request #49195 from huangjiuyuan/fix-typo
Automatic merge from submit-queue

fix typo in staging/src/k8s.io/apiserver/pkg/server/config.go

**What this PR does / why we need it**: Fix a typo `It's members are sorted roughly in order of importance for composers.` in `staging/src/k8s.io/apiserver/pkg/server/config.go`.

**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-03 07:34:43 -07:00
Kubernetes Submit Queue ef5ee331cc Merge pull request #49368 from sttts/sttts-clean-go2idl
Automatic merge from submit-queue

Remove remaining traces of go2idl
2017-08-03 05:51:08 -07:00
Kubernetes Submit Queue 5d24a2c199 Merge pull request #49300 from tklauser/syscall-to-x-sys-unix
Automatic merge from submit-queue

Switch from package syscall to golang.org/x/sys/unix

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

The syscall package is locked down and the comment in https://github.com/golang/go/blob/master/src/syscall/syscall.go#L21-L24 advises to switch code to use the corresponding package from golang.org/x/sys. This PR does so and replaces usage of package syscall with package golang.org/x/sys/unix where applicable. This will also allow to get updates and fixes
without having to use a new go version.

In order to get the latest functionality, golang.org/x/sys/ is re-vendored. This also allows to use Eventfd() from this package instead of calling the eventfd() C function.

**Special notes for your reviewer**:

This follows previous works in other Go projects, see e.g. moby/moby#33399, cilium/cilium#588

**Release note**:

```release-note
NONE
```
2017-08-03 04:02:12 -07:00
Kubernetes Submit Queue f8affc7dcc Merge pull request #49302 from sttts/sttts-missing-codecs
Automatic merge from submit-queue

Add missing ugorji codecs for auth/v1, settings/v1alphav1 and storage/v1
2017-08-03 03:05:49 -07:00
Kubernetes Submit Queue bfdccbae83 Merge pull request #50066 from zhangxiaoyu-zidif/fix-fypo-staging-request
Automatic merge from submit-queue

Fix comment of request.go

**What this PR does / why we need it**:
Fix comment of request.go

**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-03 02:12:19 -07:00
Kubernetes Submit Queue 98ba03f544 Merge pull request #48837 from ericchiang/clientset-dont-return-nil
Automatic merge from submit-queue

client-gen: don't ignore nil clientsets

Closes https://github.com/kubernetes/client-go/issues/240

When a clientset is nil, fail fast instead of returning a nil value as an interface.

/cc @kubernetes/sig-api-machinery-pr-reviews
2017-08-03 02:12:14 -07:00
Dr. Stefan Schimanski ea39971b7c Remove traces of go2idl 2017-08-03 09:33:58 +02:00
zhangxiaoyu-zidif c302a72eb9 Fix comment of request.go 2017-08-03 15:17:33 +08:00
Kubernetes Submit Queue 9e85c3cc74 Merge pull request #47045 from atlassian/shared-informer-improvement
Automatic merge from submit-queue (batch tested with PRs 48365, 49902, 49808, 48722, 47045)

Improve shared informer notification dispatching

**What this PR does / why we need it**:
Locks and channels don't play well together. This is an attempt to remove locks and only use channels in shared informer. It looks much cleaner to me.

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

@deads2k @ncdc
2017-08-02 22:33:01 -07:00
Kubernetes Submit Queue 804ec9457a Merge pull request #49972 from deads2k/server-37-log
Automatic merge from submit-queue

remove dead log handler and increase verbosity

We had a handler that no one was using and this bumps the verbosity slightly (2->3) to reduce noise at 2.
2017-08-02 20:58:39 -07:00
Kubernetes Submit Queue 6f99ed460d Merge pull request #49607 from dixudx/change_StS_observedGeneration_to_int
Automatic merge from submit-queue (batch tested with PRs 50000, 49954, 49943, 50018, 49607)

change apps/v1beta2 StatefulSet observedGeneration from a pointer to an int for consistency

**What this PR does / why we need it**:
change the StatefulSet observedGeneration from a pointer to an int for consistency

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

**Special notes for your reviewer**:
/cc @janetkuo @foxish @kow3ns 

**Release note**:

```release-note
change apps/v1beta2 StatefulSet observedGeneration (optional field) from a pointer to an int for consistency
```
2017-08-02 20:07:56 -07:00
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
Eric Chiang baa536fbca generated
Commands run:

	./hack/update-codegen.sh
2017-08-02 10:27:36 -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
Eric Chiang 686e288f44 client-gen: don't return a nil client interface value 2017-08-02 10:19:11 -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
deads2k 9e263af7da remove dead log handler and increase verbosity 2017-08-02 07:53:35 -04:00
Mikhail Mazurskiy 35e849bff2
Improve shared informer notification dispatching 2017-08-02 18:57:42 +10: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
Di Xu 92779979e8 auto-gen 2017-08-02 13:01:03 +08:00
Di Xu 2098cc2639 change the StatefulSet observedGeneration from a pointer to an int for consistency 2017-08-02 13:00:58 +08:00
Jordan Liggitt 0df769f540
Correctly handle empty watch event cache 2017-08-01 22:16:39 -04:00
Di Xu edaf66c276 auto-gen 2017-08-02 09:26:40 +08:00
Di Xu 7b45e5344b Increase default value of DeploymentSpec.RevisionHistoryLimit to 10 2017-08-02 09:03:58 +08: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
huangjiuyuan 1382d2f6e8 fix typo in staging/src/k8s.io/apiserver/pkg/server/config.go 2017-08-01 10:09:10 +08: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
Dr. Stefan Schimanski 51df7cf59d Add missing ugorji codecs for auth/v1, settings/v1alphav1 and storage/v1 2017-07-31 16:24:22 +02: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