Commit Graph

3530 Commits (ba535d57f6e2eb338f6fbf121d6be2e6f9204136)

Author SHA1 Message Date
Kubernetes Submit Queue b309c2f4f0
Merge pull request #59410 from fisherxu/testapigroup
Automatic merge from submit-queue (batch tested with PRs 57824, 58806, 59410, 59280). 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 some package to code-generator

**What this PR does / why we need it**:
add some package to code-generator and regenerated files.

**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**:
/cc @sttts 

**Release note**:

```release-note
NONE
```
2018-02-08 03:29:39 -08:00
Kubernetes Submit Queue db1ed10534
Merge pull request #58806 from CaoShuFeng/audit_annotation_api
Automatic merge from submit-queue (batch tested with PRs 57824, 58806, 59410, 59280). 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 Annotations to advanced audit api

**Release note**:
```release-note
Annotations is added to advanced audit api
```
2018-02-08 03:29:36 -08:00
Kubernetes Submit Queue fb340a4695
Merge pull request #57824 from thockin/gcr-vanity
Automatic merge from submit-queue (batch tested with PRs 57824, 58806, 59410, 59280). 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>.

2nd try at using a vanity GCR name

The 2nd commit here is the changes relative to the reverted PR.  Please focus review attention on that.

This is the 2nd attempt.  The previous try (#57573) was reverted while we
figured out the regional mirrors (oops).
    
New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest.  To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today).  For now the staging is an alias to
gcr.io/google_containers (the legacy URL).
    
When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.
    
We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it.  Nice and
visible, easy to keep track of.

xref https://github.com/kubernetes/release/issues/281

TL;DR:
  *  The new `staging-k8s.gcr.io` is where we push images.  It is literally an alias to `gcr.io/google_containers` (the existing repo) and is hosted in the US.
  * The contents of `staging-k8s.gcr.io` are automatically synced to `{asia,eu,us)-k8s.gcr.io`.
  * The new `k8s.gcr.io` will be a read-only alias to whichever regional repo is closest to you.
  * In the future, images will be promoted from `staging` to regional "prod" more explicitly and auditably.

 ```release-note
Use "k8s.gcr.io" for pulling container images rather than "gcr.io/google_containers".  Images are already synced, so this should not impact anyone materially.
    
Documentation and tools should all convert to the new name. Users should take note of this in case they see this new name in the system.
```
2018-02-08 03:29:32 -08:00
Dr. Stefan Schimanski ed1b01090d client-gen: remove base input dirs 2018-02-08 12:20:19 +01:00
hzxuzhonghu b835c46c86 fix using defer in loop in cors test 2018-02-08 19:17:38 +08:00
hzxuzhonghu ea7a713010 run update bazel staging-dep 2018-02-08 19:10:11 +08:00
hzxuzhonghu ec39259785 add wait ready for mutating/validating webhook configuration 2018-02-08 19:10:09 +08:00
hzxuzhonghu f287527442 admission registration use shared informer instead of poll 2018-02-08 19:08:19 +08:00
Tim Hockin 3586986416 Switch to k8s.gcr.io vanity domain
This is the 2nd attempt.  The previous was reverted while we figured out
the regional mirrors (oops).

New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest.  To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today).  For now the staging is an alias to
gcr.io/google_containers (the legacy URL).

When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.

We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it.  Nice and
visible, easy to keep track of.
2018-02-07 21:14:19 -08:00
hzxuzhonghu 08c024f367 run hack/update-all.sh 2018-02-08 09:41:46 +08:00
hzxuzhonghu cc135e985c add test case 2018-02-08 09:41:41 +08:00
hzxuzhonghu 6e83d88be9 audit support wildcard matching subresources 2018-02-08 09:41:38 +08:00
Wu Qiang 9825018e4a Add generated script for kms api pb file 2018-02-08 01:00:38 +00:00
Wu Qiang 5ae61ed386 Remove configfile for kms in encryption config 2018-02-08 01:00:38 +00:00
Wu Qiang 2e7af38d6b Update for review comments 2018-02-08 01:00:38 +00:00
Wu Qiang a6368bb04c Only support unix socket for kms gRPC, also add Version method 2018-02-08 01:00:38 +00:00
Wu Qiang 16b04d68b1 Fix verify error and address review comments
Signed-off-by: Wu Qiang <qiang.q.wu@oracle.com>
2018-02-08 01:00:38 +00:00
Wu Qiang 31fb539f17 Update kms provider config for gRPC client service 2018-02-08 01:00:38 +00:00
Wu Qiang 772fa0f62f Add gRPC client service for envelope transformer 2018-02-08 01:00:38 +00:00
Davanum Srinivas 18590378c4 Remove experimental keystone authenticator
experimental-keystone-url and experimental-keystone-ca-file were always
experimental. So we don't need a deprecation period.
KeystoneAuthenticator was on the server side and needed userid/password
to be passed in and used that to authenticate with Keystone. We now
have authentication and authorization web hooks that can be used. There
is a external repo with a webook for keystone which works fine along
with the kubectl auth provider that was added in:
a0cebcb559

So we don't need this older style / hard coded / experimental code
anymore.
2018-02-07 19:28:55 -05:00
Kubernetes Submit Queue 1f6251444b
Merge pull request #51042 from soltysh/request_timeout
Automatic merge from submit-queue (batch tested with PRs 59276, 51042, 58973, 59377, 59472). 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>.

Allow passing request-timeout from NewRequest all the way down

**What this PR does / why we need it**:
Currently if you pass `--request-timeout` it's not passed all the way down to the actual request object. There's a separate field on the `Request` object that allows setting that timeout, but it's not taken from that flag. 

@smarterclayton @deads2k ptal, this is coming from https://github.com/openshift/origin/pull/13701
2018-02-07 12:00:44 -08:00
Maciej Szulik 7da1002091 Allow passing request-timeout from NewRequest all the way down to actual request 2018-02-07 16:02:26 +01:00
Jordan Liggitt 17f18fa07a
Indicate endpoint subsets are an optional field 2018-02-07 09:29:16 -05:00
hangaoshuai 3cbd8e2132 fix todo: use selector.DeepCopy replace of hard code 2018-02-07 19:09:05 +08:00
fisherxu c6499e8db3 delete unused generated file 2018-02-07 15:21:51 +08:00
Kubernetes Submit Queue 1f3c66fba7
Merge pull request #59437 from mikedanese/id-api
Automatic merge from submit-queue (batch tested with PRs 58444, 59283, 59437, 59325, 59449). 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>.

authentication: remove TokenRequest from authentication.k8s.io/v1beta1

We don't actually need v1beta1 TokenRequest so should we leave the API group sparse?

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

```release-note
NONE
```
2018-02-06 22:42:38 -08:00
Kubernetes Submit Queue f99ed35b28
Merge pull request #58444 from bsalamat/update_prio
Automatic merge from submit-queue (batch tested with PRs 58444, 59283, 59437, 59325, 59449). 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 PriorityClassName API doc

**What this PR does / why we need it**: It updates the comment (and hence API doc) for PriorityClassName of PodSpec.

