Commit Graph

4396 Commits (f189015c0325a4742a9a908b871c03ab60cfdc6b)

Author SHA1 Message Date
Kubernetes Submit Queue 6d3bba7391
Merge pull request #64246 from wojtek-t/lease_object_type
Automatic merge from submit-queue (batch tested with PRs 64246, 65489, 65443). 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>.

Create "Lease" API in the new "coordination.k8s.io" api group

Part of "Efficient Node heartbeats" KEP:
https://github.com/kubernetes/community/blob/master/keps/0009-node-heartbeat.md

Part of: https://github.com/kubernetes/kubernetes/issues/14733

```release-note
NONE
```
2018-06-27 08:17:10 -07:00
wojtekt 0950084137 Autogenerated stuff 2018-06-27 13:31:10 +02:00
wojtekt f38e952f4e Add coordination API group with Lease type 2018-06-27 13:30:13 +02:00
Kubernetes Submit Queue 4d4bb53fae
Merge pull request #65486 from liggitt/diff-type
Automatic merge from submit-queue (batch tested with PRs 65507, 65508, 65486). 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>.

show type differences in reflect diff

helps debugging type coercion round-tripping issues

/assign @smarterclayton

```release-note
NONE
```
2018-06-26 23:17:05 -07:00
xuzhonghu 8c820ae303 transform ConnectMethods to kube verbs 2018-06-27 11:15:08 +08:00
Kubernetes Submit Queue f9a1cb9b63
Merge pull request #65404 from fisherxu/collapse-rvParse
Automatic merge from submit-queue (batch tested with PRs 65404, 65323, 65468). 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>.

Collapse the list and watch resource version parse

