Commit Graph

2379 Commits (29a11be60a8cda3503e7ffadb5dc98cd57eb40ce)

Author SHA1 Message Date
Dr. Stefan Schimanski db8903ba35 Add sttts to code-generator OWNERS 2017-09-07 10:34:33 +02:00
Clayton Coleman 8b571bb63b
Disable default paging in list watches
For 1.8 this will be off by default. In 1.9 it will be on by default.
Add tests and rename some fields to use the `chunking` terminology.

Note that the pager may be used for other things besides chunking.
2017-09-06 23:10:59 -04:00
Shiyang Wang 0084d70b56 move specialDefaultResourcePrefixes out of vendor/k8s.io/apiserver 2017-09-07 10:19:30 +08:00
Kubernetes Submit Queue 3168bd4b12 Merge pull request #50708 from DirectXMan12/versions/autoscaling-v2beta1
Automatic merge from submit-queue (batch tested with PRs 51956, 50708)

Move autoscaling/v2 from alpha1 to beta1

This graduates autoscaling/v2alpha1 to autoscaling/v2beta1.  The move is more-or-less just a straightforward rename.

Part of kubernetes/features#117

```release-note
v2 of the autoscaling API group, including improvements to the HorizontalPodAutoscaler, has moved from alpha1 to beta1.
```
2017-09-06 15:46:24 -07:00
Kubernetes Submit Queue d369160c79 Merge pull request #50842 from CaoShuFeng/remove_versioned_test_from_filters
Automatic merge from submit-queue (batch tested with PRs 49133, 51557, 51749, 50842, 52018)

enhance unit tests of advance audit feature

This change addresses comments from @crassirostris 
https://github.com/kubernetes/kubernetes/pull/49115#discussion_r133416080

It does three things:
1. use auditinternal for unit test in filter stage
2. add a seperate unit test for Audit-ID http header
3. add unit test for audit log backend


**Release note**:
```
NONE
```
2017-09-06 13:36:15 -07:00
Chao Xu 4d1d33af46 bazel 2017-09-06 10:21:01 -07:00
Chao Xu b0c83c72c1 Charge quota for uninitialized objects at different time
Charge object count when object is created, no matter if the object is
initialized or not.
Charge the remaining quota when the object is initialized.

Also, checking initializer.Pending and initializer.Result when
determining if an object is initialized. We didn't need to check them
because before 51082, having 0 pending initializer and nil
initializers.Result is invalid.
2017-09-06 10:20:32 -07:00
Kubernetes Submit Queue 7be29bd9b6 Merge pull request #51943 from CaoShuFeng/feature_gate
Automatic merge from submit-queue

set AdvancedAuditing feature gate to true by default

All feature commits are merged. The types are updated already to beta. This only enable the feature gate by default.

**Release note**:
```
Promote the AdvancedAuditing feature to beta and enable the feature gate by default.
```
2017-09-06 06:54:30 -07:00
CaoShufeng c030026b54 enhance unit tests of advance audit feature
This change does three things:
    1. use auditinternal for unit test in filter stage
    2. add a seperate unit test for Audit-ID http header
    3. add unit test for audit log backend
2017-09-06 21:31:14 +08:00
Kubernetes Submit Queue 0076f02df0 Merge pull request #51653 from DirectXMan12/versions/metrics-v2beta1
Automatic merge from submit-queue (batch tested with PRs 51603, 51653)

Graduate metrics/v1alpha1 to v1beta1

This introduces v1beta1 of the resource metrics API, previously in alpha.
The v1alpha1 version remains for compatibility with the Heapster legacy version
of the resource metrics API, which is compatible with the v1alpha1 version.  It also
renames the v1beta1 version to `resource-metrics.metrics.k8s.io`.

The HPA controller's REST clients (but not the legacy client) have been migrated as well.

Part of kubernetes/features#118.

```release-note
Migrate the metrics/v1alpha1 API to metrics/v1beta1.  The HorizontalPodAutoscaler
controller REST client now uses that version.  For v1beta1, the API is now known as
resource-metrics.metrics.k8s.io.
```
2017-09-06 02:55:12 -07:00
Kubernetes Submit Queue 795154919d Merge pull request #51733 from caesarxuchao/only-relax-uninitialized-pod-validation
Automatic merge from submit-queue (batch tested with PRs 51733, 51838)

Relax update validation of uninitialized pod

Split from https://github.com/kubernetes/kubernetes/pull/50344

Fix https://github.com/kubernetes/kubernetes/issues/47837

* Let the podStrategy to only call `validation.ValidatePod()` if the old pod is not initialized, so fields are mutable.
* Let the podStatusStrategy refuse updates if the old pod is not initialized.

cc @smarterclayton 

```release-note
Pod spec is mutable when the pod is uninitialized. The apiserver requires the pod spec to be valid even if it's uninitialized. Updating the status field of uninitialized pods is invalid.
```
2017-09-06 00:02:17 -07:00
Kubernetes Submit Queue bd4aaf4d40 Merge pull request #51921 from liggitt/local-apiservice
Automatic merge from submit-queue

Improve APIService auto-registration for HA/upgrade scenarios

Fixes #51912

Required for 1.8 due to impact on HA upgrades.

/assign @deads2k

cc @kubernetes/sig-api-machinery-bugs

```release-note
Fixes an issue with APIService auto-registration affecting rolling HA apiserver restarts that add or remove API groups being served.
```
2017-09-05 20:38:21 -07:00
Kubernetes Submit Queue 9a8cb435b7 Merge pull request #51795 from dims/bug-fix-51755
Automatic merge from submit-queue (batch tested with PRs 51984, 51351, 51873, 51795, 51634)

Bug Fix - Adding an allowed address pair wipes port security groups

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

Fix for cloud routes enabled instances will have their security groups
removed when the allowed address pair is added to the instance's port.

Upstream bug report is in:
https://github.com/gophercloud/gophercloud/issues/509

Upstream bug fix is in:
https://github.com/gophercloud/gophercloud/pull/510

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

Fixes #51755

**Special notes for your reviewer**:

Just an fix in vendored code. minimal changes needed in OpenStack cloud provider

**Release note**:

```release-note
NONE
```
2017-09-05 18:40:31 -07:00
Kubernetes Submit Queue b6a0bb1a16 Merge pull request #51873 from luxas/enable_e2e_multiarch
Automatic merge from submit-queue (batch tested with PRs 51984, 51351, 51873, 51795, 51634)

Build test targets for all server platforms

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

🤦

I really should have checked this before code freeze, but tbh forgot it in the rush. Also I thought this was the case already...
As part of https://github.com/kubernetes/features/issues/288; these binaries should be built for all server platforms indeed.

This is just a straightforward add to that list.
Can we please get this into v1.8?
There is virtually no risk involved here really...