**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
```

/sig scheduling
2018-02-06 22:42:33 -08:00
fisherxu cf830cb973 regenerated files 2018-02-07 11:19:31 +08:00
fisherxu 0c4e0aee80 add k8s:conversion-gen to internalversion 2018-02-07 11:19:31 +08:00
Bobby (Babak) Salamat 646ee95213 autogenerated files 2018-02-06 17:55:14 -08:00
Bobby (Babak) Salamat 9493f5fceb Update PriorityClassName API doc 2018-02-06 17:44:18 -08:00
Mike Danese 33a8f39a03 authentication: remove TokenRequest from authentication.k8s.io/v1beta1
We don't actually need that type so leave the API group sparse.
2018-02-06 14:07:08 -08:00
Kubernetes Submit Queue b2c1e5de11
Merge pull request #58562 from MikeSpreitzer/issue-58558
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>.

Clarify that ListOptions.Timeout is not conditional on inactivity

**What this PR does / why we need it**:
Clarifies the meaning of the `Timeout` field of a `ListOptions`, because the name and existing description can reasonably be interpreted to mean something divergent from the actual behavior.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-06 12:44:23 -08:00
Kubernetes Submit Queue 4bd22b5467
Merge pull request #58415 from gnufied/fix-volume-resize-messages
Automatic merge from submit-queue (batch tested with PRs 52942, 58415). 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 messaging on volume expansion

- we now provide clear message to user what to do when cloudprovider resizing is finished
  and file system resizing is needed.
- add a event when resizing is successful
- Use PATCH both in controller-manager and kubelet for updating PVC status
- Remove code duplication between controller-manager and kubelet for updating PVC status
- Only remove conditions that are managed by resize controller



```release-note
Improve messages user gets during and after volume resizing is done.
```
2018-02-06 07:55:32 -08:00
fisherxu 44fa4c0ff0 add testapigroup of apimachinery to go-to-protobuf 2018-02-06 17:24:05 +08:00
Cao Shufeng 9a7acaae1d fix invalid match rules for advanced audit policy
When users or groups are set in a rule, this rule should not match
attribute with unauthorized request where user and group are nil.
2018-02-06 14:53:43 +08:00
Kubernetes Submit Queue 5aa68f528f
Merge pull request #58027 from mikedanese/id-api
Automatic merge from submit-queue (batch tested with PRs 55986, 59375, 59334, 59348, 58027). 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 minimal types for service account TokenRequest API

Adds parts of the types in https://github.com/kubernetes/community/pull/1460. ValidityDuration is omitted because we are still discussing how to surface non-expiring tokens but it should be easy to add in a backwards compatibly.

#58790

@kubernetes/sig-auth-api-reviews
2018-02-05 21:14:43 -08:00
Lihua Tang 7671c0c6bc
Fix typo: constucts -> constructs 2018-02-06 10:36:57 +08:00
Kubernetes Submit Queue 4e2c3f060a
Merge pull request #58317 from nikhita/bump-go-yaml
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>.

bump(670d4c): gopkg.in/yaml.v2: fix parsing for non-specific tags

Fixes #56976

Fixes this bug - https://github.com/go-yaml/yaml/issues/75 - in `go-yaml`. The fix for this bug is at 670d4cfef0.

**Release note**:

```release-note
NONE
```

/cc sttts caesarxuchao jennybuckley
2018-02-05 18:22:21 -08:00
Mikhail Mazurskiy 03fc8dedb1
Use direct struct comparison, not reflection
Also use constant instead of hardcoding internal version
2018-02-06 13:06:47 +11:00
Mike Spreitzer b43dc4fac2 Clarify that ListOptions.Timeout is not conditional on inactivity
Fixes #58558
2018-02-05 17:04:03 -05:00
Kubernetes Submit Queue 9ee71b720e
Merge pull request #59059 from smarterclayton/move_partial_object
Automatic merge from submit-queue (batch tested with PRs 59158, 38320, 59059, 55516, 59357). 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 v1alpha1 meta to v1beta1

No code changes, just renames. We can discuss if there are any field / naming changes here or in a follow-up

Parent #58536
Fixes #53224
Prereq to #55637

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

```release-note
The `meta.k8s.io/v1alpha1` objects for retrieving tabular responses from the server (`Table`) or fetching just the `ObjectMeta` for an object (as `PartialObjectMetadata`) are now beta as part of `meta.k8s.io/v1beta1`.  Clients may request alternate representations of normal Kubernetes objects by passing an `Accept` header like `application/json;as=Table;g=meta.k8s.io;v=v1beta1` or `application/json;as=PartialObjectMetadata;g=meta.k8s.io;v1=v1beta1`.  Older servers will ignore this representation or return an error if it is not available.  Clients may request fallback to the normal object by adding a non-qualified mime-type to their `Accept` header like `application/json` - the server will then respond with either the alternate representation if it is supported or the fallback mime-type which is the normal object response.
```
2018-02-05 12:40:37 -08:00
Kubernetes Submit Queue 0656d030a7
Merge pull request #38320 from liggitt/golang-ratelimit
Automatic merge from submit-queue (batch tested with PRs 59158, 38320, 59059, 55516, 59357). 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>.

Switch from juju/ratelimit to golang.org/x/time/rate

Replaces juju/ratelimit with golang.org/x/time/rate
xref https://github.com/kubernetes/steering/issues/21

Requires removing the Saturation() method on the rate limiter. In the process of attempting to contribute it to the `golang.org/x/time/rate` implementation, it became clear that what it was calculating was not very useful when combined with periodic polling. See discussion in https://go-review.googlesource.com/c/time/+/29958#message-4caffc11669cadd90e2da4c05122cfec50ea6a22

```release-note
NONE
```
2018-02-05 12:40:34 -08:00
Haowei Cai 8b03e77aec Add comments about potential race in delta fifo. 2018-02-05 12:32:27 -08:00
Mike Danese ee48da13fc autogenerated 2018-02-05 11:39:27 -08:00
Mike Danese 48959be848 add minimal types for service account TokenRequest API 2018-02-05 11:39:27 -08:00
Kubernetes Submit Queue 1105751cc7
Merge pull request #58926 from nikhita/fix-customresource-selflink
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>.

Fix self link for cluster scoped custom resources

**What this PR does / why we need it**: Fixes self link for cluster scoped custom resources.

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

**Special notes for your reviewer**:

For the main apiserver:

e8225f5618/staging/src/k8s.io/apiserver/pkg/endpoints/installer.go (L408)

**Release note**:

```release-note
NONE
```

/assign sttts deads2k
2018-02-05 09:29:18 -08:00
Nikhita Raghunath 45950fdb75 core/v1 should be first in discovery order
Currently, core/v1 is in the end of the discovery order.

Since core/v1 is special, it should be in the beginning.
2018-02-05 15:04:29 +05:30
Kubernetes Submit Queue c6e581ff42
Merge pull request #59195 from pigletfly/fix-typo
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>.

Fix some typos

**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-02-04 08:00:38 -08:00
halfcrazy 86801dee64 fix typo in client-go 2018-02-04 21:48:42 +08:00
Kubernetes Submit Queue c52192f33b
Merge pull request #59265 from yue9944882/fix-irregular-docs-typo-ish
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>.

fix(doc): irregular descriptive docs

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

Fixes documentations.

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

```
2018-02-04 01:55:04 -08:00
Cao Shufeng c512a078e9 run hack/update-all.sh 2018-02-04 15:35:42 +08:00
Cao Shufeng 97b0d99a33 add Annotations to audit event 2018-02-04 15:35:36 +08:00
Clayton Coleman b81f474554
When using the bootstrap cert, update the store
Otherwise, the certificate store will return nil the first time a store
cert is accessed. When background rotation is being used, prevents the
client from being nil.
2018-02-04 01:24:56 -05:00
Joe Betz f0d04b7131 Update etcd server version to 3.2.13 2018-02-02 17:25:13 -08:00
Clayton Coleman d07a608607 Promote v1alpha1 meta to v1beta1
No code changes, just renames
2018-02-02 14:00:45 -05:00
Kubernetes Submit Queue 21387af0b4
Merge pull request #58990 from bsalamat/nominated_node
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 NominatedNodeName field to PodStatus

**What this PR does / why we need it**:
Today, Scheduler uses an annotation called "nominated-node-name" to mark a preemptor Pod. This annotation helps scheduler know about the Pods that are destined to run on the nodes so that the resources made available by preemption is not allocated to a different Pod. In a recent discussion with @bgrant0607, we learned that we should change the annotation to a field as this field can be used by multiple schedulers and other components that may make scheduling-related decisions (descheduler, auto-scaler, kube-arbitrator, ...). 


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

ref #57471

**Special notes for your reviewer**:

**Release note**:

```release-note
Add "nominatedNodeName" field to PodStatus. This field is set when a pod preempts other pods on the node.
```
/sig scheduling
2018-02-02 07:26:16 -08:00
Kubernetes Submit Queue 11576c3650
Merge pull request #59198 from liubin/fix1
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>.

Fix typos

Fix typos in source code's comment.
2018-02-02 05:17:21 -08:00
yue9944882 dc2f6f9325 fix irregular descriptive docs 2018-02-02 21:05:49 +08:00
Mikhail Mazurskiy cd8fd313bb
Conversion from typed to unstructured should set GVK 2018-02-02 23:26:04 +11:00
Kubernetes Submit Queue 8363129ee6
Merge pull request #58462 from NickrenREN/va-to-beta
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 V1beta1 VolumeAttachment API

**What this PR does / why we need it**:
Add V1beta1 VolumeAttachment API, co-existing with Alpha API 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 #58461

**Special notes for your reviewer**:

**Release note**:
```release-note
Add V1beta1 VolumeAttachment API, co-existing with Alpha API object
```
2018-02-01 18:50:25 -08:00
Kubernetes Submit Queue 06472a054a
Merge pull request #58930 from smarterclayton/background_rotate
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>.

Only rotate certificates in the background