**What this PR does / why we need it**:
Collapse the list and watch resource version parse, as discuss in [#64513](https://github.com/kubernetes/kubernetes/pull/64513#issuecomment-399380988)
**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-06-26 17:33:01 -07:00
Jordan Liggitt 6354665ee8
show type differences in reflect diff 2018-06-26 11:30:30 -04:00
Clayton Coleman c819a16284
Improve job describe and get output
For get, condense completions and success into a single column, and
print the job duration. Use a new variant of ShortHumanDuration that
shows more significant digits, since duration matters more for jobs.

```
NAME                                   COMPLETIONS   DURATION   AGE
image-mirror-origin-v3.10-1529985600   1/1           47s        42m
image-mirror-origin-v3.11-1529985600   1/1           74s        42m
image-pruner-1529971200                1/1           60m        4h
```

The completions column can be:

```
COMPLETIONS
0/1        # completions nil or 1, succeeded 0
1/1        # completions nil or 1, succeeded 1
0/3        # completions 3, succeeded 1
1/3        # completions 3, succeeded 1
0/1 of 30  # parallelism of 30, completions is nil
```

Update describe to show the completion time and the duration.
2018-06-26 09:37:29 -04:00
Kubernetes Submit Queue 1f4f0123ed
Merge pull request #64812 from hzxuzhonghu/audit-useragent
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 user-agent to audit-logging

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

Add User-Agent to audit event.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Add user-agent to audit-logging.
```
2018-06-25 22:16:08 -07:00
Guoliang Wang 0d6c51656e enable etcdv3 client prometheus metics 2018-06-26 08:08:19 +08:00
immutablet 0100891168 Add support for linux abstract socket namespace. 2018-06-25 09:41:14 -07:00
Kubernetes Submit Queue f01eaef77f
Merge pull request #65057 from sttts/sttts-apiexitensions-coreapi
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>.

apiextensions: enable CoreAPI options needed for admission

Admission webhooks need the client and the shared informers for kube resources. The comment is invalid and we have to enable the CoreAPI options.

This PR is important to run apiextensions-apiserver in a standalone integration test setup.
2018-06-24 22:17:15 -07:00
fisherxu 68ec856b45 collapse the resource version parse 2018-06-25 10:13:32 +08:00
Nikhita Raghunath 764ae69671 client-go/examples/fake-client: add doc.go to fix go build warnings
The fakeclient package does not have any non-test go files. This
causes `go build` to give a warning: `no non-test Go files in ...`.
This also causes the publishing bot to fail.

This PR adds a dummy doc.go file in the package to avoid this warning.
2018-06-24 21:07:22 +05:30
Mikhail Mazurskiy bfe313d5f3
Add missing error handling in schema-related code 2018-06-23 21:06:32 +10:00
Kubernetes Submit Queue 21912b396c
Merge pull request #65288 from mbohlool/crd_flaky_test
Automatic merge from submit-queue (batch tested with PRs 64122, 64936, 65288, 65383). 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>.

Consume watch event for all versions of CRD

The new test code to fix flaky test were considered CRD version but failed to consume watch cache event in all versions.

Fixes #64571

@sttts @liggitt
2018-06-22 19:03:19 -07:00
Cong Ding 3bacb04a5f cleanup: remove deadcode 2018-06-22 17:46:05 -07:00
Jeff Grafton b42e9125c4 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton 347c3612c9 Set gazelle:importmap_prefix for everything under staging/src 2018-06-22 16:22:57 -07:00
Jeff Grafton 095a9e53ca Use new go_genrule from kubernetes/repo-infra based on go_path 2018-06-22 16:22:57 -07:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton f31183fa3d Set gazelle:prefix on staging/src and remove sed hack 2018-06-22 16:22:18 -07:00
Jeff Grafton a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
Jeff Grafton 01f94051c8 Remove the go_default_library_protos filegroups using buildozer 2018-06-22 16:22:18 -07:00
Kubernetes Submit Queue 3a266a1b3f
Merge pull request #65368 from deads2k/server-17-discovery
Automatic merge from submit-queue (batch tested with PRs 61330, 64793, 64675, 65059, 65368). 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>.

legacy api endpoints only support v1 ever

The legacy API endpoint should only ever have a v1.  This removes flexibility we don't need or want.

@kubernetes/sig-api-machinery-pr-reviews 
@sttts 

```release-note
NONE
```
2018-06-22 14:52:44 -07:00
Mehdy Bohlool 335d42165f Consume watch event for all versions of CRD 2018-06-22 11:20:15 -07:00
Kubernetes Submit Queue 456f85e736
Merge pull request #65324 from nikhita/fix-nits-json-case-sensitive
Automatic merge from submit-queue (batch tested with PRs 65339, 65343, 65324, 65335, 65367). 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 k8s json package import name

Fixes nits found while cherry-picking https://github.com/kubernetes/kubernetes/pull/65034 in https://github.com/kubernetes/kubernetes/pull/65298.

**Release note**:

```release-note
NONE
```

/cc sttts liggitt caesarxuchao
2018-06-22 10:31:17 -07:00
Kubernetes Submit Queue 1308d9a380
Merge pull request #65343 from cfork/typo
Automatic merge from submit-queue (batch tested with PRs 65339, 65343, 65324, 65335, 65367). 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: fix typo introduced in #57366

fix typo introduced in #57366

```release-note
NONE
```
2018-06-22 10:31:14 -07:00
David Eads b063e9f85e legacy api endpoints only support v1 ever 2018-06-22 08:58:32 -04:00
Kubernetes Submit Queue 8008c7dad9
Merge pull request #65291 from misterikkit/fake-client
Automatic merge from submit-queue (batch tested with PRs 65301, 65291, 65307, 63845, 65313). 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 client-go example using fake client in test.

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

This adds an example showing the steps needed to get a working
SharedInformerFactory with a fake client for testing.


**Special notes for your reviewer**:
I had a really hard time figuring out how to use this utility correctly. I don't think this example is sufficient documentation, but it's a good start.

**Release note**:

```release-note
NONE
```
/sig api-machinery
/kind documentation
2018-06-22 03:08:10 -07:00
Nikhita Raghunath b38e1a9e42 Allow more fields at root of CRD schema if status is enabled
Currently, we allow only properties, required and description at the
root of the CRD schema when the status subresource is enabled.

We can also include some other fields, even though sometimes they
might not make sense (but they don't harm).

The main idea is that when validation schema for status is extracted
as properties["status"], validation for status is not lost.
2018-06-22 15:16:22 +05:30
Kubernetes Submit Queue ac78ec23a1
Merge pull request #64805 from hanxiaoshuai/cleanup0606
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 unused code in runtime/scheme_test.go

**What this PR does / why we need it**:
remove unused code in runtime/scheme_test.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
```
2018-06-21 23:47:52 -07:00
Kubernetes Submit Queue 3ab6ced72b
Merge pull request #65260 from dixudx/fix_ScaleIOVolumeSource_spec
Automatic merge from submit-queue (batch tested with PRs 65064, 65218, 65260, 65241, 64372). 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 scale io volume source spec

**What this PR does / why we need it**:
> FSType 
Implicitly inferred to be "ext4" if unspecified.

Actually the default value to "xfs".

**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-06-21 21:12:16 -07:00
Kubernetes Submit Queue 881b8423b9
Merge pull request #65206 from xmudrii/sample-apiserver-rbac
Automatic merge from submit-queue (batch tested with PRs 65187, 65206, 65223, 64752, 65238). 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>.

sample-apiserver: Add RBAC roles and ClusterRoleBindings for Admission Webhooks

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

When you run the `sample-apiserver` using the [manifests provided in the artifacts directory](https://github.com/kubernetes/sample-apiserver/tree/master/artifacts/example), you will get the following errors, related to insufficient permissions to list Namespaces and Admission Webhooks:
```
E0619 07:43:06.422862       1 reflector.go:205] k8s.io/sample-apiserver/vendor/k8s.io/client-go/informers/factory.go:130: Failed to list *v1.Namespace: namespaces is forbidden: User "system:serviceaccount:wardle:apiserver" cannot list namespaces at the cluster scope
E0619 07:43:06.423981       1 reflector.go:205] k8s.io/sample-apiserver/vendor/k8s.io/client-go/informers/factory.go:130: Failed to list *v1beta1.MutatingWebhookConfiguration: mutatingwebhookconfigurations.admissionregistration.k8s.io is forbidden: User "system:serviceaccount:wardle:apiserver" cannot list mutatingwebhookconfigurations.admissionregistration.k8s.io at the cluster scope
E0619 07:43:07.424130       1 reflector.go:205] k8s.io/sample-apiserver/vendor/k8s.io/client-go/informers/factory.go:130: Failed to list *v1beta1.ValidatingWebhookConfiguration: validatingwebhookconfigurations.admissionregistration.k8s.io is forbidden: User "system:serviceaccount:wardle:apiserver" cannot list validatingwebhookconfigurations.admissionregistration.k8s.io at the cluster scope
```

This PR adds two manifests, `rbac.yaml` containing the RBAC rules, and `rbac-bind.yaml` used to bind roles to the `wardle` service account.

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

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

/assign @sttts @deads2k 
/sig api-machinery
2018-06-21 19:48:06 -07:00
xuzhonghu f0b1f1c2f6 limit User-Agent max length 1024 and add ...TRUNCATED suffix 2018-06-22 09:59:38 +08:00
Kubernetes Submit Queue 01bc75c291
Merge pull request #65199 from tallclair/maxage
Automatic merge from submit-queue (batch tested with PRs 65152, 65199, 65179, 64598, 65216). 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 MaxAge default audit log option

Fix typo in flag default.

```release-note
NONE
```
2018-06-21 18:20:09 -07:00
Cong Ding 42a19a3cb8 apiserver: fix typo introduced in #57366 2018-06-21 16:45:19 -07:00
Kubernetes Submit Queue 8ba32978b7
Merge pull request #64539 from cfork/lease
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>.

etcd: reuse leases for keys in a time window

Reuse leases for keys in a time window, to reduce the overhead to etcd
caused by using massive number of leases

Fixes #47532

```release-note
NONE
```
2018-06-21 15:25:02 -07:00
Jonathan Basseri aed487b42d Add client-go example using fake client in test.
This adds an example showing the steps needed to get a working
SharedInformerFactory with a fake client for testing.
2018-06-21 14:18:39 -07:00
Kubernetes Submit Queue d7db405b30
Merge pull request #65099 from sttts/sttts-apiserver-auth-error-context
Automatic merge from submit-queue (batch tested with PRs 65116, 61718, 65140, 65128, 65099). 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 context to authn/authz kubeconfig errors

Before this the user only saw messages about in-cluster config, but didn't know which.
2018-06-21 13:59:19 -07:00
Kubernetes Submit Queue 7b53aca70d
Merge pull request #65140 from sttts/sttts-crd-update-test
Automatic merge from submit-queue (batch tested with PRs 65116, 61718, 65140, 65128, 65099). 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>.

apiextensions: add update to testSimpleCRUD (again?)

Did we ever have that before cleanups/refactorings?
2018-06-21 13:59:12 -07:00
Kubernetes Submit Queue ed47d75f75
Merge pull request #65116 from sttts/sttts-apiextensions-crd-example-meta-types
Automatic merge from submit-queue (batch tested with PRs 65116, 61718, 65140, 65128, 65099). 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>.

apiextensions: add AddToGroupVersion call to CRD example register.go

Avoid `v1.ListOptions is not suitable for converting to ...` message in CRD client on List.

https://github.com/kubernetes/kubernetes/pull/57243 did the same for the sample-controller.
2018-06-21 13:59:05 -07:00
Kubernetes Submit Queue d371d70028
Merge pull request #65026 from spew/fix-poll-immediate-docs
Automatic merge from submit-queue (batch tested with PRs 65265, 64822, 65026, 65019, 65077). 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>.

Correct several mistakes in the comments/doc for PollImmediate.

**What this PR does / why we need it**:
The wait.PollImmediate(...) docs refer to the Poll(...) function by mistake which is confusing. This PR fixes that issue.

**Release note**:

```release-note
Corrected a mistake in the documentation for wait.PollImmediate(...)
```
2018-06-21 11:25:13 -07:00
Kubernetes Submit Queue 418a0e6c29
Merge pull request #65265 from sttts/sttts-sample-apiserver-pkg
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>.

staging-repos: add note that these are to be imported as k8s/*

Fixes https://github.com/kubernetes/sample-controller/issues/17
Fixes https://github.com/kubernetes/sample-controller/issues/20
2018-06-21 11:13:50 -07:00
Nikhita Raghunath 0623068f6c Fix k8s json package import name 2018-06-21 22:55:17 +05:30
Cong Ding 163529bc20 etcd: reuse leases for keys in a time window
Reuse leases for keys in a time window, to reduce the overhead to etcd
caused by using massive number of leases

Fixes #47532
2018-06-21 10:17:48 -07:00
Kubernetes Submit Queue 9d97913e75
Merge pull request #65027 from liggitt/etcd-health-check
Automatic merge from submit-queue (batch tested with PRs 64140, 64898, 65022, 65037, 65027). 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 actual etcd client for /healthz/etcd checks

* avoids redialing etcd on every health check (which makes slow DNS a false-positive healthz failure)
* ensures etcd TLS setup is correct (errors verifying the etcd API or sending client credentials manifest as healthz failures)
* ensures the etcd cluster is actually responsive

fixes #64909

```release-note
Etcd health checks by the apiserver now ensure the apiserver can connect to and exercise the etcd API
```
2018-06-21 05:40:24 -07:00
Kubernetes Submit Queue d1f5cb2348
Merge pull request #65050 from sttts/sttts-deepcopy-update
Automatic merge from submit-queue (batch tested with PRs 64895, 64938, 63700, 65050, 64957). 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 gengo to include uniform pointer deepcopy

This bumps k8s.io/gengo with uniform pointer support in deepcopy-gen.

Fixes https://github.com/kubernetes/code-generator/issues/45.
2018-06-21 04:15:16 -07:00
Kubernetes Submit Queue 8850871891
Merge pull request #63700 from zjj2wry/leaderelection
Automatic merge from submit-queue (batch tested with PRs 64895, 64938, 63700, 65050, 64957). 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>.

enhance leaderelection code

**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-06-21 04:15:13 -07:00
Dr. Stefan Schimanski 943405d3d2 sample-apiserver: add note that the pkg is k8s.io/sample-apiserver 2018-06-21 12:53:12 +02:00
Kubernetes Submit Queue 83ad4d9e96
Merge pull request #65001 from liggitt/quiet-logs
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>.

Quiet verbose apiserver logs

In our production environments, these three lines accounted for ~10 logged lines per second at --v=2

Something that verbose per-request should be at a higher verbosity log level

/cc @eparis
/sig api-machinery
2018-06-21 02:38:19 -07:00
Kubernetes Submit Queue 56a2d2f578
Merge pull request #64883 from liggitt/legacy-printer
Automatic merge from submit-queue (batch tested with PRs 64285, 63660, 63661, 63662, 64883). 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 up legacy printer table adapter

As server-side printing is more widespread, downstream consumers will start leaning on this adapter to transform client-side printers to server-side printers.

This PR:
* Set the name format correctly on column 0
* Tolerates case-differences in the column 0 name (many old printers used NAME)
* Set ListMeta continue/resourceVersion/selfLink correctly when adapting a legacy printer

/cc @smarterclayton 

```release-note
NONE
```
2018-06-21 01:19:30 -07:00
Kubernetes Submit Queue 1a75395da8
Merge pull request #63668 from atlassian/jsoniter-error-handling
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>.

Report parsing error in json serializer

**What this PR does / why we need it**:
Fixes missing error reporting in json parsing using the json-iterator library. Also introduces a private copy of the library config to partially shield from external mutations. https://github.com/json-iterator/go/issues/265. 

**Special notes for your reviewer**:
Found while working on refactoring in https://github.com/kubernetes/kubernetes/pull/63284.

**Release note**:
```release-note
NONE
```
/kind bug
/sig api-machinery
/cc wojtek-t liggitt
2018-06-20 21:21:35 -07:00
Kubernetes Submit Queue 571b9beac5
Merge pull request #57932 from atlassian/cancellable-leader-election
Automatic merge from submit-queue (batch tested with PRs 65256, 64236, 64919, 64879, 57932). 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>.

Cancellable leader election

**What this PR does / why we need it**:
Adds ability to cancel leader election. Useful in integration tests where the whole app is started and stopped in each test.

**Special notes for your reviewer**:
I used the `context` package - it is impossible/hard to achieve the same behaviour with just channels without spawning additional goroutines but it is trivial with `context`. See `acquire()` and `renew()` methods.

**Release note**:

```release-note
NONE
```
/kind enhancement
/sig api-machinery
2018-06-20 17:22:22 -07:00
Kubernetes Submit Queue ed6c8b7326
Merge pull request #65256 from liggitt/crd-schema-openapi
Automatic merge from submit-queue (batch tested with PRs 65256, 64236, 64919, 64879, 57932). 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 CRD OpenAPI schema

fixes #65243
depends on https://github.com/kubernetes/kube-openapi/pull/84

without this PR, kubectl complains about creating this CRD with a validation schema (which worked in 1.10):
```yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: resources.mygroup.example.com
spec:
  group: mygroup.example.com
  version: v1alpha1
  scope: Namespaced
  names:
    plural: resources
    singular: resource
    kind: Kind
    listKind: KindList
  validation:
    openAPIV3Schema:
      properties:
        spec:
          type: array
          items:
            type: number
```

> error: error validating "/Users/jliggitt/projects/snippets/crd/crd.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.items): unknown field "type" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray, ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.items): missing required field "Schema" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray, ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.items): missing required field "JSONSchemas" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray]; if you choose to ignore these errors, turn validation off with --validate=false

that is because the types used to serialize JSONSchema require custom marshaling/unmarshaling, and the OpenAPI generator was not informed of that, so it produced this:
```json
{
    "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray": {
    "description": "JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps or an array of JSONSchemaProps. Mainly here for serialization purposes.",
    "required": [
     "Schema",
     "JSONSchemas"
    ],
    "properties": {
     "JSONSchemas": {
      "type": "array",
      "items": {
       "$ref": "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps"
      }
     },
     "Schema": {
      "$ref": "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps"
     }
    }
   }
}
```

OpenAPI isn't able to represent oneOf/anyOf types correctly currently. Until it can, we definitely shouldn't publish a schema containing required fields which aren't even part of the JSON serialization. This PR implements custom openapi type functions, which omit the properties/required/schema attributes for four specific JSONSchema types. This allows kubectl to continue creating these objects without complaining.

/sig api-machinery
/assign @sttts

```release-note
fixed incorrect OpenAPI schema for CustomResourceDefinition objects
```
2018-06-20 17:22:08 -07:00
Kubernetes Submit Queue 1a061a7d3f
Merge pull request #64915 from sttts/sttts-getownerrefs-no-deepcopy
Automatic merge from submit-queue (batch tested with PRs 58690, 64773, 64880, 64915, 64831). 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>.

apimachinery: unify accessors to not deepcopy

The Get/SetOwnerReferences accessor funcs do deepcopies, in contrast to all other accessor funcs of metav1.ObjectMeta. For unstructured.Unstructured we naturally do deepcopies. 

In other words: the interface does guarantee neither the first nor the second. 

This PR documents this and remove the unneccessary deepcopy for owner references (which leads to huge heap allocation e.g. in the DaemonSet controller).

This is for post-1.11. **do not assign a milestone**.

```dev-release-note
The metav1.ObjectMeta accessor does not deepcopy owner references anymore. In general, the accessor interface does not enforce deepcopy nor does it forbid it (e.g. for unstructured.Unstructured).
```
2018-06-20 14:21:21 -07:00
Jordan Liggitt f78230881c
stop returning invalid json fields in CRD OpenAPI schemas 2018-06-20 16:22:20 -04:00
Jordan Liggitt 102bc90120
bump(k8s.io/kube-openapi): 91cfa479c814065e420cee7ed227db0f63a5854e 2018-06-20 16:20:27 -04:00
Kubernetes Submit Queue 02c7325eb9
Merge pull request #60626 from nikhita/quota-01-remove-todo
Automatic merge from submit-queue (batch tested with PRs 64882, 64692, 64389, 60626, 64840). 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>.

[minor] apimachinery: remove note for quota serialization

Fixes #53503 

We are way ahead of 1.5 now.

**Release note**:

```release-note
NONE
```

/cc sttts
2018-06-20 10:03:32 -07:00
Kubernetes Submit Queue f637a259ea
Merge pull request #63625 from liggitt/discovery-cleanup-2
Automatic merge from submit-queue (batch tested with PRs 64416, 63625, 60967, 64767, 64588). 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>.

Collapse memcached discovery client onto parallelized discovery method

```release-note
NONE
```
2018-06-20 07:12:18 -07:00
Kubernetes Submit Queue b309d18a48
Merge pull request #64506 from wgliang/master.simple-string
Automatic merge from submit-queue (batch tested with PRs 64688, 64451, 64504, 64506, 56358). 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>.

replace fmt.Sprintf(%s, i.Type()) with i.Type().String()

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

replace fmt.Sprintf(%s, i.Type()) with i.Type().String()


**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-06-20 05:48:19 -07:00
Kubernetes Submit Queue 27c327cd33
Merge pull request #64100 from JacobTanenbaum/InstallPathHandler-tests
Automatic merge from submit-queue (batch tested with PRs 63580, 63744, 64541, 64502, 64100). 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 unit tests for InstallPathHandler()

When adding InstallPathHandler it was suggested to follow-up with an improvement to the unit tests. deads2k suggested that the testing for InstallPathHandler() follow closer to what is already implemented for InstallHandler(). 



**What this PR does / why we need it**:
Increases the testing around new functionality InstallPathHandler

**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-06-20 01:32:41 -07:00
Kubernetes Submit Queue d0a2bfd22e
Merge pull request #64548 from hzxuzhonghu/patch-1
Automatic merge from submit-queue (batch tested with PRs 64142, 64426, 62910, 63942, 64548). 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 inaccurate comment about watch timeout

when watch timeout, the tcp connection does not close, it is reused for another new watch.
But this makes users misunderstanding.

**Release note**:

```release-note
NONE
```
2018-06-20 00:05:22 -07:00
Di Xu 871673f51b auto-generated files 2018-06-20 13:34:50 +08:00
Kubernetes Submit Queue 6559b98f64
Merge pull request #64163 from JacobTanenbaum/LoopbackHostPort
Automatic merge from submit-queue (batch tested with PRs 64252, 64307, 64163, 64378, 64179). 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>.

Modify LoopbackHostPort() so it returns an IPv6 Loopback address when given [::] 

Currently when LoopbackHostPort() is called with 0.0.0.0 and [::] it returns the first loopback
address returned from net.InterfaceAddrs() which is typically 127.0.0.1 (golang does not
specify an order that interfaces are returned). It would be more appropriate if when calling
LoopbackHostPort() with [::] that an IPv6 loopback address is returned, this prevents some cert.
generation failures.



**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-06-19 21:45:14 -07:00
Di Xu bb1a9f511f add default value to ScaleIOVolumeSource spec 2018-06-20 11:26:41 +08:00
Marko Mudrinić 33d31e4a55
sample-apiserver: Add RBAC roles and ClusterRoleBindings for Admission Webhooks 2018-06-19 10:16:13 +02:00
Tim Allclair 3dae49c697
Fix MaxAge default audit log option 2018-06-18 14:37:37 -07:00
Dr. Stefan Schimanski 927d1b1045 apiextensions: expect IsNotFound errors for disabled versions in testSimpleCRUD 2018-06-18 17:24:42 +02:00
Dr. Stefan Schimanski 1daa99029b apiextensions: add update to testSimpleCRUD (again?) 2018-06-18 17:24:13 +02:00
Mikhail Mazurskiy b76e512f8f
Report parsing error in json serializer 2018-06-18 21:46:17 +10:00
Kubernetes Submit Queue a12cade52c
Merge pull request #64796 from mbohlool/crd_versioning_crd_test
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>.

CRD Test: Fix resource creation/deletion for multi-version CRDs

During CRD testing setup, a setup instance CRD is created and watched to make sure the watch cache is prime. The deletion watch event for this instance can result in test failure for any watch test as they expect exact watch events. Previous code did not take multiple versioned CRDs into account. This change will make sure we wait for deletion for all versions before continue with any test.

@sttts @liggitt 

Fixes #64571
2018-06-15 14:22:07 -07:00
Kubernetes Submit Queue 32003df3fb
Merge pull request #65092 from sttts/sttts-crd-registry-objectmeta-deepcopy
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>.

apiextensions: fix concurrent map access copying items' ObjectMeta in UnstructuredList

The list endpoint sets the self-link. If we do not create a (shallow) copy of ObjectMeta this will mutate the cached objects.

Background: native objects like PodList have a `Items []Pod` field which implicitly shallow-copies ObjectMeta. UnstructuredList only shallow-copies Unstructured, but shares all the JSON data including ObjectMeta, i.e. the Object pointer points to the value in the cache.

Fixes https://github.com/kubernetes/kubernetes/issues/59478
2018-06-15 11:39:35 -07:00
Jordan Liggitt 486f42d2a4
decode crd objectmeta properly 2018-06-15 09:42:52 -04:00
Dr. Stefan Schimanski cd10f28ac1 apiextensions: fix concurrent map access copying items' ObjectMeta in Unstructured
The list+get endpoints sets the self-link. If we do not create a (shallow)
copy of ObjectMeta this will mutate the cached objects.
2018-06-15 15:17:25 +02:00
Mehdy Bohlool 602ddef158 Fix check for CRD watch priming 2018-06-14 16:14:51 -07:00
Kubernetes Submit Queue a2de1398f8
Merge pull request #65034 from caesarxuchao/json-case-sensitive
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>.

Make kubernetes json serializer case sensitive

This PR imported the latest jsoniterator library so that case sensitivity during unmarhsaling is optional. The PR also set Kubernetes json serializer to be case sensitive.

Kubernetes json serializer had been case sensitive for 1.1-1.7 as we were using ugorji. This PR restores the behavior.

Fix #64612.

```release-notes
Kubernetes json deserializer is now case-sensitive as it was before 1.8.
If your config files contains fields with wrong case, the config files will be now invalid.
```
2018-06-14 15:41:26 -07:00
Dr. Stefan Schimanski 9dfa97c595 apiextensions: add AddToGroupVersion call to CRD example register.go
Avoid `v1.ListOptions is not suitable for converting to ...` message in CRD client on List.
2018-06-14 22:32:35 +02:00
Chao Xu 7b0ffb8410 make json serializer case sensitive 2018-06-14 12:29:27 -07:00
Chao Xu dd69be30a5 vendor the latest json-iterator 2018-06-14 12:29:27 -07:00
Dr. Stefan Schimanski 99eda24de0 apiserver: add context to authn/authz kubeconfig errors 2018-06-14 15:31:02 +02:00
Andrew Lytvynov 2c0f043957 Re-use private key after failed CSR
If we create a new key on each CSR, if CSR fails the next attempt will
create a new one instead of reusing previous CSR.

If approver/signer don't handle CSRs as quickly as new nodes come up,
they can pile up and approver would keep handling old abandoned CSRs and
Nodes would keep timing out on startup.
2018-06-13 13:12:43 -07:00
Dr. Stefan Schimanski 1c67e1dcf3 apiextensions: enable CoreAPI options needed for admission 2018-06-13 16:40:20 +02:00
Dr. Stefan Schimanski 1208437f84 Update generated files 2018-06-13 12:35:13 +02:00
Dr. Stefan Schimanski d1bff9f8f4 bump(k8s.io/gengo): dcbe4570f0cf6efbc583a5321c8f9390f71a544d 2018-06-13 12:35:13 +02:00
xuzhonghu a8b0ccc70c add ut for audit useragent 2018-06-13 17:35:41 +08:00
Jordan Liggitt b39cd00982
Use actual etcd client for /healthz/etcd checks 2018-06-12 22:17:39 -04:00
Cao Shufeng 42b93ab724 [trivial] fix option help message.
s/andif/and if/
2018-06-13 09:07:34 +08:00
Rob Leidle 6ce74e4548 Correct several mistakes in the comments/doc for PollImmediate. 2018-06-12 11:21:26 -07:00
Jordan Liggitt 862f8567bb
Quiet verbose apiserver logs 2018-06-11 22:32:46 -04:00
Dmitry Rozhkov 4a72e17bd2 fix field removal in mutating admission webhooks
A mutating admission controller webhook doesn't remove object fields
when instructed to.

E.g. when the JSON patch

  [
    {"op": "remove", "path": "/spec/containers/0/resources/limits/fpga-arria10"},
    {"op": "add", "path": "/spec/containers/0/resources/limits/fpga-interface-id-524abcf", "value": 1}
  ]

is applied to this pod

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  restartPolicy: Never
  containers:
    -
      name: test-pod-container
      image: ubuntu:bionic
      imagePullPolicy: IfNotPresent
      command: [ "ls", "-l", "/" ]
      resources:
        limits:
          fpga-arria10: 1

in order to replace the resource name "fpga-arria10" with something understandable
by the device plugin the resulting pod spec still contains the old field plus
a new one. The resulting pod looks like

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  restartPolicy: Never
  containers:
    -
      name: test-pod-container
      image: ubuntu:bionic
      imagePullPolicy: IfNotPresent
      command: [ "ls", "-l", "/" ]
      resources:
        limits:
          fpga-arria10: 1
          fpga-interface-id-524abcf: 1

The patch unmarshals patched JSON into a new empty object instead of
existing one. Otherwise JSON unmarshaling reuses existing maps, keeping
existing entries as specified in the "encoding/json" standard package.
2018-06-11 12:22:31 +03:00
xuzhonghu b5990b78cb auto gen 2018-06-09 10:29:46 +08:00
Dr. Stefan Schimanski f0aca942c6 apimachinery: unify accessors to not deepcopy 2018-06-08 14:04:57 +02:00
xuzhonghu d066d547cc logging user-agent in audit 2018-06-08 17:25:41 +08:00
Jordan Liggitt 846cbe4e6b
Revert "Auto-generated code for the Vertical Pod Autoscaler API."
This reverts commit da65f30e2a.
2018-06-07 14:46:17 -04:00
Jordan Liggitt 4ac642cd11
Revert "Add Vertical Pod Autoscaling API to the autoscaling group."
This reverts commit 3f92d3fcda.
2018-06-07 14:46:17 -04:00
Jordan Liggitt 86c2158bb0
Fix up legacy printer table adapter 2018-06-07 13:20:04 -04:00
Kubernetes Submit Queue 63c90bb47e
Merge pull request #63797 from kgrygiel/master
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 Vertical Pod Autoscaler to autoscaling/v2beta1

**What this PR does / why we need it**:
Adds Vertical Pod Autoscaler (https://github.com/kubernetes/community/blob/master/contributors/design-proposals/autoscaling/vertical-pod-autoscaler.md) to the autoscaling API (which currently has the Horizontal Pod Autoscaler).
This is needed for the Vertical Pod Autoscaler beta.

**Special notes for your reviewer**:

/cc @thockin @mwielgus @DirectXMan12 

FYI. changes that add pkg/registry/autoscaling/verticalpodautoscaler/... will follow.

**Release note**:
```Add Vertical Pod Autoscaler to autoscaling/v2beta1.```
2018-06-06 22:54:08 -07:00
Mikhail Mazurskiy 102090d1f1
Use context.TODO() to be explicit that cancellation is not implemented 2018-06-07 14:33:03 +10:00
Mikhail Mazurskiy dc32a341c0
Cancellable leader election with context 2018-06-07 14:24:02 +10:00
Mikhail Mazurskiy 1d99fff1ac
Cancellable leader election with channels 2018-06-07 14:24:01 +10:00
kgrygiel da65f30e2a Auto-generated code for the Vertical Pod Autoscaler API. 2018-06-06 13:00:55 +02:00
kgrygiel 3f92d3fcda Add Vertical Pod Autoscaling API to the autoscaling group. 2018-06-06 13:00:55 +02:00
Kubernetes Submit Queue 0b8394a1f4
Merge pull request #64646 from freehan/pod-ready-plus2-new
Automatic merge from submit-queue (batch tested with PRs 63717, 64646, 64792, 64784, 64800). 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 ContainersReady condition into Pod Status

**Last 3 commits are new**

Follow up PR of: https://github.com/kubernetes/kubernetes/pull/64057 and https://github.com/kubernetes/kubernetes/pull/64344

Have a single PR for adding ContainersReady per https://github.com/kubernetes/kubernetes/pull/64344#issuecomment-394038384

```release-note
Introduce ContainersReady condition in Pod Status
```


/assign yujuhong for review
/assign thockin for the tiny API change
2018-06-06 01:24:14 -07:00
Kubernetes Submit Queue b6f75ac30e
Merge pull request #63717 from ingvagabund/promote-sysctl-annotations-to-fields
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>.

Promote sysctl annotations to fields

#


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

Promoting experimental sysctl feature from annotations to API fields.

**Special notes for your reviewer**:

Following sysctl KEP: https://github.com/kubernetes/community/pull/2093

**Release note**:

```release-note
The Sysctls experimental feature has been promoted to beta (enabled by default via the `Sysctls` feature flag). PodSecurityPolicy and Pod objects now have fields for specifying and controlling sysctls. Alpha sysctl annotations will be ignored by 1.11+ kubelets. All alpha sysctl annotations in existing deployments must be converted to API fields to be effective.
```

**TODO**:

* [x] - Promote sysctl annotation in Pod spec
* [x] - Promote sysctl annotation in PodSecuritySpec spec
* [x] - Feature gate the sysctl
* [x] - Promote from alpha to beta
* [x] - docs PR - https://github.com/kubernetes/website/pull/8804
2018-06-06 00:47:36 -07:00
hangaoshuai d3244afcde remove unused code in runtime/scheme_test.go 2018-06-06 10:26:33 +08:00
Kubernetes Submit Queue f1bfde4900
Merge pull request #64728 from mbohlool/crd_versioning_f5
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 mbohlool to apiextensions-apiserver reviewer list

@deads2k @sttts @liggitt @lavalamp
2018-06-05 15:32:20 -07:00
Jan Chaloupka 3cc15363bc Run make update 2018-06-06 00:12:40 +02:00
Jan Chaloupka ab616a88b9 Promote sysctl annotations to API fields 2018-06-05 23:17:00 +02:00
Kubernetes Submit Queue c279578862
Merge pull request #64766 from nikhita/allow-description-at-root
Automatic merge from submit-queue (batch tested with PRs 64276, 64094, 64719, 64766, 64750). 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>.

apiextensions: allow Description at root with status subresource

Allows `Description` at the root of the schema when the status subresource is enabled.

**Release note**:
I'll update the original PR, which allowed `Required`, to de-duplicate the release notes.


```release-note
NONE
```

/assign sttts
2018-06-05 11:35:21 -07:00
Kubernetes Submit Queue d12d8bd64b
Merge pull request #64719 from davidz627/feature/CSIv0.3
Automatic merge from submit-queue (batch tested with PRs 64276, 64094, 64719, 64766, 64750). 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 container-storage-interface/spec dependency to v0.3.0

Also updated golang/protobuf to v1.1.0 to satisfy hard requirement of new CSI Spec version

/sig storage
/kind enhancement
/assign @saad-ali

```release-note
Updated Container Storage Interface specification version to v0.3.0
```
2018-06-05 11:35:17 -07:00
Minhan Xia 6b08ef575f add ContainersReady condition 2018-06-05 11:10:38 -07:00
Nikhita Raghunath 0528e96928 apiextensions: allow Description in the root schema for subresources 2018-06-05 19:05:07 +05:30
Kubernetes Submit Queue f73101066a
Merge pull request #58647 from oracle/for/upstream/master/hostpath-psp-readonly
Automatic merge from submit-queue (batch tested with PRs 64344, 64709, 64717, 63631, 58647). 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 enforcing read only host paths in PSPs. 

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

This PR adds support for the PSP to enforce that host paths are readonly. 

**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 #57371
xref https://github.com/kubernetes/features/issues/5

**Special notes for your reviewer**:

**Release note**:

```release-note
PodSecurityPolicy now supports restricting hostPath volume mounts to be readOnly and under specific path prefixes
```

/cc @ericchiang @liggitt
2018-06-05 02:16:21 -07:00
Kubernetes Submit Queue 77d996b278
Merge pull request #63233 from lichuqiang/provision_api
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>.

API change for volume topology aware dynamic provisioning

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

Split PR https://github.com/kubernetes/kubernetes/pull/63193 for better review
part 2: API change

Previous: https://github.com/kubernetes/kubernetes/pull/63232
Next: https://github.com/kubernetes/kubernetes/pull/63193

**Which issue(s) this PR fixes** 
Feature: https://github.com/kubernetes/features/issues/561
Design: https://github.com/kubernetes/community/issues/2168

**Special notes for your reviewer**:
/sig storage
/sig scheduling
/assign @msau42 @jsafrane @thockin 


**Release note**:

```release-note
API change for volume topology aware dynamic provisioning
```
2018-06-05 00:56:17 -07:00
Kubernetes Submit Queue 9fceab1d83
Merge pull request #64235 from liggitt/gc-resync-reattempt
Automatic merge from submit-queue (batch tested with PRs 62266, 64351, 64366, 64235, 64560). 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>.

Avoid deadlock in gc resync if available resources change during sync

retry GC sync if waiting for cache sync times out, without unpausing workers

viewing ignoring whitespace reveals the actual change:
https://github.com/kubernetes/kubernetes/pull/64235/files?w=1

xref https://github.com/kubernetes/kubernetes/pull/61057 https://github.com/kubernetes/kubernetes/pull/56446#discussion_r153381426

```release-note
fixes a potential deadlock in the garbage collection controller
```
2018-06-04 18:44:20 -07:00
lichuqiang 20654393ee generated files 2018-06-05 09:44:10 +08:00
lichuqiang 9a77899ee5 API changes for Topology aware dynamic provisioning 2018-06-05 09:27:02 +08:00
Kubernetes Submit Queue 819d51567f
Merge pull request #64482 from ericchiang/exec-plugin-beta
Automatic merge from submit-queue (batch tested with PRs 63453, 64592, 64482, 64618, 64661). 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: promote exec plugin support to beta

/sig auth
/kind feature

Adds a "v1beta1" API group for client authentication. Because of a lack of usage with the input parameters, these have been dropped for the beta. Would like to re-introduce them as users feel they require them.

updates https://github.com/kubernetes/kubernetes/issues/61796

```release-note
client-go: credential exec plugins have been promoted to beta
```
2018-06-04 16:56:15 -07:00
Josh Horwitz c7fbcf35da Add support for enforcing read only host paths in PSPs. 2018-06-04 19:10:37 -04:00
David Zhu cc3fb7e861 staging godep update 2018-06-04 15:49:56 -07:00
Kubernetes Submit Queue 46d2b47156
Merge pull request #57963 from vikaschoudhary16/priorityclass
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>.

Introduce priority class in the resource quota

**What this PR does / why we need it**:
Implements https://github.com/kubernetes/community/pull/933
**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 #48648 

**Special notes for your reviewer**:
Test Cases are still to be covered. Opening this PR to make discussion convenient with code references.
Will update test cases only after design PR has got merged.

**Release note**:

```release-note
Ability to quota resources by priority
```
/kind feature
/priority important-soon
/sig scheduling
/sig node
/cc @resouer @derekwaynecarr @sjenning @bsalamat @timstclair @aveshagarwal @ravisantoshgudimetla
2018-06-04 15:11:00 -07:00
Mehdy Bohlool dc7b36b333 Add mbohlool to apiextensions-apiserver reviewer list 2018-06-04 15:05:25 -07:00
vikaschoudhary16 3cfe6412c7 Introduce priority class in the resource quota 2018-06-04 16:14:54 -04:00
Kubernetes Submit Queue 08c15a6a38
Merge pull request #58143 from CaoShuFeng/audit_annotation_another_version
Automatic merge from submit-queue (batch tested with PRs 61610, 64591, 58143, 63929). 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 PodSecurityPolicy information to audit logs

Depends on: https://github.com/kubernetes/kubernetes/pull/58806
Fix #56209

**Release note**:
```release-note
PodSecurityPolicy admission information is added to audit logs
```
2018-06-04 12:26:21 -07:00
Dr. Stefan Schimanski 808bd3703a apimachinery: do not fuzz ObjectMeta.{Labels/Annotation} with empty keys 2018-06-04 14:58:40 +00:00
Cao Shufeng 241422879d Log policy name from pod security policy 2018-06-04 19:24:25 +08:00
Cao Shufeng c38a704fb7 add WithAudit admission decorator
WithAudit admission decorator log annotations to audit events set by
the decorated admission controller
2018-06-04 19:24:22 +08:00
Cao Shufeng 72ef2dc724 support AddAnnotation in admission attributes 2018-06-04 19:24:18 +08:00
Yuanbin.Chen a055a96791 Fix TestWantsExternalKubeClientSet describe clientset typo
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-06-04 18:32:56 +08:00
Kubernetes Submit Queue 6466794b77
Merge pull request #64481 from immutableT/transormer-metrics-2
Automatic merge from submit-queue (batch tested with PRs 64481, 64569). 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>.

Instrument envelop transformer.

**What this PR does / why we need it**:
Add metrics for envelope transformer: 
   transformation_operation_count
   transformation_failures_count
   envelope_transformation_cache_misses_count
   data_key_generation_latencies_microseconds
   data_key_generation_failures_count

**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-06-03 13:13:03 -07:00
Davanum Srinivas 877b801531 Updated generated files 2018-06-02 22:20:39 -04:00
Davanum Srinivas 5fa8a2412d API updates for Cinder Volumes to support for user specified Secrets in the future 2018-06-02 22:16:50 -04:00
Kubernetes Submit Queue 0ecfd343b3
Merge pull request #64267 from sttts/sttts-crd-objectmeta-pruning
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>.

apiextensions: add ObjectMeta validation and pruning

This is a critical pre-requisite for further multi-version support and especially for GA of CRDs: ObjectMeta must be schema-validated and pruned, like `json.Unmarshal` does this.

This PR adds this in the incoming request serializer and the storage decoder. The former errors when schema validation fails, the later just drops invalid typed fields.

Fixes #59451

```release-note
Meta data of CustomResources is now pruned and schema checked during deserialization of requests and when read from etcd. In the former case, invalid meta data is rejected, in the later it is dropped from the CustomResource objects.
```
2018-06-02 12:55:36 -07:00
Kubernetes Submit Queue c22a32bdbf
Merge pull request #64641 from sttts/sttts-ObjectConvertor-invariant
Automatic merge from submit-queue (batch tested with PRs 64641, 64532). 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>.

apimachinery: adapt ObjectConvertor invariant

We avoid deepcopies in the codec/conversion stack by re-using data structures. This means that the out object of a conversion must be deepcopied before mutation in order to not mutate the in object as well.

This guarantees that e.g. runtime.Encode (which uses conversion from internal -> versioned) does not mutate the input. This would be highly unexpected (and we do not mention possible mutation of the input for runtime.Encode).
2018-06-02 09:15:04 -07:00
Kubernetes Submit Queue 160e8d96f6
Merge pull request #64639 from sttts/sttts-int64-json
Automatic merge from submit-queue (batch tested with PRs 64613, 64596, 64573, 64154, 64639). 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>.

printers: fix json types  – int64 is only allowed integer

We have the invariant in apimachinery that all integers in JSON are int64. We panic on other types on deepcopy and possibly at other occasions.
2018-06-02 06:30:22 -07:00
Kubernetes Submit Queue e5686a3668
Merge pull request #64154 from gnufied/impelemnt-volume-count
Automatic merge from submit-queue (batch tested with PRs 64613, 64596, 64573, 64154, 64639). 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 dynamic volume limits

Implement dynamic volume limits depending on node type.

xref https://github.com/kubernetes/community/pull/2051

```release-note
Add Alpha support for dynamic volume limits based on node type
```
2018-06-02 06:30:19 -07:00
Kubernetes Submit Queue c3bb41ad4b
Merge pull request #64596 from apelisse/openapi-some-cleanup
Automatic merge from submit-queue (batch tested with PRs 64613, 64596, 64573, 64154, 64639). 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>.

Openapi some cleanup

Clean-up some OpenAPI code, mostly test related (there are two implementations of "Fake").
This is going for master, but I'll probably also cherry-pick/create a similar PR for feature-serverside-apply branch since we'll need that to move some code around.

**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-06-02 06:30:13 -07:00
Dr. Stefan Schimanski ebbfaf3869 printers: fix json types – int64 is only allowed integer
We have the invariant in apimachinery that all integers in JSON are int64.
We panic on other types on deepcopy and possibly at other occasions.
2018-06-02 09:43:20 +00:00
Kubernetes Submit Queue c7b71ebca9
Merge pull request #64408 from luxas/kubeadm_refactor_bt
Automatic merge from submit-queue (batch tested with PRs 64057, 63223, 64346, 64562, 64408). 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>.

kubeadm: Refactor the Bootstrap Tokens usage in the API types

**What this PR does / why we need it**:
This PR:
 - Moves some common, generic Bootstrap Token helpers and constants from `k8s.io/kubernetes/cmd/kubeadm/app/util/token` to `k8s.io/client-go/tools/bootstrap/token/`
 - Breaks out the top-level Bootstrap Token fields to a dedicated `BootstrapToken` struct with helper functions.
 - Instead of representing the Bootstrap Token as a plain `string`, there is now a wrapper struct `BootstrapTokenString` that can marshal/unmarshal correctly and supports validation on create, and splitting up the full token in the ID/Secret parts automatically.
 - Makes kubeadm support multiple Bootstrap Tokens automatically by supporting a slice of `BootstrapToken` in the `MasterConfiguration` API object
 - Consolidates the place for kubeadm to create token-related flags in an `options` package
 - Supports automatic conversion from the `v1alpha1` to `v1alpha2` API
 - Adds support to set token expiration directly instead of setting a TTL (Expiration and TTL are mutually exclusive)
 - Removes the old `TokenDiscovery` struct we're not using anymore inside of kubeadm

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Related to https://github.com/kubernetes/community/pull/2131

**Special notes for your reviewer**:
This is work in progress. Please only review the first two commits for now.
I will work on splitting up this PR in smaller chunks.
I will also write unit tests tomorrow.

**Release note**:

```release-note
[action required] kubeadm: The Token-related fields in the `MasterConfiguration` object have now been refactored. Instead of the top-level `.Token`, `.TokenTTL`, `.TokenUsages`, `.TokenGroups` fields, there is now a `BootstrapTokens` slice of `BootstrapToken` objects that support the same features under the `.Token`, `.TTL`, `.Usages`, `.Groups` fields.
```
@kubernetes/sig-cluster-lifecycle-pr-reviews @mattmoyer @liztio
2018-06-02 02:10:18 -07:00
Kubernetes Submit Queue 10d0c5c19e
Merge pull request #64346 from dims/deprecate-in-tree-keystone-plugin
Automatic merge from submit-queue (batch tested with PRs 64057, 63223, 64346, 64562, 64408). 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>.

Deprecate the in-tree keystone plugin

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

We now have the `client-keystone-auth` in cloud-provider-openstack
repository:
https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/using-client-keystone-auth.md

So let's drop the in-tree one, so we can remove it in 1.12


**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
in-tree support for openstack credentials is now deprecated. please use the "client-keystone-auth" from the cloud-provider-openstack repository. details on how to use this new capability is documented here - https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/using-client-keystone-auth.md
```
2018-06-02 02:10:11 -07:00
Minhan Xia bfa9c1091e make update 2018-06-01 16:19:15 -07:00
Minhan Xia 10465ee4a7 add ReadinessGates in pod spec 2018-06-01 16:19:14 -07:00
Hemant Kumar 45fb31ec07 Implement API changes needed for dynamic volume limits
define alpha feature and make api changes
2018-06-01 19:17:25 -04:00
immutablet 695c3e32ad Add metrics for envelop transformer:
transformation_operation_count
    transformation_failures_count
    envelope_transformation_cache_misses_count
    data_key_generation_latencies_microseconds
    data_key_generation_failures_count
2018-06-01 23:00:08 +00:00
Jordan Liggitt 268dc570e7
Add wait.PollImmediateUntil 2018-06-01 18:53:50 -04:00
Dr. Stefan Schimanski ff6f4803d9 apimachinery: adapt ObjectConvertor invariant
We avoid deepcopies in the codec/conversion stack by re-using data structures.
This means that the out object of a conversion must be deepcopied before mutation
in order to not mutate the in object as well.

This guarantees that e.g. runtime.Encode (which uses conversion from internal -> versioned)
does not mutate the input. This would be highly unexpected (and we do not mention possible
mutation of the input for runtime.Encode).
2018-06-01 22:31:27 +00:00
Eric Chiang d96fd39651
client-go: make exec auth and auth provider mutually exclusive 2018-06-01 14:28:11 -07:00
Eric Chiang 2069827239
generated:
./hack/update-bazel.sh
	./hack/update-codegen.sh
	./hack/update-staging-godeps.sh
2018-06-01 14:28:07 -07:00
Eric Chiang 0a9164e73a
client-go: promote exec plugin support to beta 2018-06-01 14:28:01 -07:00
Eric Chiang 8952b8f7c9
clientauthentication: add v1beta1 API version 2018-06-01 14:27:57 -07:00
Kubernetes Submit Queue 5da925ad4f
Merge pull request #64262 from jessfraz/SECURITY_CONTACTS
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 PST to main SECURITY_CONTACTS as formality

Add the Product Security Team as the security contacts for the main
repository and they can use the OWNERS files in each subsystem/dir to find
the correct owners.

cc @liggitt @cjcullen @tallclair @philips 

```release-note
NONE
```

closes #64265


Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2018-06-01 14:23:49 -07:00
Kubernetes Submit Queue bbf5625630
Merge pull request #64567 from ncdc/code-generator-run-from-anywhere
Automatic merge from submit-queue (batch tested with PRs 63348, 63839, 63143, 64447, 64567). 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-gen: support running from anywhere

**What this PR does / why we need it**:
Support running generate-groups.sh from any directory, so users can run
it from their own projects, instead of forcing them to run it from here.
This allows the generators to find and use go source code from a
project's vendor directory, for example.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-01 12:12:27 -07:00
Kubernetes Submit Queue 7e449a3660
Merge pull request #63348 from smarterclayton/improve_phase
Automatic merge from submit-queue (batch tested with PRs 63348, 63839, 63143, 64447, 64567). 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 pod phase documentation

This is documentation that should be visible directly when a user runs `kubectl explain pod.status`.
2018-06-01 12:12:12 -07:00
Dr. Stefan Schimanski 1db0024ec9 apiextensions: add ObjectMeta schema validation and pruning 2018-06-01 17:43:07 +00:00
Antoine Pelisse 000510d9b7 Replace openapi Fake with kube-openapi version
There are two version of this fake class, let's just use that one
version.
2018-06-01 09:50:05 -07:00
xuzhonghu 57393ec932 fix go import 2018-06-01 14:05:44 +08:00
Clayton Coleman dcabc3026d
Update pod phase documentation 2018-06-01 00:34:52 -04:00
Kubernetes Submit Queue b706e6612a
Merge pull request #63777 from hzxuzhonghu/dynamic-logging-verbosity
Automatic merge from submit-queue (batch tested with PRs 59938, 63777, 64577, 63999, 64431). 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>.

Support dynamiclly set glog.logging.verbosity

Support dynamically set glog logging level, which is convenient for debug.

**Release note**:

```release-note
Expose `/debug/flags/v` to allow dynamically set glog logging level, if want to change glog level to 3, you only have to send a PUT request with like `curl -X PUT http://127.0.0.1:8080/debug/flags/v -d "3"`.
```
2018-05-31 21:29:11 -07:00
Kubernetes Submit Queue 26caa84d09
Merge pull request #63445 from ericchiang/deprecate-git-repo-volume
Automatic merge from submit-queue (batch tested with PRs 63445, 63820). 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>.

core v1: deprecate the gitRepo volume type

gitRepo stopped accepting new features nearly 2 years ago https://github.com/kubernetes/kubernetes/issues/17676#issuecomment-228650586 and today this behavior can easily be achieved through an init container. The kubelet shelling out to git in the host namespace can also be a security issue on un-trusted repos, as was demonstrated by [CVE-2017-1000117](https://groups.google.com/forum/#!topic/kubernetes-announce/CTLXJ74cu8M). Our own documentation even alludes to this volume type being removed in the future:

> In the future, such volumes may be moved to an even more decoupled model, rather than extending the Kubernetes API for every such use case.

https://kubernetes.io/docs/concepts/storage/volumes/#gitrepo

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

```release-note-action-required
The GitRepo volume type is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.
```

/release-note-action-required

Instead of this:

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: server
spec:
  containers:
  - image: nginx
    name: nginx
    volumeMounts:
    - mountPath: /mypath
      name: git-volume
  volumes:
  - name: git-volume
    gitRepo:
      repository: "git@somewhere:me/my-git-repository.git"
      revision: "22f1d8406d464b0c0874075539c1f2e96c253775"
```

Do this:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: git-clone
data:
  git-clone.sh: |
    #!/bin/sh -e
    git clone $1 $3
    cd $3
    git reset --hard $2
---
apiVersion: v1
kind: Pod
metadata:
  name: server
spec:
  initContainers:
  - name: git-clone
    image: alpine/git # Any image with git will do
    command:
    - /usr/local/git/git-clone.sh
    args:
    - "https://somewhere/me/my-git-repository.git"
    - "22f1d8406d464b0c0874075539c1f2e96c253775"
    - "/mypath"
    volumeMounts:
    - name: git-clone
      mountPath: /usr/local/git
    - name: git-repo
      mountPath: /mypath
  containers:
  - image: nginx
    name: nginx
    volumeMounts:
    - mountPath: /mypath
      name: git-volume
  volumes:
  - name: git-volume
    emptyDir: {}
  - name: git-clone
    configMap:
      name: git-clone
      defaultMode: 0755
```
2018-05-31 16:20:07 -07:00
Lucas Käldström 33f59e438e
Move helper funcs and constants to the client-go Bootstrap Token package from kubeadm 2018-05-31 22:18:27 +03:00
Andy Goldstein c5d43d082a code-gen: support running from anywhere
Support running generate-groups.sh from any directory, so users can run
it from their own projects, instead of forcing them to run it from here.
This allows the generators to find and use go source code from a
project's vendor directory, for example.

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
2018-05-31 15:05:00 -04:00
Zhonghu Xu 9561269d93
remove inaccurate comment about watch timeout 2018-05-31 16:20:04 +08:00
Kubernetes Submit Queue 374992a6fb
Merge pull request #63819 from mikedanese/svacctproj-api
Automatic merge from submit-queue (batch tested with PRs 64364, 64369, 63819, 64528). 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 APIs for service account volume projection

ref https://github.com/kubernetes/kubernetes/issues/58790

designed in https://github.com/kubernetes/community/pull/1973

Release note will be included in the implementation.
```release-note
NONE
```
2018-05-30 22:54:11 -07:00
Kubernetes Submit Queue 483b6a6264
Merge pull request #64369 from idealhack/sub-benchmarks/apiserver/aes
Automatic merge from submit-queue (batch tested with PRs 64364, 64369, 63819, 64528). 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: update tests to use sub-benchmarks (aes_test.go)

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

Go 1.7 added the subtest feature which can make table-driven tests much easier to run and debug. Some tests are not using this feature.

Further reading: [Using Subtests and Sub-benchmarks](https://blog.golang.org/subtests)

/kind cleanup

**Release note**:

```release-note
NONE
```
2018-05-30 22:54:08 -07:00
xuzhonghu 73a22b2e61 Support dynamicly set logging verbosity 2018-05-31 09:56:24 +08:00
Kubernetes Submit Queue 305d053182
Merge pull request #64443 from deads2k/server-16-aggregate-tight
Automatic merge from submit-queue (batch tested with PRs 57082, 64325, 64016, 64443, 64403). 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>.

services must listen on port 443 for aggregation

If a clusterIP service isn't listening on port 443, don't mark it as available.

@mfojtik you've got an issue, right?
@kubernetes/sig-api-machinery-bugs 
/assign @sttts 

/kind bug

```release-note
NONE
```
2018-05-30 18:49:20 -07:00
Kubernetes Submit Queue b5d21a92ad
Merge pull request #64339 from liztio/pronouns
Automatic merge from submit-queue (batch tested with PRs 61803, 64305, 64170, 64361, 64339). 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 some unnecessarily gendered pronouns in comments

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

A bunch of comments are unnecessarily gendered. I've changed them to gender-neutral they/theirs.

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-30 17:34:25 -07:00
Kubernetes Submit Queue f701b75299
Merge pull request #61803 from awly/client-auth-exec-tls
Automatic merge from submit-queue (batch tested with PRs 61803, 64305, 64170, 64361, 64339). 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 TLS support to exec authenticator plugin

**What this PR does / why we need it**:
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auth/kubectl-exec-plugins.md#tls-client-certificate-support

Allows exec plugin to return raw TLS key/cert data. This data populates
transport.Config.TLS field.
This requires a change to AuthProvider interface to expose TLS configs,
not only RoundTripper.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Exec authenticator plugin supports TLS client certificates.
```
2018-05-30 17:34:11 -07:00
Eric Chiang f8f5f045a7
generated: update generated API files
Commands run:

	./hack/update-api-reference-docs.sh
	./hack/update-generated-protobuf.sh
	./hack/update-generated-swagger-docs.sh
	./hack/update-openapi-spec.sh
	./hack/update-swagger-spec.sh
2018-05-30 16:52:42 -07:00
Kubernetes Submit Queue ea92879fab
Merge pull request #62306 from freehan/pod-status-patch2
Automatic merge from submit-queue (batch tested with PRs 58920, 58327, 60577, 49388, 62306). 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 Patch instead of Put to sync pod status

ref: https://github.com/kubernetes/community/blob/master/keps/sig-network/0007-pod-ready%2B%2B.md
```release-note
Use Patch instead of Put to sync pod status
```
2018-05-30 16:09:36 -07:00
Kubernetes Submit Queue 5cf652d899
Merge pull request #60577 from timchenxiaoyu/fixpersist
Automatic merge from submit-queue (batch tested with PRs 58920, 58327, 60577, 49388, 62306). 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 persist typo

I wonder this pr should pull to kubernetes/kubernetes  or  kubernetes/client-go ?

```
NONE
```
2018-05-30 16:09:28 -07:00
Kubernetes Submit Queue 22919ae7e1
Merge pull request #58920 from victorgp/master
Automatic merge from submit-queue (batch tested with PRs 58920, 58327, 60577, 49388, 62306). 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>.

Possible cipher suites values and tls versions in help for apiserver and kubelet

**What this PR does / why we need it**:
Addresses a suggestion made by @lavalamp to list the possible TLS cipher suites in the kubelet and apiserver helps: https://github.com/kubernetes/kubernetes/pull/48859#discussion_r162413223

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

**Special notes for your reviewer**:
This pull request only adds to the help message the possible values of the TLS Cipher suites for Kubelet and api server.
It is an addition to the already merged PR https://github.com/kubernetes/kubernetes/pull/48859

The help output looks like this:

```
      --tls-cert-file string                                    File containing the default x509 Certificate for HTTPS. (CA cert, if any, concatenated after server cert). If HTTPS serving is enabled, and --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key are generated for the public address and saved to the directory specified by --cert-dir.
      --tls-cipher-suites strings                               Comma-separated list of cipher suites for the server. Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). If omitted, the default Go cipher suites will be use.  Possible values: TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_3DES_EDE_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_RC4_128_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
      --tls-min-version string                                  Minimum TLS version supported. Value must match version names from https://golang.org/pkg/crypto/tls/#pkg-constants.
      --tls-private-key-file string                             File containing the default x509 private key matching --tls-cert-file.

```

**Release note**:
```release-note
NONE
```
2018-05-30 16:09:20 -07:00
Eric Chiang 759e74cca0
core v1: deprecate the gitRepo volume type 2018-05-30 15:20:08 -07:00
Andrew Lytvynov cd89f9473f Add TLS support to exec authenticator plugin
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auth/kubectl-exec-plugins.md#tls-client-certificate-support

Allows exec plugin to return raw TLS key/cert data. This data populates
transport.Config.TLS fields.
transport.Config.TLS propagates custom credentials using
tls.Config.GetClientCertificate callback.
On key/cert rotation, all connections using old credentials are
closed
2018-05-30 14:03:32 -07:00
Minhan Xia 78b86333c1 make update 2018-05-30 11:33:55 -07:00
Minhan Xia 8b3b4e4dea add Patch support in fake kubeClient 2018-05-30 11:33:51 -07:00
Mike Danese 514d280e2f autogenerated 2018-05-30 11:06:58 -07:00
Yang Li 19026bf962 apiserver: update tests to use sub-benchmarks (aes_test.go) 2018-05-31 01:34:14 +08:00
Guoliang Wang 17ad3eaa26 replace fmt.Sprintf(%s, i.Type()) with i.Type().String() 2018-05-30 18:18:58 +08:00
Yang Li 6647b92c86 apiserver: update tests to use sub-benchmarks (secretbox_test.go) 2018-05-30 17:34:36 +08:00
Kubernetes Submit Queue 15cd355281
Merge pull request #64213 from dashpole/eviction_event_annotation
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 metadata to kubelet eviction event annotations

**What this PR does / why we need it**:
Add annotations to kubelet eviction events.  Annotations include 
"offending_containers" : comma-seperated list of containers.
"offending_containers_usage": comma-seperated list of usage.
"starved_resource": v1.ResourceName of the starved resource

**Special notes for your reviewer**:
Adding annotations to events required changing the `EventRecorder` interface to add a `AnnotatedEventf` function, which can add annotations to an event.

**Release note**:
```release-note
NONE
```
/assign @dchen1107 
cc @mwielgus @schylek @kgrygiel
2018-05-29 23:37:47 -07:00
Victor Garcia 3dfa22e3fd Possible cipher suites values and tls versions in help for apiserver and kubelet 2018-05-29 22:23:07 -07:00
Mike Danese fd39d8277c add api for service account token volume projection 2018-05-29 21:50:05 -07:00
Davanum Srinivas ffe817fcab
Deprecate the in-tree keystone plugin
We now have the `client-keystone-auth` in cloud-provider-openstack
repository:
https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/using-client-keystone-auth.md

So let's drop the in-tree one, so we can remove it in 1.12
2018-05-29 16:05:37 -04:00
Kubernetes Submit Queue 10b9fd3a01
Merge pull request #64314 from sttts/sttts-start-fresh-client-go-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>.

client-go: start fresh with owner file

After client-go's OWNER file has grown to 50ish many reviewers, It's time to start fresh and re-add those who really want to review. Please don't be shy to come forward if you want to stay on that list. I will re-add you.
2018-05-29 13:05:00 -07:00
Jacob Tanenbaum 1a0eb8c7b6 Improve unit tests for InstallPathHandler
When adding InstallPathHandler it was suggested to follow-up with an improvement to the unit tests.
2018-05-29 13:50:37 -04:00
Kubernetes Submit Queue 0c837a36ac
Merge pull request #64421 from sttts/sttts-client-go-dot-github
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>.

client-go: document README exception in .github/PULL_REQUEST_TEMPLATE.md

Follow-up of https://github.com/kubernetes/client-go/pull/423.
2018-05-29 09:55:18 -07:00
Dr. Stefan Schimanski 11f65b2a30 client-go: start fresh with owner file 2018-05-29 14:59:48 +02:00
David Eads b3ce7a9935 services must listen on port 443 2018-05-29 08:28:41 -04:00
Jacob Tanenbaum 14a03dd646 Modify LoopbackHostPort() so it returns an IPv6 Loopback address when given [::] address
Currently when LoopbackHostPort() is called with 0.0.0.0 and [::] it returns the first loopback
address returned from net.InterfaceAddrs() which is typically 127.0.0.1 (golang does not
specify an order that interfaces are returned). It would be more appropriate if when calling
LoopbackHostPort() with [::] that an IPv6 loopback address is returned, this prevents some cert.
generation failures.
2018-05-29 08:25:51 -04:00
Marko Mudrinić 2bf66c377d
apiextensions-apiserver: add establishing controller to avoid race between established and CRs actually served 2018-05-29 13:46:47 +02:00
Kubernetes Submit Queue 1e0af48f11
Merge pull request #64300 from wgliang/master.fix-64244
Automatic merge from submit-queue (batch tested with PRs 64300, 64375). 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>.

HandleError include the type of the error object

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

HandleError include the type of the error object


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

**Special notes for your reviewer**:
/cc @MikeSpreitzer

**Release note**:

```release-note
NONE
```
2018-05-29 04:22:06 -07:00
Dr. Stefan Schimanski f6d4244c30 client-go: document README exception in .github/PULL_REQUEST_TEMPLATE.md 2018-05-29 09:16:25 +02:00
Dr. Stefan Schimanski 96475ce209 Update generated files 2018-05-28 10:56:58 +02:00
Dr. Stefan Schimanski ecdc1638f6 apiextensions-apiserver: add columns to CRD spec 2018-05-28 10:56:58 +02:00
Jordan Liggitt 2d28e0d6a3
bump(github.com/evanphx/json-patch): 94e38aa1586e8a6c8a75770bddf5ff84c48a106b 2018-05-25 22:29:07 -04:00
liz ffeca16101
Remove some unnecessarily gendered pronouns in comments 2018-05-25 17:48:17 -04:00
Kubernetes Submit Queue c0f91a8a1e
Merge pull request #63414 from roycaihw/fix-delete-query
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 conversion to properly parse query parameter propagationPolicy

**What this PR does / why we need it**:
This delete request query parameter has been broken for a year. I'm not sure if we want to deprecate the non-standard DeleteOptions body on delete request eventually. 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
API server properly parses propagationPolicy as a query parameter sent with a delete request
```

/sig api-machinery
2018-05-25 06:59:05 -07:00
Kubernetes Submit Queue deb632e727
Merge pull request #64204 from sttts/sttts-unify-NewNoxuInstance
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>.

apiextensions: unify mono- and multi-versioned test helpers

The mono-versioned helpers are a special case of the multi-versioned ones.

Fixes part of https://github.com/kubernetes/kubernetes/issues/64136.
2018-05-25 04:49:37 -07:00