**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
Build test targets for all server platforms
```
@ixdy @jdumars @mkumatag
2017-09-05 18:40:28 -07:00
Kubernetes Submit Queue 6430a2732f Merge pull request #51351 from cmluciano/cml/addegressrule
Automatic merge from submit-queue (batch tested with PRs 51984, 51351, 51873, 51795, 51634)

Add EgressRule to NetworkPolicy

**What this PR does / why we need it**:
Add EgressRule to NetworkPolicy

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

**Special notes for your reviewer**:
- Please take a look at the comments for the various types. I tried to mimic some of the language used in the Ingress comments, but I may have mangled some sentences.
- Let me know if I should add some test cases for validation. I have 2-3, and did not think it was necessary to replicate each case already covered in ingress.

**Release note**:
```
Add egress policies to NetworkPolicy
```
2017-09-05 18:40:25 -07:00
Kubernetes Submit Queue 99aa992ce8 Merge pull request #51751 from dashpole/update_cadvisor_godep
Automatic merge from submit-queue (batch tested with PRs 51186, 50350, 51751, 51645, 51837)

Update Cadvisor Dependency

Fixes: https://github.com/kubernetes/kubernetes/issues/51832
This is the worst dependency update ever... 
The root of the problem is the [name change of Sirupsen -> sirupsen](https://github.com/sirupsen/logrus/issues/570#issuecomment-313933276).  This means that in order to update cadvisor, which venders the lowercase, we need to update all dependencies to use the lower-cased version.  With that being said, this PR updates the following packages:

`github.com/docker/docker`
- `github.com/docker/distribution`
  - `github.com/opencontainers/go-digest`
  - `github.com/opencontainers/image-spec`
  - `github.com/opencontainers/runtime-spec`
  - `github.com/opencontainers/selinux`
  - `github.com/opencontainers/runc`
    - `github.com/mrunalp/fileutils`
  - `golang.org/x/crypto`
    - `golang.org/x/sys`
- `github.com/docker/go-connections`
- `github.com/docker/go-units`
- `github.com/docker/libnetwork`
- `github.com/docker/libtrust`
- `github.com/sirupsen/logrus`
- `github.com/vishvananda/netlink`

`github.com/google/cadvisor`
- `github.com/euank/go-kmsg-parser`

`github.com/json-iterator/go`

Fixed https://github.com/kubernetes/kubernetes/issues/51832

```release-note
Fix journalctl leak on kubelet restart
Fix container memory rss
Add hugepages monitoring support
Fix incorrect CPU usage metrics with 4.7 kernel
Add tmpfs monitoring support
```
2017-09-05 17:30:06 -07:00
Solly Ross b0af402475 Move Autoscaling v2{alpha1 --> beta1}
This commit renames autoscaling/v2alpha1 to autoscaling/v2beta1.
Only the API-related code is moved in this commit.
2017-09-05 17:49:30 -04:00
Jim Minter e18eeb2d63 ProducesObject should only update the returned API object resource documentation 2017-09-05 16:16:13 -05:00
Chao Xu 659a689782 use validatePod to validate update of uninitialized pod
add UninitializedStatusUpdateErrorMsg
2017-09-05 13:43:44 -07:00
Solly Ross e1a22e8cae Rename metrics to metrics.k8s.io
This commit renames metrics to metrics.k8s.io
for the v1beta1 version, to give it a properly namespaced name which
mirrors custom.metrics.k8s.io.
2017-09-05 16:11:55 -04:00
Solly Ross 580b28e2d5 Graduate metrics/v1alpha1 to v1beta1
This commit graduates them resource metrics API from v1alpha1
to v1beta1.
2017-09-05 16:09:50 -04:00
David Ashpole e5a6a79fd7 update cadvisor, docker, and runc godeps 2017-09-05 12:38:57 -07:00
Christopher M. Luciano b94b8fb28a
Add cmluciano to NetworkPolicy reviewers 2017-09-05 14:14:27 -04:00
Jordan Liggitt 8ca6d9994e
Sync local APIService objects once 2017-09-05 13:12:28 -04:00
Jordan Liggitt d353adc467
Make local APIService objects available on create 2017-09-05 13:12:27 -04:00
Christopher M. Luciano 84290ce35c
EgressRule generated code 2017-09-05 12:48:55 -04:00
Christopher M. Luciano 90b139897e
Add PolicyTypes to NetworkPolicy Spec
Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2017-09-05 12:16:19 -04:00
Christopher M. Luciano b03302f905
Add EgressRule to NetworkPolicy
Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
2017-09-05 12:01:07 -04:00
Michał Stachowski 2dba8f1715 Support for hugetlbfs in empty dir volume plugin 2017-09-05 17:15:49 +02:00
Derek Carr afd8045ed7 HugePage changes in API and server 2017-09-05 09:46:08 -04:00
Cao Shufeng 1388426898 set AdvancedAuditing feature gate to true by default 2017-09-05 16:55:32 +08:00
Cao Shufeng 22f4c1ad4d fix docstring of advanced audit policy 2017-09-05 15:28:19 +08:00
wackxu 4ab3f45001 add verify case in index_test.go 2017-09-05 14:18:35 +08:00
Kubernetes Submit Queue 870406bec5 Merge pull request #47367 from derekwaynecarr/event-spam
Automatic merge from submit-queue

Add client side event spam filtering

**What this PR does / why we need it**:
Add client side event spam filtering to stop excessive traffic to api-server from internal cluster components.

this pr defines a per source+object event budget of 25 burst with refill of 1 every 5 minutes.

i tested this pr on the following scenarios:

**Scenario 1: Node with 50 crash-looping pods**
```
$ create 50 crash-looping pods on a single node
$ kubectl run bad --image=busybox --replicas=50 --command -- derekisbad
```
Before:
* POST events with peak of 1.7 per second, long-tail: 0.2 per second
* PATCH events with peak of 5 per second, long-tail: 5 per second

After:
* POST events with peak of 1.7 per second, long-tail: 0.2 per second
* PATCH events with peak of 3.6 per second, long-tail: 0.2 per second

Observation:
* https://github.com/kubernetes/kubernetes/pull/47462 capped the number of total events in the long-tail as expected, but did nothing to improve total spam of master.

**Scenario 2: replication controller limited by quota**
```
$ kubectl create quota my-quota --hard=pods=1
$ kubectl run nginx --image=nginx --replicas=50
```
Before:
* POST events not relevant as aggregation worked well here.
* PATCH events with peak and long-tail of 13.6 per second

After:
* POST events not relevant as aggregation worked well here.
* PATCH events with peak: .35 per second, and long-tail of 0

**Which issue this PR fixes**
fixes https://github.com/kubernetes/kubernetes/issues/47366

**Special notes for your reviewer**:
this was a significant problem in a kube 1.5 cluster we are running where events were co-located in a single etcd.  this cluster was normal to have larger numbers of unhealty pods as well as denial by quota.

**Release note**:
```release-note
add support for client-side spam filtering of events
```
2017-09-04 16:13:47 -07:00
Kubernetes Submit Queue 57c3c2c0bc Merge pull request #51909 from sttts/sttts-51908
Automatic merge from submit-queue

audit: fix fuzzer

Fixes #51908.
2017-09-04 12:13:40 -07:00
Dr. Stefan Schimanski 58dd0879a7 audit: fix fuzzer 2017-09-04 18:10:17 +02:00
Kubernetes Submit Queue 9d29ce1356 Merge pull request #49280 from CaoShuFeng/RequestReceived
Automatic merge from submit-queue

Provide a way to omit Event stages in audit policy

This provide a way to omit some stages for each audit policy rule.
    
For example:

    ```
      apiVersion: audit.k8s.io/v1beta1
      kind: Policy
      - level: Metadata
        resources:
           - group: "rbac.authorization.k8s.io"
             resources: ["roles"]
        omitStages:
          - "RequestReceived"
    ```
    
RequestReceived stage will not be emitted to audit backends with previous config.


**Release note**:

```
None
```
#
2017-09-04 05:07:10 -07:00
Cao Shufeng b50acbdf01 generated: update API resources
./hack/update-codegen.sh
./hack/update-generated-protobuf.sh
2017-09-04 17:52:10 +08:00
Cao Shufeng 47ba91450f Provide a way to omit Event stages in audit policy
Updates https://github.com/kubernetes/kubernetes/issues/48561
This provide a way to omit some stages for each audit policy rule.

For example:
  apiVersion: audit.k8s.io/v1beta1
  kind: Policy
  - level: Metadata
    resources:
       - group: "rbac.authorization.k8s.io"
         resources: ["roles"]
    omitStages:
      - "RequestReceived"

RequestReceived stage will not be emitted to audit backends with
previous config.
2017-09-04 17:51:59 +08:00
tengqm acad74670d Fix apiserver help message 2017-09-04 17:23:21 +08:00
Hemant Kumar 84029c2c1a Update generated files - api, bazel, json
Update all generated files json, protocolbuffers,
documentation
2017-09-04 09:02:35 +02:00
Hemant Kumar e78d433150 Implement necessary API changes
Introduce feature gate for expanding PVs
Add a field to SC
Add new Conditions and feature tag pvc update
Add tests for size update via feature gate
register the resize admission plugin
Update golint failures
2017-09-04 09:02:34 +02:00
Kubernetes Submit Queue 0f8febf1b4 Merge pull request #51868 from sttts/sttts-fix-client-go-build
Automatic merge from submit-queue (batch tested with PRs 51845, 51868, 51864)

client-go: fix 'go build ./...'
2017-09-03 21:31:58 -07:00
Kubernetes Submit Queue 6ec80eac1b Merge pull request #51816 from liggitt/xiangpengzhao-remove-initc-anno
Automatic merge from submit-queue

Remove deprecated init-container in annotations

fixes #50655
fixes #51816 
closes #41004
fixes #51816 

Builds on #50654 and drops the initContainer annotations on conversion to prevent bypassing API server validation/security and targeting version-skewed kubelets that still honor the annotations

```release-note
The deprecated alpha and beta initContainer annotations are no longer supported. Init containers must be specified using the initContainers field in the pod spec.
```
2017-09-03 17:35:11 -07:00
Kubernetes Submit Queue 52b50fa82a Merge pull request #51828 from kow3ns/workloads-deprecations-1.8
Automatic merge from submit-queue

Workloads deprecation 1.8

**What this PR does / why we need it**: This PR deprecates the Deployment, ReplicaSet, and DaemonSet kinds in the extensions/v1beta1 group version and the StatefulSet, Deployment, and ControllerRevision kinds in the apps/v1beta1 group version. The Deployment, ReplicaSet, DaemonSet, StatefuSet, and ControllerRevision kinds in the apps/v1beta2 group version are now the current version.

xref kubernetes/features#353

```release-note
The Deployment, DaemonSet, and ReplicaSet kinds in the extensions/v1beta1 group version are now deprecated, as are the Deployment, StatefulSet, and ControllerRevision kinds in apps/v1beta1. As they will not be removed until after a GA version becomes available, you may continue to use these kinds in existing code. However, all new code should be developed against the apps/v1beta2 group version.
```
2017-09-03 16:44:46 -07:00
Kubernetes Submit Queue a31bc44b38 Merge pull request #51500 from m1093782566/fix-kube-proxy-panic
Automatic merge from submit-queue (batch tested with PRs 51819, 51706, 51761, 51818, 51500)

fix kube-proxy panic because of nil sessionAffinityConfig

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

fix kube-proxy panic because of nil sessionAffinityConfig

**Which issue this PR fixes**: closes #51499 

**Special notes for your reviewer**:

I apology that this bug is introduced by #49850 :(

@thockin @smarterclayton @gnufied 

**Release note**:

```release-note
NONE
```
2017-09-03 15:00:15 -07:00
Kubernetes Submit Queue bee221cca9 Merge pull request #51638 from mfojtik/client-gen-custom-methods
Automatic merge from submit-queue (batch tested with PRs 51805, 51725, 50925, 51474, 51638)

Allow custom client verbs to be generated using client-gen

This change will allow to define custom verbs for resources using the following new tag:

```
// +genclient:method=Foo,verb=create,subresource=foo,input=Bar,output=k8s.io/pkg/api.Blah
```

This will generate client method `Foo(bar *Bar) (*api.Blah, error)` (format depends on the particular verb type)

With this change we can add `UpdateScale()` and `GetScale()` into all scalable resources. Note that intention of this PR is not to fix the Scale(), but that is used as an example of this new capability.
Additionally this will also allow us to get rid of `// +genclient:noStatus` and fix guessing of the "updateStatus" subresource presence based on the existence of '.Status' field.
Basically you will have to add following into all types you want to generate `UpdateStatus()` for:

```
// +genclient:method=UpdateStatus,verb=update,subresource=status
```

This allows further extension of the client without writing an expansion (which proved to be pain to maintain and copy...). Also allows to customize native CRUD methods if needed (input/output types).

```release-note
NONE
```
2017-09-03 11:10:09 -07:00
Kubernetes Submit Queue 4d42f80382 Merge pull request #50925 from staebler/server-event-rate-limiter
Automatic merge from submit-queue (batch tested with PRs 51805, 51725, 50925, 51474, 51638)

Limit events accepted by API Server

**What this PR does / why we need it**:
This PR adds the ability to limit events processed by an API server. Limits can be set globally on a server, per-namespace, per-user, and per-source+object. This is needed to prevent badly-configured or misbehaving players from making a cluster unstable.

Please see https://github.com/kubernetes/community/pull/945.

**Release Note:**
```release-note
Adds a new alpha EventRateLimit admission control that is used to limit the number of event queries that are accepted by the API Server.
```
2017-09-03 11:10:03 -07:00
Lucas Käldström 64be85e9de
Fix arm (32-bit) e2e.test compile failure 2017-09-03 18:49:29 +03:00
Kubernetes Submit Queue f24eb1da7c Merge pull request #51803 from deads2k/server-01-authz-evaluation
Automatic merge from submit-queue (batch tested with PRs 50579, 50875, 51797, 51807, 51803)

make url parsing in apiserver configurable

We have known cases where the attributes for a request are assigned differently.  The kubelet is one example.  This makes the value an interface, not a struct, and provides a hook for (non-default) users to override it.
2017-09-03 08:46:31 -07:00
Kubernetes Submit Queue 3a987b0168 Merge pull request #51797 from CaoShuFeng/protobuf
Automatic merge from submit-queue (batch tested with PRs 50579, 50875, 51797, 51807, 51803)

update generated protobuf for audit v1beta1 api

**Release note**:
```
NONE
```
2017-09-03 08:46:26 -07:00
Kubernetes Submit Queue d970eb8f94 Merge pull request #50875 from ericchiang/oidc-claims-prefix
Automatic merge from submit-queue (batch tested with PRs 50579, 50875, 51797, 51807, 51803)

oidc auth: make the OIDC claims prefix configurable

Add the following flags to control the prefixing of usernames and
groups authenticated using OpenID Connect tokens.

	--oidc-username-prefix
	--oidc-groups-prefix

```release-note
The OpenID Connect authenticator can now use a custom prefix, or omit the default prefix, for username and groups claims through the --oidc-username-prefix and --oidc-groups-prefix flags. For example, the authenticator can map a user with the username "jane" to "google:jane" by supplying the "google:" username prefix.
```

Closes https://github.com/kubernetes/kubernetes/issues/50408
Ref https://github.com/kubernetes/kubernetes/issues/31380