Change the Kubelet to not block until the first certs have rotated (we didn't act on it anyway) and fall back to the bootstrap cert if the most recent rotated cert is expired on startup.

The certificate manager originally had a "block on startup" rotation behavior to ensure at least one rotation happened on startup. However, since rotation may not succeed within the first time window the code was changed to simply print the error rather than return it. This meant that the blocking rotation has no purpose - it cannot cause the kubelet to fail, and it *does* block the kubelet from starting static pods before the api server becomes available.

The current block behavior causes a bootstrapped kubelet that is also set to run static pods to wait several minutes before actually launching the static pods, which means self-hosted masters using static pods have a pointless delay on startup.

Since blocking rotation has no benefit and can't actually fail startup, this commit removes the blocking behavior and simplifies the code at the same time. The goroutine for rotation now completely owns the deadline, the shouldRotate() method is removed, and the method that sets rotationDeadline now returns it. We also explicitly guard against a negative sleep interval and omit the message.

Should have no impact on bootstrapping except the removal of a long delay on startup before static pods start.

The other change is that an expired certificate from the cert manager is *not* considered a valid cert, which triggers an immediate rotation.  This causes the cert manager to fall back to the original bootstrap certificate until a new certificate is issued.  This allows the bootstrap certificate on masters to be "higher powered" and allow the node to function prior to initial approval, which means someone configuring the masters with a pre-generated client cert can be guaranteed that the kubelet will be able to communicate to report self-hosted static pod status, even if the first client rotation hasn't happened.  This makes master self-hosting more predictable for static configuration environments.

```release-note
When using client or server certificate rotation, the Kubelet will no longer wait until the initial rotation succeeds or fails before starting static pods.  This makes running self-hosted masters with rotation more predictable.
```
2018-02-01 12:05:15 -08:00
steveperry-53 1a530d1884 Add IPv6 to ref page descriptions. 2018-02-01 19:29:54 +00:00
Kubernetes Submit Queue 7d07810c6d
Merge pull request #59140 from halfcrazy/typo-apiserver
Automatic merge from submit-queue (batch tested with PRs 57683, 59116, 58728, 59140, 58976). 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>.

doc: fix typo in package apiserver

**What this PR does / why we need it**:
fix typo in package apiserver

**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-02-01 07:04:43 -08:00
Kubernetes Submit Queue a7a3dcfc52
Merge pull request #59037 from hzxuzhonghu/aggregator-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>.

refactor aggregator api group install

**What this PR does / why we need it**:
refactor aggregator apigroup install. move NewRESTStorage to 
`staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/rest/storage_apiservice.go`

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-01 04:35:10 -08:00
bin liu 4260bf2a2b Fix typos 2018-02-01 19:53:51 +08:00
pigletfly 5eba676508 Fix typo 2018-02-01 19:11:19 +08:00
Kubernetes Submit Queue ca17c82b37
Merge pull request #58865 from hzxuzhonghu/fix-filters-typos
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>.

fix some typos in apiserver filters

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

fix some typos

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-01 02:31:45 -08:00
Kubernetes Submit Queue f96ac05774
Merge pull request #59062 from mtaufen/fix-pod-pids-limit
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>.

Fix PodPidsLimit and ConfigTrialDuration on internal KubeletConfig type

They should both follow the convention of not being a pointer on the internal type. 

This required adding a conversion function between `int64` and `*int64`. A side effect is this removes a warning in the generated code for the apps API group.

@dims

```release-note
NONE
```
2018-02-01 01:45:55 -08:00
Kubernetes Submit Queue 5d457dbd3c
Merge pull request #58940 from hanxiaoshuai/bugfix
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>.

pass listener in apiextentions-apiserver test to prevent port in use …

**What this PR does / why we need it**:
pass listener to SecureServingOptions to prevent port in use flake.
**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 #
partially fix [58936](https://github.com/kubernetes/kubernetes/issues/58936)
**Special notes for your reviewer**:
/assign @hzxuzhonghu @liggitt @sttts @caesarxuchao
2018-02-01 00:56:43 -08:00
halfcrazy 0da91a8577 fix typo in package apiserver 2018-02-01 03:04:33 +08:00
Kubernetes Submit Queue 4ce4bdc82c
Merge pull request #59061 from nikhita/crds-is-a-thing
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 crds as CustomResourceDefinition shortname

See https://github.com/kubernetes/apiextensions-apiserver/issues/6#issuecomment-361539766.
Fixes kubernetes/apiextensions-apiserver#6

Before:

```
➜  kubectl get crds
the server doesn't have a resource type "crds"
```

After:

```
➜  kubectl get crds
No resources found.
```


**Release note**:

```release-note
 `crds` is added as a shortname for CustomResourceDefinition i.e. `kubectl get crds` can now be used.
```

/cc sttts deads2k soltysh pwittrock
2018-01-31 05:48:41 -08:00
hzxuzhonghu 2742d1e42d refactor kube-aggregator api group install 2018-01-31 21:38:47 +08:00
Kubernetes Submit Queue a241087f99
Merge pull request #57457 from vfreex/fix-port-forward-ipv6
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: Fix broken TCP6 listen for port forwarding

**What this PR does / why we need it**:
The IPV6 loopback address `::1` is enclosed in square brackets twice,
which cause a failure to listen on the TCP6 port.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Fix an issue where port forwarding doesn't forward local TCP6 ports to the pod
```
/area ipv6
/sig cli
2018-01-31 04:06:46 -08:00
Kubernetes Submit Queue 8f71d6d840
Merge pull request #58598 from WanLinghao/rbac_improve
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 a comment on specical  case on authorization  

In file /staging/src/k8s.io/apiserver/pkg/endpoints/filters/authorization.go, 
function WithAuthorization() returns DecisionAllow before error check.
It is intentional to avoid leaking authorization errors to attackers.
This patch add a comment here to give a hint



**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-01-31 03:23:16 -08:00
NickrenREN 8915e275c0 update all 2018-01-31 18:45:49 +08:00
Nikhita Raghunath 1fd07e1978 sample-controller: document minimum kube version
The sample-controller uses apps/v1 deployments
since they became GA in 1.9. This means that
sample-controller does not support versions below 1.9.
2018-01-31 15:16:41 +05:30
NickrenREN d45a41807e Add Beta VolumeAttachment API 2018-01-31 17:38:11 +08:00
Kubernetes Submit Queue f3942e7ded
Merge pull request #58817 from karlhungus/bugfix_yaml_decoder_short_buf
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 test/fix for ErrShortBuffer edgecase

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

Found a bug with YAMLToJSONDecoder where subsequent reads after `io.ErrShortBuffer` would return values from the next yaml section, rather than the rest of the section I was reading.

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

https://github.com/kubernetes/kubernetes/issues/59055

**Special notes for your reviewer**:

**Release note**:

```release-note
YAMLDecoder Read now tracks rest of buffer on io.ErrShortBuffer
```
2018-01-31 00:18:03 -08:00
WanLinghao 983435bdce modified: staging/src/k8s.io/apiserver/pkg/endpoints/filters/authorization.go 2018-01-31 14:21:42 +08:00
hzxuzhonghu b9308355a6 fix some typos in filters 2018-01-31 09:37:02 +08:00
Bobby (Babak) Salamat 74706546e9 Autogenerated files 2018-01-30 13:13:57 -08:00
Bobby (Babak) Salamat 384a86caa9 Add NominatedNodeName to PodStatus 2018-01-30 13:13:57 -08:00
Michael Taufen da41a6e793 Fix PodPidsLimit and ConfigTrialDuration on internal KubeletConfig type
They should both follow the convention of not being a pointer on the
internal type. This required adding a conversion function between
`int64` and `*int64`.

A side effect is this removes a warning in the generated code for the
apps API group.
2018-01-30 11:43:41 -08:00
Nikhita Raghunath ba8488559d Add crds as CustomResourceDefinition shortname 2018-01-31 00:21:47 +05:30
Izaak Alpert 6100c7fe3f
Add test/fix for ErrShortBuffer edgecase 2018-01-30 13:34:44 -05:00
Kubernetes Submit Queue 7cd474f524
Merge pull request #58914 from hzxuzhonghu/customresource_handler
Automatic merge from submit-queue (batch tested with PRs 58914, 58933). 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 GetCustomResourceListerCollectionDeleter comments

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

fix  https://github.com/kubernetes/kubernetes/pull/58688#discussion_r163865115



**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-30 08:36:31 -08:00
hzxuzhonghu 24c687fdad deprecate insecure http flags and remove already deprecated public-address-override 2018-01-30 16:05:33 +08:00
lichuqiang fde4f6f9b0 resourceQuota support for extended resources 2018-01-30 09:29:22 +08:00
Kubernetes Submit Queue 52c3ff3ab8
Merge pull request #58963 from deads2k/server-06-dead-etcdserver
Automatic merge from submit-queue (batch tested with PRs 58955, 58968, 58971, 58963, 58298). 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 dead testing code

Removes a deprecated etcd server init function and stops starting an etc server during unit tests that we never use.
2018-01-29 13:48:48 -08:00
Kubernetes Submit Queue 946b1f023f
Merge pull request #58971 from deads2k/client-01-prefix
Automatic merge from submit-queue (batch tested with PRs 58955, 58968, 58971, 58963, 58298). 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 dead prefix field

The `Prefix` field was never used.
2018-01-29 13:48:45 -08:00
Kubernetes Submit Queue d8f32b2917
Merge pull request #58968 from deads2k/server-07-deadarg
Automatic merge from submit-queue (batch tested with PRs 58955, 58968, 58971, 58963, 58298). 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 --tls-ca-file which had no effect

The flag has had no effect since we started configuring loopback based on the direct cert.  I've marked it deprecated this release so we don't break launch scripts right away, but its coming.  I think we should remove it in 1.11.


```release-note-action-required
kube-apiserver flag --tls-ca-file has had no effect for some time.  It is now deprecated and slated for removal in 1.11.  If you are specifying this flag, you must remove it from your launch config before ugprading to 1.11.
```
2018-01-29 13:48:42 -08:00
Kubernetes Submit Queue 5ab8f8cea9
Merge pull request #58863 from hzxuzhonghu/runtime-config-resource-remove
Automatic merge from submit-queue (batch tested with PRs 56995, 58498, 57426, 58902, 58863). 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>.

cleanup enable/disable api resources code

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

After #57228, `runtime-config` flag has stop support enable/disable resources of a specific groupVersion,
so this pr does some clean work about this.

Mainly delete unused code in  `k8s.io/apiserver/pkg/server/storage/resource_config.go`

**Special notes for your reviewer**:
/assign @deads2k  @sttts 
**Release note**:

```release-note
NONE
```
/kind cleanup
2018-01-29 12:37:47 -08:00
Hemant Kumar 1fa8cbc5e4 Improve messaging on resize
- we now provide clear message to user what to do when cloudprovider resizing is finished
  and file system resizing is needed.
- add a event when resizing is successful.
- Use Patch for updating PVCs in both kubelet and controller-manager
- Extract updating pvc util function in one place.
- Only update resize conditions on progress
2018-01-29 15:07:51 -05:00
Michael Taufen 4258926640 Kubelet flags take precedence
This changes the Kubelet configuration flag precedence order so that
flags take precedence over config from files/ConfigMaps.

See #56171 for rationale.

Note: Feature gates accumulate with the following
precedence (greater number overrides lesser number):
1. file-based config
2. dynamic cofig
3. flag-based config
2018-01-29 10:07:37 -08:00
David Eads e7b6d77c7e remove dead prefix field 2018-01-29 11:30:14 -05:00
David Eads 114711f77d remove --tls-ca-file which had no effect 2018-01-29 10:31:37 -05:00
David Eads 3e6bfcb5db remove dead testing code 2018-01-29 09:50:40 -05:00
hangaoshuai 293616ae9a pass listener in apiextentions-apiserver test to prevent port in use flake 2018-01-29 15:44:11 +08:00
Clayton Coleman 44493de195
Only rotate certificates in the background
The certificate manager originally had a "block on startup" rotation
behavior to ensure at least one rotation happened on startup. However,
since rotation may not succeed within the first time window the code was
changed to simply print the error rather than return it. This meant that
the blocking rotation has no purpose - it cannot cause the kubelet to
fail, and it *does* block the kubelet from starting static pods before
the api server becomes available.

The current block behavior causes a bootstrapped kubelet that is also
set to run static pods to wait several minutes before actually launching
the static pods, which means self-hosted masters using static pods have
a pointless delay on startup.

Since blocking rotation has no benefit and can't actually fail startup,
this commit removes the blocking behavior and simplifies the code at the
same time. The goroutine for rotation now completely owns the deadline,
the shouldRotate() method is removed, and the method that sets
rotationDeadline now returns it. We also explicitly guard against a
negative sleep interval and omit the message.

Should have no impact on bootstrapping except the removal of a long
delay on startup before static pods start.

Also add a guard condition where if the current cert in the store is
expired, we fall back to the bootstrap cert initially (we use the
bootstrap cert to communicate with the server). This is consistent with
when we don't have a cert yet.
2018-01-28 17:48:17 -05:00
Nikhita Raghunath 843aec994b Fix self link for cluster scoped custom resources 2018-01-28 12:17:00 +01:00
Kubernetes Submit Queue e8225f5618
Merge pull request #58878 from liggitt/deprecated-feature
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>.

Categorize deprecated feature gate more accurately

related to #58761

follow up from https://github.com/kubernetes/kubernetes/pull/57265 to clarify the status of the feature gate

```release-note
NONE
```
2018-01-27 12:40:45 -08:00
hzxuzhonghu d0d1e1dcc4 refactor resource_config.go thoroughly and remove useless code in registry 2018-01-27 16:10:58 +08:00
hzxuzhonghu 6abde54bbe fix GetCustomResourceListerCollectionDeleter comments 2018-01-27 16:00:10 +08:00
hzxuzhonghu 64a12258e8 remove support enable-disable api resources 2018-01-27 15:25:23 +08:00
Kubernetes Submit Queue 6ef0514bd9
Merge pull request #58141 from ahmetb/configurable-scopes
Automatic merge from submit-queue (batch tested with PRs 58903, 58141, 58900). 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>.

auth/gcp: configurable scopes for gcp default credentials

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

- add `config.scopes` field comma-separated scope URLs, to be used with Google
  Application Default Credentials (i.e. GOOGLE_APPLICATION_CREDENTIALS env)
- users now should be able to set a gserviceaccount key in GOOGLE_APPLICATION_CREDENTIALS
  env, craft a kubeconfig file with GKE master IP+CA cert and should be able to authenticate
  to GKE in headless mode _without requiring gcloud_ CLI, and they can now use the
  email address of the gserviceaccount in RBAC role bindings and _not use Google Cloud IAM at all._
- gcp default scopes now include userinfo.email scope, so authenticating to GKE
  using gserviceaccount keys can now be done without gcloud as well.
- since userinfo.email scope is now a default, users who have existing RBAC bindings
  that use numeric uniqueID of the gserviceaccount will be broken (this behavior was
  never documented/guaranteed). from now on email address of the service account
  should be used as the subject in RBAC Role Bindings.


**Release note**:
```release-note
Google Cloud Service Account email addresses can now be used in RBAC
Role bindings since the default scopes now include the "userinfo.email"
scope. This is a breaking change if the numeric uniqueIDs of the Google
service accounts were being used in RBAC role bindings. The behavior
can be overridden by explicitly specifying the scope values as
comma-separated string in the "users[*].config.scopes" field in the
KUBECONFIG file.
```

/assign @cjcullen 
/sig gcp
2018-01-26 21:00:35 -08:00
Kubernetes Submit Queue ac495f169b
Merge pull request #58644 from yguo0905/webhooks
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>.

Use SSH tunnel for webhook communication iff the webhook is deployed as a service

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

We are getting the following error when the apiserver connects the webhook on localhost (configured via URL). We should only use the SSL tunnel for the connections to nodes when the webhooks are running as services.

```
I0119 17:41:18.678436       1 ssh.go:400] [4cdf44753cc3705d: localhost:10258] Dialing...
W0119 17:41:18.678483       1 ssh.go:424] SSH tunnel not found for address "localhost", picking random node
I0119 17:41:18.679810       1 ssh.go:402] [4cdf44753cc3705d: localhost:10258] Dialed in 1.398691ms.
W0119 17:41:18.679928       1 admission.go:256] Failed calling webhook, failing closed xxx: failed calling admission webhook "xxx": Post xxx: ssh: rejected: connect failed (Connection refused)
I0119 17:41:18.680346       1 wrap.go:42] POST /api/v1/namespaces/kube-system/pods: (5.725588ms) 500
```

**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 # https://github.com/kubernetes/kubernetes/issues/58779

**Special notes for your reviewer**:

**Release note**:

```release-note
kube-apiserver is changed to use SSH tunnels for webhook iff the webhook is not directly routable from apiserver's network environment.
```

/assign @lavalamp @caesarxuchao @cheftako
2018-01-26 15:58:27 -08:00
Yang Guo 05fbc22064 Split ClientConfigFor() 2018-01-26 11:51:19 -08:00
Kubernetes Submit Queue 88abb431ae
Merge pull request #58846 from hzxuzhonghu/aggregator-fix
Automatic merge from submit-queue (batch tested with PRs 58783, 58800, 58846). 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>.

runtime-config bug in kube-aggregator

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

kube-aggregator api has upgraded to v1, and introduce a little bug. I have to fix it.

**Special notes for your reviewer**:
/assign @deads2k 
**Release note**:

```release-note
NONE
```
2018-01-26 10:19:39 -08:00
Jordan Liggitt 7336eeab8a
Add deprecated stage of feature gates 2018-01-26 10:49:52 -05:00
Kubernetes Submit Queue a73c96d7b2
Merge pull request #58342 from gmarek/inflight
Automatic merge from submit-queue (batch tested with PRs 55792, 58342). 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 a metric to track usage of inflight request limit.

This one is tricky. The goal is to know how 'loaded' given apiserver is before we start dropping the load, to so we need to somehow expose 'fullness' of channels.

Sadly this metric is pretty volatile so it's not clear how to do this correctly. I decided to do pre-aggregation  to smoothen the metric a bit. In the current implementation the metric publishes maximum "usage" of the inflight is previous second.

If you have any ideas please share.
@smarterclayton @lavalamp @wojtek-t @liggitt @deads2k @caesarxuchao @sttts @crassirostris @hulkholden

```release-note
NONE
```
2018-01-26 06:54:36 -08:00
Kubernetes Submit Queue 27d01b5ab9
Merge pull request #57938 from dims/add-binary-configmap
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 binary configmap

Reviving code from https://github.com/kubernetes/kubernetes/pull/33549 submitted by @zreigz

**What this PR does / why we need it**:
Add support for binary files in ConfigMap

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

**Special notes for your reviewer**:

**Release note**:

```release-note
ConfigMap objects now support binary data via a new `binaryData` field. When using `kubectl create configmap --from-file`, files containing non-UTF8 data will be placed in this new field in order to preserve the non-UTF8 data. Use of this feature requires 1.10+ apiserver and kubelets.
```
2018-01-26 04:34:33 -08:00
Marek Grabowski 000d7bac29 Add a metric to track usage of inflight request limit. 2018-01-26 11:11:16 +00:00
Kubernetes Submit Queue d9ded43bbe
Merge pull request #58101 from lavalamp/scramble-rv
Automatic merge from submit-queue (batch tested with PRs 58518, 58771, 58101, 56829). 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>.

Resource version parsing should all be in one place

This is 100% refactoring that ought to be a no-op at run time. It puts resource version parsing in a single file. Doing this because I want to follow up with a change which will make it obvious to users of the system our rules about resource version. Don't want to mix that with this refactor (on the off chance it gets rolled back).

Part of: #58112

```release-note
NONE
```
2018-01-26 01:03:38 -08:00
hzxuzhonghu 7bf825a763 fix runtime-config bug in kube-aggregator 2018-01-26 10:32:46 +08:00
Kubernetes Submit Queue 2e3cb71583
Merge pull request #56874 from caesarxuchao/fail-open-doc
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update the comments on webhook failure policy

ref: kubernetes/features#492

Note that comments on constants aren't reflected in the user docs
2018-01-25 11:44:42 -08:00
Kubernetes Submit Queue 068e1642f6
Merge pull request #58735 from liggitt/server-unavailable-errors
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>.

Distinguish service unavailable errors in client-go

related to https://github.com/kubernetes/kubernetes/issues/58642

the server is returning correct errors, but the client was not distinguishing service unavailable errors from general 5xx errors

```release-note
NONE
```
2018-01-25 06:14:21 -08:00
Kubernetes Submit Queue 0b8f3a2240
Merge pull request #58185 from caesarxuchao/webhook-cluster-scoped-resources
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>.

Never let cluster-scoped resources skip webhooks

Fix #57964

This allows user write webhooks for cluster-scoped custom resources.

We still need to figure out how to selectively exempt cluster-scoped resources from webhooks to avoid bootstrapping deadlocks. For now, if a deadlock occurs, users can work around by first deleting the webhook configuration, then rebooting the webhook, then re-enabling the webhook configuration.

```release-note
Bug fix: webhooks now do not skip cluster-scoped resources