cc @grillz @kubernetes/sig-auth-pr-reviews @thomastaylor312 @gtaylor
2017-09-03 08:46:23 -07:00
Kubernetes Submit Queue ab27bc9e6e Merge pull request #50579 from erhudy/bugfix/29271-accept-prefixed-namespaces
Automatic merge from submit-queue

Fixes kubernetes/kubernetes#29271: accept prefixed namespaces

**What this PR does / why we need it**: `kubectl get namespaces -o name` outputs the names of all namespaces, prefixed with `namespaces/`. This changeset allows these namespace names to be passed directly back in to `kubectl` via the `-n` flag without reprocessing them to remove `namespaces/`.

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

**Special notes for your reviewer**:

**Release note**:

```NONE
```
2017-09-03 08:33:24 -07:00
Dr. Stefan Schimanski 48cba8a44f client-go: fix 'go build ./...'
Test-only directories seem to confuse go-build and make it fail. We do this as
a smoke test in the github publishing bot.
2017-09-03 16:19:09 +02:00
Kubernetes Submit Queue 75e111ad87 Merge pull request #50864 from mbohlool/update_openapi_aggr
Automatic merge from submit-queue

Improvements to OpenAPI aggregation

Fixes #50863
Fixes #50011
Related: #50896
2017-09-03 06:54:50 -07:00
Kubernetes Submit Queue ea1d10543f Merge pull request #51719 from soltysh/audit_switch_beta
Automatic merge from submit-queue

Switch audit output to v1beta1

This PR adds two switches to pick preferred version for webhook and log backends, and it switches to use `audit.k8s.io/v1beta1` as default for both.

@sttts @crassirostris ptal

**Release note**:
```release-note
Switch to audit.k8s.io/v1beta1 in audit.
```
2017-09-03 04:14:09 -07:00
mbohlool b9eacd0bf5 update bazel
update OpenAPI spec

update staging godeps
2017-09-03 02:18:14 -07:00
mbohlool 76e24f216f Consolidate local OpenAPI specs and APIServices' spec into one data structure
Remove APIService OpenAPI spec when it is deleted

Add eTag support and returning httpStatus to OpenAPI spec downloader

Update aggregated OpenAPI spec periodically

Use delegate chain

Refactor OpenAPI aggregator to have separate controller and aggregation function

Enable OpenAPI spec for extensions api server

Do not filter paths. higher priority specs wins the conflicting paths

Move OpenAPI aggregation controller to pkg/controller/openapi
2017-09-03 02:16:08 -07:00
mbohlool 7cbdb90890 Provide whole delegate chain to kube aggregator 2017-09-03 02:16:08 -07:00
Kubernetes Submit Queue 1d43050372 Merge pull request #51703 from deads2k/discovery-02-scale
Automatic merge from submit-queue (batch tested with PRs 50602, 51561, 51703, 51748, 49142)

expose discovery information on scalable resources

Builds on https://github.com/kubernetes/kubernetes/pull/49971 and provides the GroupVersion information that can be used by a dynamic scale client.

@kubernetes/sig-api-machinery-pr-reviews 
@foxish @DirectXMan12 since you both asked for it.
2017-09-03 01:12:09 -07:00
Kubernetes Submit Queue 134b667d0a Merge pull request #48184 from CaoShuFeng/impersonate_audit
Automatic merge from submit-queue (batch tested with PRs 51301, 50497, 50112, 48184, 50993)

audit newest impersonated user info in the ResponseStarted, ResponseComplete audit stage

Impersonation will automatically add system:authenticated, system:serviceaccounts group to the impersonated user info. This pr use the newest impersonated user info in the second audit event. This will help users to debug rbac problems.

**Release note**:

```
[advanced audit] audit newest impersonated user info in the ResponseStarted, ResponseComplete audit stage
```
@liggitt @sttts
2017-09-02 23:50:05 -07:00
Kubernetes Submit Queue 5c0b265a9b Merge pull request #50497 from dixudx/kubectl-include-uninitialized
Automatic merge from submit-queue (batch tested with PRs 51301, 50497, 50112, 48184, 50993)

Introduce new flag "--include-uninitialized" to kubectl

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

Introduce `--include-uninitialized` as a global flag to kubectl

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

**Special notes for your reviewer**:
/assign @caesarxuchao @smarterclayton @ahmetb @deads2k 

**Release note**:

```release-note
Add flag "--include-uninitialized" to kubectl annotate, apply, edit-last-applied, delete, describe, edit, get, label, set. "--include-uninitialized=true" makes kubectl commands apply to uninitialized objects, which by default are ignored if the names of the objects are not provided. "--all" also makes kubectl commands apply to uninitialized objects. Please see the [initializer](https://kubernetes.io/docs/admin/extensible-admission-controllers/) doc for more details.
```
2017-09-02 23:50:00 -07:00
Kubernetes Submit Queue 52e3fdacbb Merge pull request #51538 from kow3ns/less-ugly-names
Automatic merge from submit-queue (batch tested with PRs 51553, 51538, 51663, 51069, 51737)

Consistent Names for ControllerRevisions, ReplicaSets, and objects using GenerateName

**What this PR does / why we need it**:
Adds the rand.SafeEncodeString function and uses this function to generate names for ReplicaSets and ControllerRevisions.

```release-note
The names generated for ControllerRevision and ReplicaSet are consistent with the GenerateName functionality of the API Server and will not contain "bad words".
```
2017-09-02 21:57:59 -07:00
Kubernetes Submit Queue 12f96e2e35 Merge pull request #51283 from caesarxuchao/fix-initializer-validate
Automatic merge from submit-queue (batch tested with PRs 51583, 51283, 51374, 51690, 51716)

Unify initializer name validation

Unify the validation rules on initializer names. Fix https://github.com/kubernetes/kubernetes/issues/51843.

```release-note
Action required: validation rule on metadata.initializers.pending[x].name is tightened. The initializer name needs to contain at least three segments separated by dots. If you create objects with pending initializers, (i.e., not relying on apiserver adding pending initializers according to initializerconfiguration), you need to update the initializer name in existing objects and in configuration files to comply to the new validation rule.
```
2017-09-02 20:35:22 -07:00
Kubernetes Submit Queue 5c2e1ebaec Merge pull request #51583 from atlassian/fix-unstructured-codec
Automatic merge from submit-queue

Do not mutate original UnstructuredList even temporarily to avoid data races

**What this PR does / why we need it**:
See #51521.

**Which issue this PR fixes**:
Fixes #51521.

**Release note**:
```release-note
NONE
```
/kind bug
/sig api-machinery
2017-09-02 20:14:04 -07:00
Kubernetes Submit Queue fc3b8bd58b Merge pull request #51712 from nikhita/add-maximum-validation
Automatic merge from submit-queue (batch tested with PRs 50832, 51119, 51636, 48921, 51712)

apiextensions: add maximum for validation

Missed the `Maximum` field for validation. Adding it now.

**Release note**:

```release-note
NONE
```

/cc @sttts
2017-09-02 19:26:32 -07:00
Kubernetes Submit Queue 35ffb5c6cf Merge pull request #48921 from smarterclayton/paging_prototype
Automatic merge from submit-queue (batch tested with PRs 50832, 51119, 51636, 48921, 51712)

Alpha list paging implementation

Design in kubernetes/community#896

Support `?limit=NUMBER`, `?continue=CONTINUATIONTOKEN`, and a `continue` field
on ListMeta and pass through to etcd. Perform minor validation as an example.

```
# first out of three
$ curl http://127.0.0.1:8080/api/v1/namespaces?limit=1
{
  "kind": "NamespaceList",
  "apiVersion": "v1",
  "metadata": {
    "selfLink": "/api/v1/namespaces",
    "resourceVersion": "146",
    "next": "ZGVmYXVsdA"
  },
  "items": [
    {
      "metadata": {
        "name": "default",
        "selfLink": "/api/v1/namespaces/default",
        "uid": "f95e1390-6852-11e7-ab03-7831c1b76042",
        "resourceVersion": "4",
        "creationTimestamp": "2017-07-14T05:12:03Z"
      },
      "spec": {
        "finalizers": [
          "kubernetes"
        ]
      },
      "status": {
        "phase": "Active"
      }
    }
  ]
}
...
# last
$ curl "http://127.0.0.1:8080/api/v1/namespaces?limit=1&continue=a3ViZS1wdWJsaWM"
{
  "kind": "NamespaceList",
  "apiVersion": "v1",
  "metadata": {
    "selfLink": "/api/v1/namespaces",
    "resourceVersion": "145"
  },
  "items": [
    {
      "metadata": {
        "name": "kube-system",
        "selfLink": "/api/v1/namespaces/kube-system",
        "uid": "f95e9484-6852-11e7-ab03-7831c1b76042",
        "resourceVersion": "5",
        "creationTimestamp": "2017-07-14T05:12:03Z"
      },
      "spec": {
        "finalizers": [
          "kubernetes"
        ]
      },
      "status": {
        "phase": "Active"
      }
    }
  ]
}
```
2017-09-02 19:26:29 -07:00
Kubernetes Submit Queue f4c6cbdf38 Merge pull request #51119 from soltysh/failed_authn_audit
Automatic merge from submit-queue (batch tested with PRs 50832, 51119, 51636, 48921, 51712)

Allow audit to log authorization failures

**What this PR does / why we need it**:
This PR extends our current audit mechanism allowing to audit failed login attempts. 

**Release note**:

```release-note
Advanced audit allows logging failed login attempts
```
2017-09-02 19:26:23 -07:00
Kubernetes Submit Queue d375e1595f Merge pull request #50920 from DirectXMan12/versions/custom-metrics-v2beta1
Automatic merge from submit-queue (batch tested with PRs 51335, 51364, 51130, 48075, 50920)

Graduate custom metrics API to v1beta1

This graduates custom-metrics.metrics.k8s.io/v1alpha1 to custom-metrics.metrics.k8s.io/v1beta1.  The move is more-or-less just a straightforward rename.

Part of kubernetes/features#117 and kubernetes/features#118

```release-note
the custom metrics API (custom-metrics.metrics.k8s.io) has moved from v1alpha1 to v1beta1
```
2017-09-02 18:18:57 -07:00
Kubernetes Submit Queue 73ed961b8e Merge pull request #48075 from clamoriniere1A/feature/job_failure_policy
Automatic merge from submit-queue (batch tested with PRs 51335, 51364, 51130, 48075, 50920)

[API] Feature/job failure policy

**What this PR does / why we need it**: Implements the Backoff policy and failed pod limit defined in https://github.com/kubernetes/community/pull/583

**Which issue this PR fixes**: 
fixes #27997, fixes #30243

**Special notes for your reviewer**:
This is a WIP PR, I updated the api batchv1.JobSpec in order to prepare the backoff policy implementation in the JobController.

**Release note**:
```release-note
Add backoff policy and failed pod limit for a job
```
2017-09-02 18:18:54 -07:00
Kubernetes Submit Queue 94d9457e4e Merge pull request #51130 from luxas/fake_discovery
Automatic merge from submit-queue (batch tested with PRs 51335, 51364, 51130, 48075, 50920)

Add the possibility to set return values for the FakeDiscovery implementation

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

As an user of the fake clientset (with the fake discovery), I want to be able to set the fake server's version on demand like this for example:

```go
func TestFakingServerVersion(t *testing.T) {
	client := fakeclientset.NewSimpleClientset()
	fakeDiscovery, ok := client.Discovery().(*fakediscovery.FakeDiscovery)
	if !ok {
		t.Fatalf("couldn't convert Discovery() to *FakeDiscovery")
	}

	testGitCommit := "v1.0.0"
	fakeDiscovery.FakedServerVersion = &version.Info{
		GitCommit: testGitCommit,
	}

	sv, err := client.Discovery().ServerVersion()
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	if sv.GitCommit != testGitCommit {
		t.Fatalf("unexpected faked discovery return value: %q", sv.GitCommit)
	}
}
```

This PR makes that possible, in wait for a more sophisticated FakeDiscovery implementation generally.