Action required: Before upgrading your Kubernetes clusters, double check if you had configured webhooks for cluster-scoped objects (e.g., nodes, persistentVolume), these webhooks will start to take effect. Delete/modify the configs if that's not desirable.
```
2018-01-24 17:41:18 -08:00
hzxuzhonghu 1f013b7dea run update code-gen 2018-01-24 16:45:23 +08:00
hzxuzhonghu aa066e1322 remove newline after range 2018-01-24 16:44:02 +08:00
Jordan Liggitt ca2eba7040
Distinguish service unavailable errors in client-go 2018-01-24 00:14:21 -05:00
Daniel Smith 023895d597 resource version parsing should all be in one place 2018-01-23 17:18:16 -08:00
Kubernetes Submit Queue 35ed5338b1
Merge pull request #58393 from deads2k/agg-02-ga
Automatic merge from submit-queue (batch tested with PRs 54071, 58393). 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 aggregation API to v1

Finishing https://github.com/kubernetes/features/issues/263 as discussed in apimachinery

The API has been available since 1.6 and beta since 1.7.  Openshift has been using it for about a year and service catalog (@pmorie) and metrics server (@piosz @DirectXMan12) have both been using too.  The feature and the API have both been stable over that time.

@kubernetes/sig-api-machinery-api-reviews @kubernetes/api-approvers 

/assign lavalamp
/assign smarterclayton


```release-note
Promoting the apiregistration.k8s.io (aggregation) to GA
```
2018-01-23 16:41:33 -08:00
Yang Guo 454276c23c Use SSH tunnel for webhook communication iff the webhook is deployed as a service 2018-01-23 14:31:09 -08:00
David Eads 972693cffe generated 2018-01-23 14:11:49 -05:00
David Eads 9baae557da add apiregistration v1 2018-01-23 14:11:49 -05:00
Jordan Liggitt 91ba8c37d0
Return ServiceUnavailable error consistently from proxy 2018-01-23 11:00:13 -05:00
Davanum Srinivas 426eb0419e generated code and docs 2018-01-23 07:28:47 -05:00
Lukasz Zajaczkowski 7e158fb4f6 Add support for binary file in configmap 2018-01-23 07:28:34 -05:00
Kubernetes Submit Queue 30d42dc95f
Merge pull request #58438 from carlory/fix-crd
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>.

fix apiserver crash caused by nil pointer

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

1. $ref should be not supported
2. redefine CRClientGetter interface 

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

**Release note**:


```release-note
CustomResourceDefinitions: OpenAPI v3 validation schemas containing `$ref`references are no longer permitted (valid references could not be constructed previously because property ids were not permitted either). Before upgrading, ensure CRD definitions do not include those `$ref` fields.
```
2018-01-23 03:18:27 -08:00
Kubernetes Submit Queue a5e33195e4
Merge pull request #57867 from CaoShuFeng/patch_trace
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>.

trace patch operations

Just like `update`, `create`, `get` and `delete` operations.

**Release note**:
```release-note
NONE
```
2018-01-22 23:53:48 -08:00
Kubernetes Submit Queue 71426ba59f
Merge pull request #58394 from deads2k/controller-08-redeliver
Automatic merge from submit-queue (batch tested with PRs 58412, 56132, 58506, 58542, 58394). 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>.

don't stop informer delivery on error

If an informer delivery fails today, we stop delivering to it entirely.  The pull updates the code to skip that particular notification, delay, and continue delivery with the next time.

/assign derekwaynecarr 
/assign ncdc
/assign ash2k

@derekwaynecarr This would change the "the controller isn't doing anything?!" to "the controller missed my (individual) resource!"


```release-note
NONE
```
2018-01-22 22:57:47 -08:00
Kubernetes Submit Queue 3550551b9f
Merge pull request #58528 from deads2k/kubelet-02-mincipher
Automatic merge from submit-queue (batch tested with PRs 58547, 57228, 58528, 58499, 58618). 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 min version flag

Adds a flag for controlling the minimum TLS level allowed.

/assign liggitt

@kubernetes/sig-node-pr-reviews @k8s-mirror-api-machinery-pr-reviews 

```release-note
--tls-min-version on kubelet and kube-apiserver allow for configuring minimum TLS versions
```
2018-01-22 20:49:35 -08:00
Kubernetes Submit Queue f0b7319494
Merge pull request #57228 from hzxuzhonghu/runtime-config
Automatic merge from submit-queue (batch tested with PRs 58547, 57228, 58528, 58499, 58618). 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>.

pass down runtime-config through apiserver chain

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

>kube-apiserver is actually a delegation chain of aggregator+kube+apiextensions. Let's pass down runtime-config through the chain, each layer removing the groups it knows about.

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

**Special notes for your reviewer**:

make a new pkg `k8s.io/apiserver/pkg/server/resourceconfig`, and 
1. move resourceconfig related code to it. 
2. abstract generic used function `MergeAPIResourceConfigs`, put it here.

**Release note**:

```release-note
NONE
```
2018-01-22 20:49:32 -08:00
Kubernetes Submit Queue 619305f101
Merge pull request #58547 from liggitt/watch-cache-delete-resourceversion
Automatic merge from submit-queue (batch tested with PRs 58547, 57228, 58528, 58499, 58618). 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>.

Send correct resource version for delete events from watch cache

Fixes #58545 

the watch cache filtering is returning the previous object content intact, including resource version. this is the logic the watch cache uses:
```go
switch {
case curObjPasses && !oldObjPasses:
	watchEvent = watch.Event{Type: watch.Added, Object: event.Object.DeepCopyObject()}
case curObjPasses && oldObjPasses:
	watchEvent = watch.Event{Type: watch.Modified, Object: event.Object.DeepCopyObject()}
case !curObjPasses && oldObjPasses:
	watchEvent = watch.Event{Type: watch.Deleted, Object: event.PrevObject.DeepCopyObject()}
}
```

when processing a delete event, we should be sending the old object's content *but* with the event's resource version set in it. corresponding logic exists in the uncached stores:

77ac663df4/staging/src/k8s.io/apiserver/pkg/storage/etcd/etcd_watcher.go (L401-L403)

77ac663df4/staging/src/k8s.io/apiserver/pkg/storage/etcd3/watcher.go (L373-L378)


```release-note
Fixes an issue where the resourceVersion of an object in a DELETE watch event was not the resourceVersion of the delete itself, but of the last update to the object. This could cause clients receiving the watch event to revert to an old "last observed" resource version, and disrupt their ability to re-establish watches properly.
```
2018-01-22 20:49:30 -08:00
Ahmet Alp Balkan ad4fdc7d15
Refactor gcp.go methods for testability, add tests
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-01-22 11:21:17 -08:00
David Eads 2fa93da6d5 don't stop informer delivery on error 2018-01-22 09:55:49 -05:00
carlory 5819a608b9 ref -> $ref 2018-01-22 21:51:50 +08:00
hzxuzhonghu eff1f20ff1 run update bazel and staging-godep 2018-01-22 19:10:28 +08:00
hzxuzhonghu 2f403b7ad1 pass APIEnablement through apiserver chain 2018-01-22 19:10:26 +08:00
Kubernetes Submit Queue 23226c24d4
Merge pull request #58070 from weekface/weekface/aggregator-proxy-fix
Automatic merge from submit-queue (batch tested with PRs 57896, 58070). 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>.

Don't remove APIService from apiHandlerManager when its Available Conditions is not True

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

I use my own apiserver works together with `kube-apiserver`, i have a custom resource: `databases` and created a `database` named: `db-name-1`.

When this apiserver is down(for example: OOMKilled), `kubectl get databases db-name-1 -v 10` returns `404 NotFound`:

```
[{
  "metadata": {},
  "status": "Failure",
  "message": "the server could not find the requested resource (get databases.core.example.com db-name-1)”,
  "reason": "NotFound",
  "details": {
    "name": “db-name-1”,
    "group": "core.example.com",
    "kind": “databases”,
    "causes": [
      {
        "reason": "UnexpectedServerResponse",
        "message": "404 page not found"
      }
    ]
  },
  "code": 404
}]
```

But it is not really `NotFound`.

So if the APIService is not available, just return 503.

There was a PR related with this: #57943 

**Release note**:


```release-note
kube-apiserver: requests to endpoints handled by unavailable extension API servers (as indicated by an `Available` condition of `false` in the registered APIService) now return `503` errors instead of `404` errors.
```
2018-01-21 20:25:31 -08:00
carlory 8b8d522228 fix apiserver crash caused by nil pointer and ensure CRD schema
validator can be constructed during validation.
2018-01-22 12:05:39 +08:00
weekface f06e68a3ab Update unavailable aggregated APIs to 503s instead of 404s 2018-01-21 10:25:03 +08:00
Kubernetes Submit Queue c9c6901303
Merge pull request #58520 from porridge/fix-connreset
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 IsConnectionReset work with more error implementations.

**What this PR does / why we need it**:
This fixes the code to correctly navigate error hierarchy, and actually
work.

**Which issue(s) this PR fixes**
An improvement for #55860

**Special notes for your reviewer**:

Integration-testing this code is somewhat hard. What I did to reproduce this
condition reliably was:

1. use iptables to let the TCP handshake packets through but reject
payload-carrying packets with:
```
sudo iptables -t raw -I PREROUTING -d localhost --protocol tcp --dport 443  -j NOTRACK
sudo iptables -t filter -I INPUT -d localhost --protocol tcp --dport 443 -m string --algo bm --string http  -j REJECT --reject-with tcp-reset
```
2. start a dummy server with: `nc -l -4 localhost 443`
3. make the client issue a GET on localhost:443

Then I added instrumentation to the place in k8s.io/client-go/rest/request.go
which calls this code, to discover the actual error hierarchy.

I think another way to test this would be to run a dummy server which would
listen() on a socket, accept() and then close() the incoming connection
straight away.

**Release note**:
```release-note
Correctly handle transient connection reset errors on GET requests from client library.
```
2018-01-20 05:37:25 -08:00
Jordan Liggitt 57998d247d
Send correct resource version for delete events from watch cache 2018-01-19 18:08:35 -05:00
Chao Xu c80a7ee9e1 generated 2018-01-19 14:05:04 -08:00
Chao Xu 0d717272cc Never let cluster-scoped resources skip webhooks 2018-01-19 14:05:04 -08:00
Marcin Owsiany 313128d760 Make IsConnectionReset work with more error implementations. 2018-01-19 21:49:04 +01:00
David Eads 4ce7bcced4 generated 2018-01-19 14:08:28 -05:00
David Eads ad16803470 add options for min tls levels 2018-01-19 14:08:27 -05:00
Kubernetes Submit Queue 07ad1f7176
Merge pull request #58340 from gmarek/dropped
Automatic merge from submit-queue (batch tested with PRs 58446, 58459, 58340). 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 apiserver metric for number of requests dropped by 'max-inflight-requests' filters.

Useful for figuring out on which dimension master is overloaded.

cc @sttts @lavalamp @deads2k @timothysc @hulkholden
2018-01-19 09:49:32 -08:00
Kubernetes Submit Queue 0dd88a1fb8
Merge pull request #58446 from hzxuzhonghu/sample-controleer
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>.

upgrade sample-controller deployment to apps/v1

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

apps/v1 is GA


**Release note**:

```release-note
NONE
```
/assign @sttts @nikhita
2018-01-19 09:42:03 -08:00
Jordan Liggitt 2068044910
Remove github.com/juju/ratelimit 2018-01-19 11:48:52 -05:00
Jordan Liggitt 4b9f00988b
Switch from juju/ratelimit to golang.org/x/time/rate 2018-01-19 11:48:52 -05:00
Jordan Liggitt a9ed90f227
Remove Saturation() from rate limiter interface 2018-01-19 11:48:51 -05:00
Kubernetes Submit Queue f9bb978ad6
Merge pull request #58123 from hzxuzhonghu/refactor-admission-flag
Automatic merge from submit-queue (batch tested with PRs 58496, 58078, 58123). 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>.

refactor admission flag

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

Refactor admission control flag, finally make cluster admins not care about orders in this flag.

**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
Add `--enable-admission-plugin` `--disable-admission-plugin` flags and deprecate `--admission-control`.
Afterwards, don't care about the orders specified in the flags.
```
2018-01-19 07:22:29 -08:00
Kubernetes Submit Queue 5a572d3e27
Merge pull request #58365 from ashleyschuett/fix/spelling
Automatic merge from submit-queue (batch tested with PRs 56948, 58365, 58501). 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>.

Fixed spelling of Promethus to Prometheus

Release note:
```release-note
NONE
```
2018-01-19 01:12:30 -08:00
hzxuzhonghu 5c9e020d7d run update bazel 2018-01-19 13:18:27 +08:00
hzxuzhonghu 82c3d2492c update admission test cases 2018-01-19 13:16:36 +08:00
hzxuzhonghu 7c5f9e0bba refactor admission flag: add two admission flags and make plugins auto in recommended order 2018-01-19 13:16:36 +08:00
Kubernetes Submit Queue 7dadeee5e8
Merge pull request #54544 from YuxiJin-tobeyjin/fatal2fatalf
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>.

Use Fatalf instead of Fatal while formatting the output is needed

**What this PR does / why we need it**:
Should use Fatalf instead of Fatal while formatting the output is needed

**Release note**:
NONE 

```release-note
```
2018-01-18 13:12:47 -08:00
Kubernetes Submit Queue c7526fbb67
Merge pull request #58439 from liggitt/admission-scheme
Automatic merge from submit-queue (batch tested with PRs 57868, 58284, 56370, 58400, 58439). 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 decoding of admission config file

Fixes #58426

1a552bbe14 (diff-eb9532eb476083e1ab31da9dd6f83eceR41) attempted to use a locally constructed scheme, but the name `scheme` was shadowed by a function arg.