**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
```
@kubernetes/sig-api-machinery-pr-reviews
2017-09-02 18:18:51 -07:00
Kubernetes Submit Queue fe3e748276 Merge pull request #44310 from MHBauer/healthz-logging
Automatic merge from submit-queue

basic logging and additional documentation for healthz installer

@pmorie upstream logging
 - InstallHandler is the public interface through which all interaction
   occurs.
 - It is good to know whether the default ping is occurring to know due
   to manual installation or automatic installation.
 - It is good to know how many handlers are installed to see whether
   code changes are taking effect.

**What this PR does / why we need it**:
add logging for external users of the genericapiserver

**Special notes for your reviewer**:
This should run exactly once at startup. 

**Release note**:
```release-note
NONE
```
2017-09-02 13:47:34 -07:00
Kubernetes Submit Queue 8d6160abda Merge pull request #51056 from thockin/missing-conversion-peer
Automatic merge from submit-queue (batch tested with PRs 45724, 48051, 46444, 51056, 51605)

Add v1 API as a default conversion peer

Some of the APIs call do not this out, and a partial build produces
wrong results.
2017-09-02 12:11:10 -07:00
Kubernetes Submit Queue 11a836078d Merge pull request #46444 from jsafrane/node-mount-propagation
Automatic merge from submit-queue (batch tested with PRs 45724, 48051, 46444, 51056, 51605)

Mount propagation in kubelet

Together with #45724 it implements mount propagation as proposed in https://github.com/kubernetes/community/pull/659

There is:

- New alpha annotation that allows user to explicitly set propagation mode for each `VolumeMount` in pod containers (to be replaced with real `VolumeMount.Propagation` field during beta) + validation + tests. "Private" is the default one (= no change to existing pods).

  I know about proposal for real API fields for alpha feature in https://docs.google.com/document/d/1wuoSqHkeT51mQQ7dIFhUKrdi3-1wbKrNWeIL4cKb9zU/edit, but it seems it's not implemented yet. It would save me quite lot of code and ugly annotation.

- Updated CRI API to transport chosen propagation to Docker.

- New `kubelet --experimental-mount-propagation` option to enable the previous bullet without modifying types.go (worked around with changing `KubeletDeps`... not nice, but it's better than adding a parameter to `NewMainKubelet` and removing it in the next release...)

```release-note
kubelet has alpha support for mount propagation. It is disabled by default and it is there for testing only. This feature may be redesigned or even removed in a future release.
```

@derekwaynecarr @dchen1107 @kubernetes/sig-node-pr-reviews
2017-09-02 12:11:07 -07:00
Kubernetes Submit Queue c84b3132a2 Merge pull request #48051 from xilabao/add-selfsubjectrulesreview-api
Automatic merge from submit-queue (batch tested with PRs 45724, 48051, 46444, 51056, 51605)

Add selfsubjectrulesreview in authorization

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

**Which issue this PR fixes**: fixes #47834 #31292

**Special notes for your reviewer**:

**Release note**:

```release-note
Add selfsubjectrulesreview API for allowing users to query which permissions they have in a given namespace.
```
/cc @deads2k @liggitt
2017-09-02 12:11:04 -07:00
Cao Shufeng ea519bc060 update generated protobuf for audit v1beta1 api 2017-09-02 13:35:59 +08:00
Davanum Srinivas 74a3d89ad4 Bug Fix - Adding an allowed address pair wipes port security groups
Fix for cloud routes enabled instances will have their security groups
removed when the allowed address pair is added to the instance's port.

Upstream bug report is in:
https://github.com/gophercloud/gophercloud/issues/509

Upstream bug fix is in:
https://github.com/gophercloud/gophercloud/pull/510
2017-09-01 20:56:13 -04:00
Kenneth Owens 5d9748bc2b auto generated 2017-09-01 14:30:53 -07:00
Kenneth Owens e71f999d5c Deprecates extension/v1beta DaemonSet Deployment and ReplicaSet
Deprecates apps/v1beta1 Deployment StatefulSet and ControllerRevision
2017-09-01 14:24:37 -07:00
Michail Kargakis 3988a37361
Update d.spec.progressDeadlineSeconds comment 2017-09-01 22:00:47 +02:00
Jan Safranek d48c7faf24 Regenerate API 2017-09-01 21:36:33 +02:00
Jan Safranek c49e34fd17 Add API for mount propagation.
In fact, this is one annotation + its parsing & validation. Appropriate
kubelet logic that uses this annotation is in following patches.
2017-09-01 21:36:32 +02:00
Michail Kargakis b1d99e9f7e
Update d.status.unavailableReplicas api comment 2017-09-01 21:19:12 +02:00
Solly Ross 48cca6b6cb Rename custom metrics API to custom.metrics.k8s.io
This renames custom-metrics.metrics.k8s.io to custom.metrics.k8s.io,
in order to reduce stutter in the API name.
2017-09-01 15:08:31 -04:00
Solly Ross 89a56a3cee Move HPA to use custom-metrics/v1beta1
This commit migrates the HPA metrics clients to use the beta version of
the custom metrics API.
2017-09-01 15:08:31 -04:00
Solly Ross 98b1a08d7e Move custom metrics APIs to v1beta1
This commit moves the custom metrics APIs and clients from v1alpha1
to v1beta1.
2017-09-01 15:08:30 -04:00
cedric lamoriniere 228693622b Generate files from v1.JobSpec modification
This commit contains the new version of generated api files linked
to the v1.JobSpec modifications in the previous commit after
"make update"
2017-09-01 21:01:48 +02:00
cedric lamoriniere 3989b18586 update API v1 Job object
Add new fields in api v1.JobSpec object for backoff policy
- BackoffLimit
- FailedPodsLimit

fixes: https://github.com/kubernetes/community/pull/583
2017-09-01 21:01:29 +02:00
staebler a4542ae528 Create an EventRateLimit admission control plug-in for the API Server.
The EventRateLimit plug-in limits the number of events that the API Server
will accept in a given time period. It allows for server-wide, per-namespace,
per-user,and per-source+object rate limiting.
2017-09-01 13:38:03 -04:00
David Eads ccc7c9bdfa make url parsing in apiserver configurable 2017-09-01 12:56:06 -04:00
Kubernetes Submit Queue 92db97dfcc Merge pull request #50007 from CaoShuFeng/apiversion_apigroup
Automatic merge from submit-queue (batch tested with PRs 51632, 51055, 51676, 51560, 50007)

Split APIVersion into APIGroup and APIVersion in audit events 

audit.Event.ObjectRef.APIVersion currently holds both the the API group and
version, separated by a /. This change break these out into separate fields.


**Release note**:

```
NONE
```
2017-09-01 08:27:22 -07:00
Kubernetes Submit Queue ed53363c54 Merge pull request #51676 from huangjiuyuan/fix-struct-comment
Automatic merge from submit-queue (batch tested with PRs 51632, 51055, 51676, 51560, 50007)

fixing a typo in staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go

**What this PR does / why we need it**:
Fix a typo in `staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.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-09-01 08:27:16 -07:00
David Eads 65d0f188f6 expose discovery information on scalable resources 2017-09-01 10:52:26 -04:00
Clayton Coleman 9b8e42afa6
generated: api changes 2017-09-01 10:49:56 -04:00
Clayton Coleman 19eb61085a
API for server paging
Adds a `continue` and `limit` parameter to ListOptions
2017-09-01 10:49:53 -04:00
Clayton Coleman 8952a0cb72
Server side implementation of paging for etcd3
Add a feature gate in the apiserver to control whether paging can be
used. Add controls to the storage factory that allow it to be disabled
per resource. Use a JSON encoded continuation token that can be
versioned. Create a 410 error if the continuation token is expired.

Adds GetContinue() to ListMeta.
2017-09-01 10:47:01 -04:00
Clayton Coleman 500b130ff0
Enable paging for all list watchers 2017-09-01 10:47:01 -04:00
Clayton Coleman fb68d1d3a7
Add a new paging utility for client side ranging 2017-09-01 10:46:57 -04:00
Michal Fojtik 7d2be1c521
generate UpdateScale and GetScale verbs for scalable resources 2017-09-01 14:25:46 +02:00
Michal Fojtik ba731a6cca
update bazel 2017-09-01 14:25:46 +02:00
Michal Fojtik b1a3235fd4
code-generator: allow to customize generated verbs and add custom verb 2017-09-01 14:25:46 +02:00
Michal Fojtik c026b62d19
add missing sub-resources test actions 2017-09-01 14:25:45 +02:00
xilabao 790374da10 create the methods in the generated expansion files 2017-09-01 19:15:59 +08:00
Chen Rong ed8adf6e51 generated 2017-09-01 19:11:19 +08:00
xilabao f14c138438 add selfsubjectrulesreview api 2017-09-01 19:09:43 +08:00
Mikhail Mazurskiy 483ee1853b
Do not mutate original object even temporarily to avoid data races 2017-09-01 20:42:48 +10:00
Maciej Szulik f3487f08c6
Switch audit output to v1beta1 2017-09-01 12:36:25 +02:00
Kubernetes Submit Queue 6a845c67f0 Merge pull request #48287 from thockin/json-iterator
Automatic merge from submit-queue

Use json-iterator instead of ugorji for JSON.

@smarterclayton @wojtek-t

Fixes #36120
xref #18762

```release-note
Switch JSON marshal/unmarshal to json-iterator library.  Performance should be close to previous with no generated code.
```
2017-09-01 02:04:56 -07:00
m1093782566 1faa6f56b9 fix kube-proxy panic 2017-09-01 16:18:03 +08:00
Kubernetes Submit Queue d56f6ef816 Merge pull request #49971 from deads2k/discovery-01-group
Automatic merge from submit-queue (batch tested with PRs 49971, 51357, 51616, 51649, 51372)

add information for subresource kind determination

xref https://github.com/kubernetes/kubernetes/issues/38810 https://github.com/kubernetes/kubernetes/issues/38756

Polymorphic subresources usually have different groupVersions for their discovery kinds than their "native" groupVersions.  Even though the APIResourceList shows the kind properly, it does not reflect the group or version of that kind, which makes it impossible to unambiguously determine if the subresource matches you and it is impossible to determine how to serialize your data.  See HPA controller.