Attempts to run the apiserver with a structured plugin config file would fail to decode (since the passed scheme didn't know about the AdmissionConfiguration type), then fall back to treating the file as a legacy config, and silently continue without correct config

```release-note
kube-apiserver: fixes loading of `--admission-control-config-file` containing AdmissionConfiguration apiserver.k8s.io/v1alpha1 config object
```
2018-01-18 13:11:39 -08:00
Cao Shufeng 534eb3dfbd trace patch operations
Just like `update`, `create`, `get` and `delete` operations.
2018-01-19 02:11:26 +08:00
Kubernetes Submit Queue 8cc5ccfb49
Merge pull request #58209 from NickrenREN/csi-fstype
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 FSType for CSI volume source

**What this PR does / why we need it**:
Add FSType for CSI volume source to specify filesystems (alpha defaults to `ext4`)

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

**Special notes for your reviewer**:

**Release note**:
```release-note
Add FSType for CSI volume source to specify filesystems
```

/assign @saad-ali 
cc @vladimirvivien
2018-01-18 09:35:58 -08:00
Marek Grabowski 32c66c2b56 Add apiserver metric for number of requests dropped by 'inflight-request' filters. 2018-01-18 13:54:50 +00:00
Kubernetes Submit Queue 58560ab422
Merge pull request #58263 from lcfang/test0115
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>.

fix some bad url

**What this PR does / why we need it**:
fix some bad url
**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

```
2018-01-18 04:46:10 -08:00
hzxuzhonghu b240d92391 run update bazel 2018-01-18 18:46:14 +08:00
hzxuzhonghu 386e001446 upgrade to apps/v1 deployment 2018-01-18 18:46:09 +08:00
Kubernetes Submit Queue 048757b8a5
Merge pull request #53631 from dixudx/enforce_cobra_required_flags
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>.

update vendor spf13/cobra to enforce required flags

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

spf13/cobra#502 has enforced checking flags that marked as required, an error will be raised if unset.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*:fixes #54855
xref #48400
fixes kubernetes/kubectl#121 

**Special notes for your reviewer**:
/assign @liggitt @eparis 

**Release note**:

```release-note
kubectl now enforces required flags at a more fundamental level
```
2018-01-18 02:00:27 -08:00
Jordan Liggitt 34328ea87d
Fix loading structured admission plugin config 2018-01-18 02:32:28 -05:00
Jordan Liggitt ed53e8a25c
Surface error loading admission plugin config 2018-01-18 02:32:09 -05:00
Kubernetes Submit Queue b7100f1ee7
Merge pull request #48859 from victorgp/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>.

Support for custom tls cipher suites in api server and kubelet

**What this PR does / why we need it**:
This pull request aims to solve the problem of users not able to set custom cipher suites in the api server.
Several users have requested this given that some default ciphers are vulnerable.
There is a discussion in #41038 of how to implement this. The options are:
- Setting a fixed list of ciphers, but users will have different requirements so a fixed list would be problematic.
- Letting the user set them by parameter, this requires adding a new parameter that could be pretty long with the list of all the ciphers.

I implemented the second option, if the ciphers are not passed by parameter, the Go default ones will be used (same behavior as now).

**Which issue this PR fixes** 
fixes #41038 

**Special notes for your reviewer**:
The ciphers in Go tls config are constants and the ones passed by parameters are a comma-separated list. I needed to create the `type CipherSuitesFlag` to support that conversion/mapping, because i couldn't find any way to do this type of reflection in Go.
If you think there is another way to implement this, let me know.

If you want to test it out, this is a ciphers combination i tested without the weak ones:

```
TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
```

If this is merged i will implement the same for the Kubelet.

**Release note**:
```release-note
kube-apiserver and kubelet now support customizing TLS ciphers via a `--tls-cipher-suites` flag
```
2018-01-17 17:46:40 -08:00
Ahmet Alp Balkan e19dc6a868
configurable scopes for gcp default credentials
- add config.scopes field comma-separated scope URLs, to be used with Google
  Application Default Credentials (i.e. GOOGLE_APPLICATION_CREDENTIALS env)
- default scopes now include userinfo.email scope so the headless app with
  gserviceaccount keys can have RoleBindings with email instead of account ID.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2018-01-17 17:21:42 -08:00
Kubernetes Submit Queue 12b5bf9e79
Merge pull request #58411 from sttts/sttts-compile-fix-bootstrap-token-api
Automatic merge from submit-queue (batch tested with PRs 58411, 58407, 52863). 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: fix bootstrap token imports

Fixes the publishing-bot https://github.com/kubernetes/kubernetes/issues/56876#issuecomment-358429408.

Introduced by https://github.com/kubernetes/kubernetes/pull/55595
2018-01-17 17:00:30 -08:00
Victor Garcia d7dbc96c70 Adding support for custom TLS ciphers in api server and kubelet 2018-01-17 12:55:55 -08:00
Kubernetes Submit Queue 4257f7595a
Merge pull request #58375 from liggitt/decrypt
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>.

Recheck if transformed data is stale when doing live lookup during update

Fixes #49565

Caching storage can pass in a cached object to `GuaranteedUpdate` as a hint for the current object.

If the hint is identical to the data we want to persist, before short-circuiting as a no-op update, we force a live lookup.

We should check two things on the result of that live lookup before short-circuiting as a no-op update:
1. the bytes we want to persist still match the transformed bytes read from etcd
2. the state read from etcd didn't report itself as stale. this would mean the transformer used to read the data would not be the transformer used to write it, and "no-op" writes should still be performed, since transformation will make the underlying content actually different.

After a live lookup, we checked byte equality, but not the stale indicator. This meant that key rotation or encrypted->decrypted, and decrypted->encrypted updates are broken.

Introduced in #54780 and picked back to 1.8 in #55294

```release-note
Fixed encryption key and encryption provider rotation
```
2018-01-17 12:46:41 -08:00
Dr. Stefan Schimanski 36314bf10b client-go: fix bootstrap token imports 2018-01-17 21:15:02 +01:00
Kubernetes Submit Queue 48f69ac964
Merge pull request #55595 from guangxuli/move_token_constant_and_helper
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 generic Bootstrap Token constants and helpers to client-go

**What this PR does / why we need it**:
per https://github.com/kubernetes/client-go/issues/114

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

fix  https://github.com/kubernetes/client-go/issues/114

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```
2018-01-17 10:22:25 -08:00
Kubernetes Submit Queue 99fb21f61f
Merge pull request #58149 from CaoShuFeng/duplicated_import_2
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 duplicated import

**Release note**:
```release-note
NONE
```
2018-01-17 01:41:36 -08:00
Kubernetes Submit Queue 75b2109f23
Merge pull request #58008 from rphillips/fixes/etcd_grpc_keepalive
Automatic merge from submit-queue (batch tested with PRs 58008, 58351). 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 client: add keepalive

**What this PR does / why we need it**: This PR shortens the keepaliveTimeout and enables keepalive within the etcd client to allow the socket to be closed cleanly on a dead etcd server.

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

**Special notes for your reviewer**:

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

/cc @xiang90
2018-01-17 00:56:28 -08:00
Gavin f653d02b05 create auto-gen files 2018-01-17 16:23:03 +08:00
Gavin bb5e156aba Add generic Bootstrap Token constants and helpers to client-go 2018-01-17 16:22:37 +08:00
Jordan Liggitt 070089c6bf
Recheck if transformed data is stale when doing live lookup during update 2018-01-17 02:06:47 -05:00
Ashley 6a209a1e51
Fixed spelling of Promethus to Prometheus 2018-01-16 20:56:22 -05:00
Cao Shufeng 4e7398b67b remove duplicated import 2018-01-17 09:34:59 +08:00
Kubernetes Submit Queue fa7dde385b
Merge pull request #58341 from deads2k/controller-06-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>.

say which lease is being acquired

Adds which lease is being acquired to the message
2018-01-16 09:41:21 -08:00
Kubernetes Submit Queue 268555a30a
Merge pull request #57504 from yue9944882/fix-fake-client-dummy-watch
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>.

feat(fakeclient): push event on watched channel on add/update/delete

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

This PR enables watch function for kubernetes [fakeclient](1bcf0b0a22/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go (L88)). 

This fake client add watchReactorFunction by wrapping [watch.NewFake](1bcf0b0a22/staging/src/k8s.io/client-go/kubernetes/fake/clientset_generated.go (L98)) which is a `chan Event` but actually nothing pushes objects into this channel. So all watch function called by fake client will never return or never receive any object. 

This PR intercepts ReactionFunc of `Create / Update / DeleteActionImpl` and will push the requested object to channel. 

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 #54075

**Special notes for your reviewer**:

**Release note**:

```dev-release-note
enable watch function for fake client
```
2018-01-16 08:39:03 -08:00
David Eads 5b854e7b17 say which lease is being acquired 2018-01-16 11:00:43 -05:00
Kubernetes Submit Queue a7c65d29e6
Merge pull request #58260 from liggitt/crd-yaml
Automatic merge from submit-queue (batch tested with PRs 58260, 58326). 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 submitting/receiving CRD objects as yaml

Fixes #37455

```release-note
Custom resources can now be submitted to and received from the API server in application/yaml format.
```
2018-01-16 06:42:30 -08:00
yue9944882 6f381ab2cd Regenerating code of fake clientset 2018-01-16 22:11:43 +08:00
yue9944882 f57cc0b22d fix(fakeclient): write event to watch channel on add/update/delete
fix races with watch call

add test for non-namespace resource watch

add matching for all-namespace-watch

fix delete namespace watch & restrict test

fix multiple invocation on same resource & namespace

add descriptive doc for tracker.watchers
2018-01-16 22:11:38 +08:00
Kubernetes Submit Queue 529bf83089
Merge pull request #58203 from CaoShuFeng/signature
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 invalid and useless functions from unit test

**Release note**:
```release-note
NONE
```
2018-01-16 04:29:26 -08:00
hzxuzhonghu 631119a7d6 move prometheus init to k8s.io/apiserver/pkg/endpoints/metrics/metrics.go 2018-01-16 15:38:33 +08:00
Nikhita Raghunath 713b1fc396 bump(gopkg.in/yaml.v2): 670d4cfef0544295bc27a114dbac37980d83185a
Fix parsing of non-specific tags
2018-01-16 10:04:58 +05:30
NickrenREN 37d42870ea auto generated code 2018-01-16 12:34:31 +08:00
NickrenREN 87cebae738 Add fsType for CSI 2018-01-16 12:34:04 +08:00
Jordan Liggitt 59c305b590
Add support for submitting/receiving CRD objects as yaml 2018-01-15 21:12:48 -05:00
Jordan Liggitt aa504ccd57
Return correct error when submitting patch in unsupported format 2018-01-15 21:12:47 -05:00
Jordan Liggitt 037eec3b9a
Add error helpers and constants for NotAcceptable and UnsupportedMediaType 2018-01-15 21:10:11 -05:00
Kubernetes Submit Queue 014130e4e9
Merge pull request #58258 from liggitt/unsupported-mime-type-error
Automatic merge from submit-queue (batch tested with PRs 58207, 58258). 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>.

Return the correct set of supported mime types for non-streaming requests

Fixes the error response when submitting unsupported mime types to non-streaming endpoints

See https://github.com/kubernetes/kubernetes/issues/37455#issuecomment-353526250

```release-note
NONE
```
2018-01-15 10:35:30 -08:00
Jordan Liggitt 7e33b12856
Return the correct set of supported mime types for non-streaming requests 2018-01-15 10:10:29 -05:00
Dr. Stefan Schimanski 83268fa9a8 Update generated files 2018-01-15 15:32:22 +01:00
Dr. Stefan Schimanski 1a552bbe14 admission: do not leak admission config types outside of the plugins 2018-01-15 14:37:41 +01:00
Nikhita Raghunath 4139594e66 unstructured helpers: print path in error 2018-01-15 15:19:24 +05:30
Cao Shufeng eb1650ce56 remove invalid and useless functions from unit test 2018-01-15 17:33:18 +08:00
lcfang f4f8e6fc30 fix some bad url 2018-01-15 09:49:52 +08:00
Da K. Ma 9a78753144 Updated PID pressure node condition.
Signed-off-by: Da K. Ma <madaxa@cn.ibm.com>
2018-01-14 18:26:00 +08:00
ilackarms 410b4016fd periodically flush writer 2018-01-13 13:14:31 -05:00
Kubernetes Submit Queue 188e6ebcdb
Merge pull request #57114 from yliaog/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>.

added defaults for --watch-cache-sizes description.

**What this PR does / why we need it**:
added defaults for --watch-cache-sizes description to make it clear what the defaults would be when not specified

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-13 09:22:50 -08:00
Kubernetes Submit Queue 52a2256b1a
Merge pull request #57843 from p0lyn0mial/wire_generic_scaler
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>.

wires the generic scaler to kubectl

**What this PR does / why we need it**:
the changes introduced in this commit plumbs in the generic scaler to kubectl.
note that we don't change the behaviour of kubectl.
For example it won't scale new resources. That's the end goal.
The first step is to retrofit existing code to use the generic scaler.

**Release note**:

```release-note
NONE
```
2018-01-13 01:26:24 -08:00
Kubernetes Submit Queue 9b6ac17f42
Merge pull request #57883 from hzxuzhonghu/crd-handler
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>.

refactor customeresource handler

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

- fix data race bug
- fix lock usage bug.
- remove some redundant code

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-12 21:34:52 -08:00
Kubernetes Submit Queue 99abe92a5d
Merge pull request #58187 from caesarxuchao/fix-typo
Automatic merge from submit-queue (batch tested with PRs 57266, 58187, 58186, 46245, 56509). 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] Fix a typo

Fix https://github.com/kubernetes/kubernetes/pull/58025#discussion_r161052726
2018-01-12 20:34:48 -08:00
Kubernetes Submit Queue dd169aabe8
Merge pull request #57389 from sttts/sttts-roundtrip-deadcode
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>.

apimachinery: remove dead code from roundtrip tester
2018-01-12 10:56:01 -08:00
Kubernetes Submit Queue f6d0632bbb
Merge pull request #57059 from ericchiang/client-go/remove-openapi-import
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: remove open-api import from types

This builds off of https://github.com/kubernetes/kube-openapi/pull/21 and removes the following imports from `k8s.io/client-go/kubernetes`:

```
github.com/PuerkitoBio/purell
github.com/PuerkitoBio/urlesc
github.com/emicklei/go-restful
github.com/emicklei/go-restful/log
github.com/go-openapi/jsonpointer
github.com/go-openapi/jsonreference
github.com/go-openapi/spec
github.com/go-openapi/swag
github.com/mailru/easyjson/buffer
github.com/mailru/easyjson/jlexer
github.com/mailru/easyjson/jwriter
golang.org/x/text/cases
golang.org/x/text/internal
golang.org/x/text/internal/tag
golang.org/x/text/language
golang.org/x/text/runes
golang.org/x/text/secure/precis
golang.org/x/text/width
k8s.io/kube-openapi/pkg/common
```

/assign @sttts 
/assign @mbohlool 

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


```release-note
NONE
```
2018-01-12 01:26:16 -08:00
p0lyn0mial dd9de90b0a the changes introduced in this commit plumbs in the generic scaler into kubectl.
note that we don't change the behaviour of kubectl.
For example it won't scale new resources. That's the end goal.
The first step is to retrofit existing code to use the generic scaler.
2018-01-12 09:21:18 +01:00
Kubernetes Submit Queue 67a5a26673
Merge pull request #56660 from hzxuzhonghu/recommened-admission
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 admission into RecommendedOptions

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

make admission part of the RecommendedOptions

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-11 21:20:39 -08:00
Chao Xu 9d1b687914 fix a typo 2018-01-11 18:24:24 -08:00
Eric Chiang e1dda7e3be bump(k8s.io/kube-openapi): a07b7bbb58e7fdc5144f8d7046331d29fc9ad3b3 2018-01-11 09:33:27 -08:00
Eric Chiang eb0ac60175 remove OpenAPI import from types 2018-01-11 09:27:26 -08:00
Kubernetes Submit Queue 4a77bd53e8
Merge pull request #57259 from ericchiang/client-go-no-cache-import
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: remove import of github.com/gregjones/httpcache

Moves NewCacheRoundTripper from `k8s.io/client-go/transport` to its own package. This prevents Kubernetes clients from requiring its dependencies.

This change removes the following transitive imports from `k8s.io/client-go/kubernetes`

```
github.com/google/btree
github.com/gregjones/httpcache
github.com/gregjones/httpcache/diskcache
github.com/peterbourgon/diskv
```


```release-note
NONE
```
2018-01-11 01:25:50 -08:00
Kubernetes Submit Queue eba10f1ea1
Merge pull request #58091 from deads2k/client-01-scale
Automatic merge from submit-queue (batch tested with PRs 57823, 58091, 58093, 58096, 57020). 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>.

manually handle encoding and decoding in the scale client

@p0lyn0mial I think this resolves the problems you're seeing in https://github.com/kubernetes/kubernetes/pull/57843 by manually controlling the encode and decode in the client itself.



/assign @DirectXMan12
2018-01-10 12:37:41 -08:00
Kubernetes Submit Queue bc56a90e0b
Merge pull request #58062 from lcfang/fixurl-0110
Automatic merge from submit-queue (batch tested with PRs 58025, 57112, 57879, 57571, 58062). 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>.

fixed some bad url

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

fixed some bad url

**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-01-10 11:46:52 -08:00
Kubernetes Submit Queue 4bc286f025
Merge pull request #57571 from spiffxp/mk-staging-repos-authoritative
Automatic merge from submit-queue (batch tested with PRs 58025, 57112, 57879, 57571, 58062). 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>.

Treat staging repos as authoritative source for all files

Add CONTRIBUTING.md files to remind people not to PR directly into the published repos.

/hold
I believe this requires removing these files from the published repos if any copies exist there

ref: kubernetes/kubernetes#57559
2018-01-10 11:46:49 -08:00
Kubernetes Submit Queue 6f3e39ec94
Merge pull request #58025 from caesarxuchao/default-webhook
Automatic merge from submit-queue (batch tested with PRs 58025, 57112, 57879, 57571, 58062). 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>.

Let mutating webhook defaults the object

...after applying the patch sent back by the webhook

This should be treated as a bug and cherrypicked to 1.9.

Fixes #57982
2018-01-10 11:46:40 -08:00
David Eads 877143e547 manuallly handle encoding and decoding in the scale client 2018-01-10 12:11:17 -05:00
lcfang 713e28874a fixed some bad url 2018-01-10 22:05:00 +08:00
Kubernetes Submit Queue b4ad7e6e38
Merge pull request #58003 from antoineco/gen-cli-logtostderr
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 code generators log to stderr by default

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

Most code generators inside `staging/` are CLI tools. It makes sense for CLI tools (in general) to log to stdout/err, especially knowing that [`glog` has a 30sec flush interval](a227c1ea2c/pkg/kubectl/util/logs/logs.go (L49)), which leads to logs being lost and makes troubleshooting tedious for people not aware of that quirk.

Fixes #53791

```release-note
NONE
```
2018-01-10 03:58:14 -08:00
Kubernetes Submit Queue 5e444bbe12
Merge pull request #57613 from mtaufen/explicit-kubelet-flags
Automatic merge from submit-queue (batch tested with PRs 57733, 57613, 57953). 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>.

Explicit kubelet flags

The Kubelet was using the global flag set.
Libraries also often use the global flag set.
There are flags in the Kubelet's usage statement for which the Kubelet does not control registration.
This is bad, we must have full control of our command-line API.
This PR puts a stop to it.

I worked through the Kubelet's usage printout and tracked down the flags. 

In the below list, flags with checkboxes are one of:
- explicitly **registered** in this PR
- thought about and outright **rejected**
- thought about and **registered-deprecated** for legacy reasons

For the others we need to figure out whether they should be **registered** or **rejected** or **registered-deprecated**. 

### cadvisor:
grep commands, for reference:
```
# flag definitions in cadvisor
git grep -E "\"application_metrics_count_limit\"|\"boot_id_file\"|\"container_hints\"|\"containerd\"|\"docker\"|\"docker_env_metadata_whitelist\"|\"docker_only\"|\"docker_root\"|\"docker-tls\"|\"docker-tls-ca\"|\"docker-tls-cert\"|\"docker-tls-key\"|\"enable_load_reader\"|\"event_storage_age_limit\"|\"event_storage_event_limit\"|\"global_housekeeping_interval\"|\"housekeeping_interval\"|\"log_cadvisor_usage\"|\"machine_id_file\"|\"storage_driver_buffer_duration\"|\"storage_driver_db\"|\"storage_driver_host\"|\"storage_driver_password\"|\"storage_driver_secure\"|\"storage_driver_table\"|\"storage_driver_user\"" -- vendor/github.com/google/cadvisor
# flag invocations
git grep -E "\--application_metrics_count_limit|--boot_id_file|--container_hints|--containerd|--docker|--docker_env_metadata_whitelist|--docker_only|--docker_root|--docker_tls|--docker_tls_ca|--docker_tls_cert|--docker_tls_key|--enable_load_reader|--event_storage_age_limit|--event_storage_event_limit|--global_housekeeping_interval|--housekeeping_interval|--log_cadvisor_usage|--machine_id_file|--storage_driver_buffer_duration|--storage_driver_db|--storage_driver_host|--storage_driver_password|--storage_driver_secure|--storage_driver_table|--storage_driver_user" -- ':(exclude)pkg/generated/bindata.go' ':(exclude)Godeps' ':(exclude)CHANGELOG*' ':(exclude)vendor'
# normalized flag invocations
git grep -E "\--application-metrics-count-limit|--boot-id-file|--container-hints|--containerd|--docker|--docker-env-metadata-whitelist|--docker-only|--docker-root|--docker-tls|--docker-tls-ca|--docker-tls-cert|--docker-tls-key|--enable-load-reader|--event-storage-age-limit|--event-storage-event-limit|--global-housekeeping-interval|--housekeeping-interval|--log-cadvisor-usage|--machine-id-file|--storage-driver-buffer-duration|--storage-driver-db|--storage-driver-host|--storage-driver-password|--storage-driver-secure|--storage-driver-table|--storage-driver-user" -- ':(exclude)pkg/generated/bindata.go' ':(exclude)Godeps' ':(exclude)CHANGELOG*' ':(exclude)vendor'
# flag names
git grep -E "application_metrics_count_limit|boot_id_file|container_hints|containerd|docker|docker_env_metadata_whitelist|docker_only|docker_root|docker_tls|docker_tls_ca|docker_tls_cert|docker_tls_key|enable_load_reader|event_storage_age_limit|event_storage_event_limit|global_housekeeping_interval|housekeeping_interval|log_cadvisor_usage|machine_id_file|storage_driver_buffer_duration|storage_driver_db|storage_driver_host|storage_driver_password|storage_driver_secure|storage_driver_table|storage_driver_user"  ':(exclude)pkg/generated/bindata.go' ':(exclude)Godeps' ':(exclude)CHANGELOG*' ':(exclude)vendor'
# normalized flag names
git grep -E "application-metrics-count-limit|boot-id-file|container-hints|containerd|docker|docker-env-metadata-whitelist|docker-only|docker-root|docker-tls|docker-tls-ca|docker-tls-cert|docker-tls-key|enable-load-reader|event-storage-age-limit|event-storage-event-limit|global-housekeeping-interval|housekeeping-interval|log-cadvisor-usage|machine-id-file|storage-driver-buffer-duration|storage-driver-db|storage-driver-host|storage-driver-password|storage-driver-secure|storage-driver-table|storage-driver-user"  ':(exclude)pkg/generated/bindata.go' ':(exclude)Godeps' ':(exclude)CHANGELOG*' ':(exclude)vendor'
# normalized and underscore names combined
git grep -E "application_metrics_count_limit|boot_id_file|container_hints|containerd|docker|docker_env_metadata_whitelist|docker_only|docker_root|docker_tls|docker_tls_ca|docker_tls_cert|docker_tls_key|enable_load_reader|event_storage_age_limit|event_storage_event_limit|global_housekeeping_interval|housekeeping_interval|log_cadvisor_usage|machine_id_file|storage_driver_buffer_duration|storage_driver_db|storage_driver_host|storage_driver_password|storage_driver_secure|storage_driver_table|storage_driver_user|application-metrics-count-limit|boot-id-file|container-hints|containerd|docker-env-metadata-whitelist|docker-only|docker-root|docker-tls|docker-tls-ca|docker-tls-cert|docker-tls-key|enable-load-reader|event-storage-age-limit|event-storage-event-limit|global-housekeeping-interval|housekeeping-interval|log-cadvisor-usage|machine-id-file|storage-driver-buffer-duration|storage-driver-db|storage-driver-host|storage-driver-password|storage-driver-secure|storage-driver-table|storage-driver-user"  ':(exclude)pkg/generated/bindata.go' ':(exclude)Godeps' ':(exclude)CHANGELOG*' ':(exclude)vendor'
```
- [x]      --docker-root (**registered** - this is used in `cluster/saltbase/salt/kubelet/default`)
- [x]      --housekeeping-interval (**registered** - e2e node tests rely on this (`test/e2e_node/resource_collector.go`))
- [x]      --application-metrics-count-limit (**registered-deprecated** - temporarily register for legacy)
- [x]      --boot-id-file (**registered-deprecated** - temporarily register for legacy)
- [x]      --container-hints (**registered-deprecated** - temporarily register for legacy)
- [x]      --containerd (**registered-deprecated** - temporarily register for legacy)
- [x]      --docker (**registered-deprecated** - temporarily register for legacy)
- [x]      --docker-env-metadata-whitelist (**registered-deprecated** - temporarily register for legacy)
- [x]      --docker-only (**registered-deprecated** - temporarily register for legacy)
- [x]      --docker-tls (**registered-deprecated** - temporarily register for legacy)
- [x]      --docker-tls-ca (**registered-deprecated** - temporarily register for legacy)
- [x]      --docker-tls-cert (**registered-deprecated** - temporarily register for legacy)
- [x]      --docker-tls-key (**registered-deprecated** - temporarily register for legacy)
- [x]      --enable-load-reader (**registered-deprecated** - temporarily register for legacy)
- [x]      --event-storage-age-limit (**registered-deprecated** - the Kubelet overrides the default via the global flagset (`pkg/kubelet/cadvisor/cadvisor_linux.go`), but nothing else in core repo provides)
- [x]      --event-storage-event-limit (**registered-deprecated** - the Kubelet overrides the default via the global flagset (`pkg/kubelet/cadvisor/cadvisor_linux.go`), but nothing else in core repo provides)
- [x]      --global-housekeeping-interval (**registered-deprecated** - temporarily register for legacy)
- [x]      --log-cadvisor-usage (**registered-deprecated** - temporarily register for legacy)
- [x]      --machine-id-file (**registered-deprecated** - temporarily register for legacy)
- [x]      --storage-driver-user (**registered-deprecated** - temporarily register for legacy)
- [x]      --storage-driver-password (**registered-deprecated** - temporarily register for legacy)
- [x]      --storage-driver-host (**registered-deprecated** - temporarily register for legacy)
- [x]      --storage-driver-db (**registered-deprecated** - temporarily register for legacy)
- [x]      --storage-driver-table (**registered-deprecated** - temporarily register for legacy)
- [x]      --storage-driver-secure (**registered-deprecated** - temporarily register for legacy)
- [x]      --storage-driver-buffer-duration (**registered-deprecated** - temporarily register for legacy)