This adds an optional Group and Version to the discovery doc, which can be used to communicate the "native" groupversion of an endpoint.  Doing this does not preclude fancier contenttype negotiation in the future and doesn't prevent future expansion from indicating equivalent types, but it does make it possible to solve the problem we have today or polymorphic categorization.

@kubernetes/sig-api-machinery-misc @smarterclayton 
@cheftako since @lavalamp is out.

```release-note
Adds optional group and version information to the discovery interface, so that if an endpoint uses non-default values, the proper value of "kind" can be determined. Scale is a common example.
```
2017-09-01 01:12:36 -07:00
Tim Hockin 9e2fccd1de Remove generated JSON code 2017-08-31 23:31:12 -07:00
Tim Hockin 5728b1970a Use json-iterator for JSON, kill off codecgen 2017-08-31 23:30:45 -07:00
Kubernetes Submit Queue 58aa139f99 Merge pull request #48836 from ericchiang/audit-policy-subresource-resource-name
Automatic merge from submit-queue (batch tested with PRs 51574, 51534, 49257, 44680, 48836)

audit policy: support subresources and resource names

Updates #48561

	policy:
	- level: Metadata
	  resources:
	  - group: ""
	    resources ["pods/logs"]
	- level: None
	  resources:
	  - group: ""
	    resources: ["configmaps"]
	    resourceNames: ["controller-leader"]

The top level resource no longer matches the subresource. For example "pods"
no longer matches requests to the logs subresource on pods.

```release-note
Audit policy supports matching subresources and resource names, but the top level resource no longer matches the subresouce. For example "pods" no longer matches requests to the logs subresource of pods. Use "pods/logs" to match subresources.
```

/cc @sttts @soltysh @crassirostris @ihmccreery @timstclair
2017-08-31 23:13:26 -07:00
Kubernetes Submit Queue 1a3a0713b2 Merge pull request #51381 from mengqiy/debug_kubectl_get_cm
Automatic merge from submit-queue (batch tested with PRs 50719, 51216, 50212, 51408, 51381)

Surface reasonable error when connection closed

Try to detect connection closure when API server closed the connection due to timeout.
Surface reasonable error when connection closed.

Further improvement may be retrying when detect connection closure

related to #51353

```release-note
Surface reasonable error when client detects connection closed.
```

/assign @mml @caesarxuchao
2017-08-31 21:09:19 -07:00
Kubernetes Submit Queue 393778375b Merge pull request #50212 from jhorwit2/jah/psp-hostpath
Automatic merge from submit-queue (batch tested with PRs 50719, 51216, 50212, 51408, 51381)

Allow PSP's to specify a whitelist of allowed paths for host volume

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

Reverts the revert for the allowed host path feature that was moved from v1.7 to v1.8. This PR also changes the api as discussed in https://github.com/kubernetes/kubernetes/pull/47811.

Original pr: https://github.com/kubernetes/kubernetes/pull/43946
revert: https://github.com/kubernetes/kubernetes/pull/47851

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

**Special notes for your reviewer**:

cc @liggitt @ericchiang @php-coder 

It seems the api build process has changed. Hopefully I did it right 👼 .

**Release note**:

```release-note
Allow PSP's to specify a whitelist of allowed paths for host volume
```
2017-08-31 21:09:14 -07:00
Cao Shufeng 1c3dc52531 audit real impersonated user info
Log the newest impersonated user info in the second audit event. This
will help users to debug rbac problems.
2017-09-01 11:27:23 +08:00
Kubernetes Submit Queue 0f2c2bd847 Merge pull request #50404 from apelisse/http-cache
Automatic merge from submit-queue (batch tested with PRs 51480, 49616, 50123, 50846, 50404)

Kubectl to use http caching to cache openapi responses from the server

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

This PR is trying to address the problems raised in #50254 

> * uses a disk-based cache that is not safe between processes (does not use atomic fs operations)
> * writes get/list responses to disk that should not be cached (like kubectl get secrets)
> * is vulnerable to partially written cache responses being used as responses to future requests
> * breaks uses of the client transport that make use of websockets
> * defaults to enabling the cache for any client builder using RecommendedConfigOverrideFlags or DefaultClientConfig which affects more components than just kubectl

All of these points are addressed by this pull-request:
1. It now uses atomic fs operations
2. Doesn't cache by default, only if requested by the client (and it's only done by openapi client)
3. Fixed because of atomic fs operations
4. Found the reason for the bug: Cache wrapper couldn't be unwrapped. I implemented the `WrappedRoundTripper` interface.
5. Since 2. is fixed, I think that should be fine