### pkg/apiserver/util/logs:
- [x]      --log-flush-frequency (**registered** - like the glog flags, this is probably useful)

### pkg/credentialprovider/azure/azure_credentials.go:
- [x]      --azure-container-registry-config (**registered** - This isn't quite as straightforward as --google-json-key, because the file it points to isn't static. For now we will just register, and we will deprecate it when there is an alternative. See below comments.)

### pkg/credentialprovider/gcp/jwt.go:
- [x]      --google-json-key (**registered-deprecated** - This is really old legacy stuff to allow kubelets to authenticate with gcr (see: d5e0054eb0). See @liggit's below comment for what should be used instead.)

### pkg/cloudprovider/providers/gce/gce_loadbalancer.go:
- [x]      --cloud-provider-gce-lb-src-cidrs (**rejected** - Kubelet doesn't need to know about the cidrs that were opened in the firewall for the load balancer)

### glog:
I registered all of these, since this logging library is used pretty much everywhere in the Kubelet, and all of its toggles are probably useful.
- [x]      --logtostderr (**registered**)
- [x]      --alsologtostderr (**registered**)
- [x]  -v, --v (**registered**)
- [x]      --stderrthreshold (**registered**)
- [x]      --vmodule (**registered**)
- [x]      --log-backtrace-at (**registered**)
- [x]      --log-dir (**registered**)

### verflag:
This is how you get the Kubelet's version, absolutely necessary to register this.
- [x]      --version (**registered**)

```release-note
The Kubelet now explicitly registers all of its command-line flags with an internal flagset, which prevents flags from third party libraries from unintentionally leaking into the Kubelet's command-line API. Many unintentionally leaked flags are now marked deprecated, so that users have a chance to migrate away from them before they are removed. One previously leaked flag, --cloud-provider-gce-lb-src-cidrs, was entirely removed from the Kubelet's command-line API, because it is irrelevant to Kubelet operation.
```

Thanks to @liggitt for being surprised that we didn't already do this.
Thanks to @dashpole for realizing cadvisor flags were leaked after seeing #55863.
Thanks to @tallclair who recognized this problem a long time ago in #19432.
2018-01-09 21:51:37 -08:00
Michael Taufen 8ec1958667 All Kubelet flags should be explicitly registered
This explicitly registers Kubelet flags from libraries that were
registering flags globally, and stops parsing the global flag set.
In general, we should always be explicit about flags we register
and parse, so that we maintain control over our command-line API.
2018-01-09 17:37:34 -08:00
Chao Xu 5029bb56c4 Let mutating webhook defaults the object after applying the patch sent back by the webhook 2018-01-09 15:58:18 -08:00
Aaron Crickenberger d9b5773101 Treat staging repos as authoritative for all files
Move files from kubernetes/foo root back to
kubernetes/kubernetes/staging/src/k8s.io/foo root

Then:
- add CONTRIBUTING.md for all staging repos
- add .PULL_REQUEST_TEMPLATE to all staging repos
- ignore .github while diffing generated protobuf
2018-01-09 15:18:27 -08:00
Ryan Phillips 31ff8c6b9a etcd client: add keepalive 2018-01-09 12:04:23 -06:00
Antoine Cotten d8924c1da8
Make code generators log to stderr by default 2018-01-09 13:54:50 +01:00
Kubernetes Submit Queue 55c5d75e5d
Merge pull request #57966 from hzxuzhonghu/rm-apiserver-key-cert
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>.

update apiextentions-apiserver integration test key/crt

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

apiextentions-apiserver integration test key/crt will expire very soon. If they expire, the test case will fail.

We should fix it before hand.

regenerate it with a very long expire time, like 100 years.

**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**:

We have two choice:
1. remove the certificate 
2. generate a certificate with a very long expire time.
Both is ok, I think.
**Release note**:

```release-note
NONE
```
2018-01-09 02:21:01 -08:00
hzxuzhonghu e753040545 run update bazel and staging-godep 2018-01-09 11:38:16 +08:00
hzxuzhonghu 86ffa59d34 refactor customresource handler 2018-01-09 11:13:19 +08:00
hzxuzhonghu b0654ffeb8 update apiserver key/crt with a long expire time 2018-01-09 10:05:25 +08:00
Eric Chiang dedeb99c97 generated: update staging godeps 2018-01-08 10:00:13 -08:00
Eric Chiang ea085e0a32 client-go: remove import of github.com/gregjones/httpcache 2018-01-08 09:54:12 -08:00
Kubernetes Submit Queue af78b9bac4
Merge pull request #57864 from hzxuzhonghu/kube-aggregator
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>.

kube-aggregator APIServiceRegistrationController remove watch services 

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

>Currently APIServiceRegistrationController watch service change and find the related APIServices related if any. Then it AddAPIService/RemoveAPIService for APIAggregator.

>I dig into the kube-aggregator and find it no need totally, because AvailableConditionController update
APIServices status when related service or endpoint change. So if APIServiceRegistrationController does not watch services, it will not miss any event for APIServices.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-01-08 05:51:29 -08:00
Kubernetes Submit Queue 51acead084
Merge pull request #57958 from nikhita/sample-controller-crd-validation
Automatic merge from submit-queue (batch tested with PRs 57902, 57958). 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 CustomResourceValidation example in sample-controller

Add `CustomResourceValidation` example in sample-controller.

Addresses the following part of https://github.com/kubernetes/sample-controller/issues/2:

> CRDs support json-schema schemas. These CRDs don't have them. It would be nice to show how to add them

**Release note**:

```release-note
NONE
```

/assign sttts munnerz
2018-01-08 03:18:35 -08:00
Kubernetes Submit Queue 8504591def
Merge pull request #57508 from chechiachang/enable-label-selector-for-client-go-listwatch
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>.

Enable list option modification when create list watch

**What this PR does / why we need it**:
metav1.ListOptions support both field selector and label selector, but the current NewListWatchFromClient in client-go only support field selector.
 It would be helpful to use label selector in client-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-01-08 01:48:13 -08:00
Nikhita Raghunath 74c9efa148 Add CustomResourceValidation example in sample-controller
- Mention the schema in the example CRD.
- Update README and mention about feature gates.
2018-01-08 14:53:14 +05:30
Kubernetes Submit Queue 9f80ae7410
Merge pull request #57940 from mbssaiakhil/patch-6
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>.

Fix Typo in apiserver README
2018-01-07 21:17:15 -08:00
Kubernetes Submit Queue a2bce0d74e
Merge pull request #56769 from dixudx/forbid_unnamed_context
Automatic merge from submit-queue (batch tested with PRs 57521, 56769). 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>.

forbid unnamed context

**What this PR does / why we need it**:
forbid unnamed contexts with validation

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

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

**Release note**:

```release-note
forbid unnamed context
```
2018-01-07 11:19:45 -08:00
Joe Betz 6a0c69e971 Fix build and test errors from etcd 3.2.13 upgrade 2018-01-07 08:22:08 -08:00
Joe Betz 71c5f8ab12 Update staging deps for etcd 3.2.13 version bump 2018-01-07 08:22:08 -08:00
weekface ef85265025 tiny fix 2018-01-07 17:49:21 +08:00
M.B.S. Sai Akhil 5e9704572f
Fix Typo in apiserver README 2018-01-07 08:45:11 +05:30
Di Xu 792a229936 forbid unnamed context 2018-01-07 10:52:03 +08:00