@smarterclayton @liggitt 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Allows kubectl to use http caching mechanism for the OpenAPI schema. The cache directory can be configured through `--cache-dir` command line flag to kubectl. If set to empty string, caching will be disabled.
```
2017-08-31 20:08:46 -07:00
Kubernetes Submit Queue 00846fc794 Merge pull request #50123 from WIZARD-CXY/fixlog
Automatic merge from submit-queue (batch tested with PRs 51480, 49616, 50123, 50846, 50404)

make get pod log with follow option as CONNECT verb

**What this PR does / why we need it**:
Don't make the get log with follow option request mix with GET pods request. Make it reported as a WATCH pod log request.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
Fixes #49998 

```release-note
Pod log attempts are now reported in apiserver prometheus metrics with verb `CONNECT` since they can run for very long periods of time.
```
2017-08-31 20:08:40 -07:00
Kubernetes Submit Queue 8679a8f5fe Merge pull request #50163 from jingxu97/Aug/sizeLimit
Automatic merge from submit-queue (batch tested with PRs 51707, 51662, 51723, 50163, 51633)

Change SizeLimit to a pointer

This PR fixes issue #50121

```release-note
The `emptyDir.sizeLimit` field is now correctly omitted from API requests and responses when unset.
```
2017-08-31 18:43:38 -07:00
Kubernetes Submit Queue cd004bb14c Merge pull request #51707 from liggitt/unit-race
Automatic merge from submit-queue (batch tested with PRs 51707, 51662, 51723, 50163, 51633)

Make feature gate threadsafe

Fixes #51548 caused by #51436
2017-08-31 18:43:31 -07:00
Edmund Rhudy 0d0591046c Update Bazel configuration for flag.go and overrides_test.go 2017-08-31 11:11:38 -04:00
Edmund Rhudy 33dff7275d Add tests for stripping "namespaces/" from passed-in namespace 2017-08-31 11:11:30 -04:00
Nikhita Raghunath 6750d38e9b apiextensions: add maximum for validation 2017-08-31 20:07:41 +05:30
Jordan Liggitt d3546434b7
Make feature gate threadsafe 2017-08-31 10:11:11 -04:00
Chenxingyu e49315f2db make api request verb can be overrided and make "GET" pod log request reported as "CONNECT" pod log request for metrics 2017-08-31 21:39:10 +08:00
David Eads de4006b810 generated 2017-08-31 08:05:00 -04:00
deads2k 462a657e48 add information for subresource kind determination: 2017-08-31 08:05:00 -04:00
Maciej Szulik 9fef244d4c
Allow audit to log authorization failures 2017-08-31 12:33:52 +02:00
huangjiuyuan 67f276125f fixing a typo in staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/types.go 2017-08-30 20:06:35 -07:00
Cao Shufeng f94ca49e63 run hack/update-codecgen.sh and hack/update-bazel.sh 2017-08-31 10:04:33 +08:00
Cao Shufeng c57eebfe2f Split APIVersion into APIGroup and APIVersion in audit events
audit.Event.ObjectRef.APIVersion currently holds both the the API group and
version, separated by a /. This change break these out into separate fields.

This is part of:
https://github.com/kubernetes/kubernetes/issues/48561
2017-08-31 09:58:50 +08:00
Kubernetes Submit Queue bc35234269 Merge pull request #51536 from php-coder/fix_typo_in_api_doc
Automatic merge from submit-queue (batch tested with PRs 50775, 51397, 51168, 51465, 51536)

Fix typo in API docs

Typo fix for https://github.com/kubernetes/kubernetes/pull/47019#discussion_r135780591

xref #47019

CC @jessfraz @simo5
2017-08-30 15:14:36 -07:00
Kubernetes Submit Queue 3019daa1dc Merge pull request #51168 from smarterclayton/fix_transport_wrap
Automatic merge from submit-queue (batch tested with PRs 50775, 51397, 51168, 51465, 51536)

Allow bearer requests to be proxied by kubectl proxy

Use a fake transport to capture changes to the request and then surface
them back to the end user.

Fixes #50466

@liggitt no tests yet, but works locally
2017-08-30 15:14:29 -07:00
Kubernetes Submit Queue a9cceacdae Merge pull request #50775 from apelisse/fail-gke-failing-test
Automatic merge from submit-queue

client-go: Make conditionalTransport a WrapperRoundTripper

**What this PR does / why we need it**:
Fixes broken GKE test: https://k8s-gubernator.appspot.com/builds/kubernetes-jenkins/logs/ci-kubernetes-e2e-gke/

**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-30 15:08:19 -07:00
Antoine Pelisse a804d440c3 client-go cache: Make caching layer Unwrappable 2017-08-30 15:01:46 -07:00
Antoine Pelisse e58da7bb7c c-go cache: Use diskv TempDir to get atomic write 2017-08-30 15:01:46 -07:00
Antoine Pelisse a97a1ba14e c-go cache: Only cache discovery requests
Only cache discovery requests, and only for kubectl.
2017-08-30 15:01:46 -07:00
Kenneth Owens 313a8b304a Adds the rand.SafeEncodeString function and uses this function to
generate names for ReplicaSets and ControllerRevisions.
2017-08-30 14:01:11 -07:00
Jing Xu e1460efcf2 Generated files
generated files
2017-08-30 12:45:41 -07:00
Jing Xu 4d6da1fd9a Change SizeLimit to a pointer
This PR fixes issue #50121
2017-08-30 11:50:35 -07:00
Jordan Liggitt 666e4be37b Allow -n namespaces/<ns> 2017-08-30 10:48:01 -04:00
Slava Semushin 227236bd0c Fix typo in docs. 2017-08-30 12:33:37 +02:00
Kubernetes Submit Queue 583c4a442a Merge pull request #51228 from wongma7/mount-options-sc
Automatic merge from submit-queue

Add storageClass.mountOptions and use it in all applicable plugins

split off from https://github.com/kubernetes/kubernetes/pull/50919 and still dependent on it. cc @gnufied


issue: https://github.com/kubernetes/features/issues/168

```release-note
Add mount options field to StorageClass. The options listed there are automatically added to PVs provisioned using the class.
```
2017-08-29 23:48:32 -07:00
Kubernetes Submit Queue aa9417ce91 Merge pull request #49927 from huangjiuyuan/fix-kubelet-option-validation
Automatic merge from submit-queue (batch tested with PRs 49961, 50005, 50738, 51045, 49927)

adding validations on kubelet starting configurations

**What this PR does / why we need it**:
I found some validations of kubelet starting options were missing when I was creating a custom cluster from scratch. The kubelet does not check invalid configurations on `--cadvisor-port`, `--event-burst`, `--image-gc-high-threshold`, etc. I have added some validations in kubelet like validations in `cmd/kube-apiserver/app/options/validation.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
Adds additional validation for kubelet in `pkg/kubelet/apis/kubeletconfig/validation`.
```
2017-08-29 21:43:42 -07:00
Kubernetes Submit Queue 4457e43e7b Merge pull request #47263 from nikhita/crd-01-validation-types
Automatic merge from submit-queue

apiextensions: validation for customresources

- [x] Add types for validation of CustomResources
- [x] Fix conversion-gen: #49747
- [x] Fix defaulter-gen: kubernetes/gengo#61
- [x] Convert to OpenAPI types
- [x] Validate CR using go-openapi
- [x] Validate CRD Schema
- [x] Add integration tests
- [x] Fix round trip tests: #51204 
- [x] Add custom fuzzer functions
- [x] Add custom conversion functions
- [x] Fix data race while updating CRD: #50098 
- [x] Add feature gate for CustomResourceValidation
- [x] Fix protobuf generation

Proposal: https://github.com/kubernetes/community/pull/708
Additional discussion: https://github.com/kubernetes/kubernetes/issues/49879, https://github.com/kubernetes/kubernetes/pull/50625

**Release note**:

```release-note
Add validation for CustomResources via JSON Schema.
```

/cc @sttts @deads2k
2017-08-29 18:37:10 -07:00
Tim Hockin 478ce3453e Add v1 API as a default conversion peer
Some of the APIs call do not this out, and a partial build produces
wrong results.
2017-08-29 17:19:38 -07:00
Kubernetes Submit Queue 0d17e9deb7 Merge pull request #48574 from sakshamsharma/kms-transformer
Automatic merge from submit-queue

Add Google cloud KMS service for envelope encryption transformer

This adds the required pieces which will allow addition of KMS based encryption providers (envelope transformer).

For now, we will be implementing it using Google Cloud KMS, but the code should make it easy to add support for any other such provider which can expose Decrypt and Encrypt calls.

Writing tests for Google Cloud KMS Service may cause a significant overhead to the testing framework. It has been tested locally and on GKE though.

Upcoming after this PR:
* Complete implementation of the envelope transformer, which uses LRU cache to maintain decrypted DEKs in memory.
* Track key version to assist in data re-encryption after a KEK rotation.

Development branch containing the changes described above: https://github.com/sakshamsharma/kubernetes/pull/4

Envelope transformer used by this PR was merged in #49350 

Concerns #48522 

Planned configuration:
```
kind: EncryptionConfig
apiVersion: v1
resources:
  - resources:
    - secrets
    providers:
    - kms:
        cachesize: 100
        configfile: gcp-cloudkms.conf
        name: gcp-cloudkms
    - identity: {}
```

gcp-cloudkms.conf:
```
[GoogleCloudKMS]
    kms-location: global
    kms-keyring: google-container-engine
    kms-cryptokey: example-key
```
2017-08-29 11:11:10 -07:00
Kubernetes Submit Queue ce55939465 Merge pull request #51511 from huangjiuyuan/fix-func-comment
Automatic merge from submit-queue (batch tested with PRs 51298, 51510, 51511)

modifying the comment of BeforeDelete function to improve readability

**What this PR does / why we need it**:
modifying the comment of `BeforeDelete` function in `staging/src/k8s.io/apiserver/pkg/registry/rest/delete.go` to improve readability.

**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-29 10:38:19 -07:00
Nikhita Raghunath 6ba1523a8e Add feature gate for CustomResourceValidation
update feature gates for generic apiserver

Add apiextensions-apiserver features to golint_failures

Ignore alpha feature if gate is disabled
2017-08-29 21:35:12 +05:30
Nikhita Raghunath ccb8554dd8 Update godeps 2017-08-29 21:35:12 +05:30