Commit Graph

15350 Commits (c43a106b261ebdb9022fbd9bb3d60aeb6499b738)

Author SHA1 Message Date
Kubernetes Submit Queue af3050dd15 Merge pull request #32835 from yujuhong/docker_annotations
Automatic merge from submit-queue

dockershim: support annotations and filtering by sandbox ID
2016-09-16 14:17:03 -07:00
deads2k 862415aaa2 make --include-extended-apis deprecated and remove plumbing 2016-09-16 16:05:52 -04:00
Janet Kuo 30512f909d Improve error message when kubectl rolling-update fail due to version skew
Print the real error message first, the workaround later
2016-09-16 13:00:55 -07:00
deads2k 1943d256d2 make rbac authorizer use rule comparison, not covers 2016-09-16 15:53:42 -04:00
Wojciech Tyczynski d7d6249781 Don't update NodeNetworkUnavailable condition if it's already set correctly 2016-09-16 21:03:20 +02:00
deads2k 1bf17eb4e9 change factorization of listers to make them easier to add 2016-09-16 14:49:00 -04:00
Yu-Ju Hong 73f30b18e4 dockershim: support filter containers by sandbox ID 2016-09-16 11:31:15 -07:00
Yu-Ju Hong 2f60b72dd3 dockershim: add support for annotations 2016-09-16 11:31:15 -07:00
Kubernetes Submit Queue 791116476f Merge pull request #32348 from asalkeld/metrics-nil-spammy
Automatic merge from submit-queue

Disambiguate unsupported metrics from metrics errors

**What this PR does / why we need it**:
Stop logging "metrics are not supported for MetricsNil Volumes" as it spams the log.

**Which issue this PR fixes** 
fixes #20676, fixes #27373

**Special notes for your reviewer**:
None

**Release note**:
```release-note
Don't log "metrics are not supported for MetricsNil Volumes"
```
2016-09-16 11:27:15 -07:00
Yu-Ju Hong 5e318cd749 CRI: add annotations to PodSandbox
Both Container and ContainerStatus includes labels and annotations. PodSandbox
should be consistent with that.
2016-09-16 11:09:24 -07:00
Yu-Ju Hong fd70d94330 dockershim: fix sandbox/container filtering 2016-09-16 11:09:24 -07:00
Kubernetes Submit Queue e5a84398db Merge pull request #32836 from yujuhong/fix_nil_ptr
Automatic merge from submit-queue

kuberuntime: fix nil pointer dereference in killPodWithSyncResult

This fixes #32742
2016-09-16 09:40:03 -07:00
Kubernetes Submit Queue 2ca15b9f76 Merge pull request #32815 from deads2k/controller-02-daemonset-informer
Automatic merge from submit-queue

convert daemonset controller to shared informers

Convert the daemonset controller completely to `SharedInformers` for its list/watch resources.

@kubernetes/rh-cluster-infra @ncdc
2016-09-16 09:39:57 -07:00
Kubernetes Submit Queue 12d916750e Merge pull request #32387 from sttts/sttts-handler-cleanup
Automatic merge from submit-queue

Cleanup non-rest apiserver handlers

- rename MuxHelper -> PathRecorderMux
- move non-rest handlers into routes packages within genericapiserver and `pkg/routes` (those from master)
- move ui and logs handlers out of genericapiserver (they are
  not generic)
- make version handler configurable (`config.EnableVersion`)
2016-09-16 08:58:06 -07:00
Yu-Ju Hong 18f230c524 kuberuntime: fix nil pointer dereference in killPodWithSyncResult 2016-09-16 08:38:11 -07:00
deads2k 234d68be83 convert daemonset controller to shared informers 2016-09-16 10:40:46 -04:00
Hai Huang 192825bc5e fix a typo 2016-09-16 09:42:29 -04:00
d00369826 a3888335f7 fix endpoint controller hot loop
Change-Id: I0f667006f310fdca6abe324f9ea03537679e9163
2016-09-16 21:41:22 +08:00
Kubernetes Submit Queue a665002d80 Merge pull request #29684 from bprashanth/log_tun
Automatic merge from submit-queue

Change log level to reduce spam

Periodically dumping ips of all nodes in large clusters is a little spammy
2016-09-16 05:51:07 -07:00
Kubernetes Submit Queue e8fbcb1669 Merge pull request #32654 from soltysh/sj_clientset
Automatic merge from submit-queue

Switch ScheduledJob controller to use clientset

**What this PR does / why we need it**:
This is part of #25442. I've applied here the same fix I've applied in the manual client in #29187, see the 1st commit for that (@caesarxuchao we've talked about it in #29856).

@deads2k as promised 
@janetkuo ptal
2016-09-16 05:03:57 -07:00
Johannes Scheuermann 0b7cb5f2ae Inital Quobyte dynamic provision 2016-09-16 13:26:18 +02:00
Kubernetes Submit Queue 0d9685b0b5 Merge pull request #32805 from caesarxuchao/more-gc-optimization
Automatic merge from submit-queue

Add the uid in a delete event to the absentOwnerCache

This is a small optimization to further reduce the traffic sent by the GC.

In #31167, GC caches the non-existent owners when it processes the dirtyQueue. As discovered in #32571, there is still small inefficiency, because there are multiple goroutines processing the dirtyQueue, many of them might send a GET to the apiserver before the cache gets populated.

This PR populates the cache when GC observes an object gets deleted, which happens before the processing of the dirtyQueue, so it avoids the simultaneous GET sent by the GC workers.

cc @lavalamp
2016-09-16 00:40:24 -07:00
Kubernetes Submit Queue dfe3a46672 Merge pull request #31847 from feiskyer/syncpod
Automatic merge from submit-queue

Kubelet: add SyncPod for new runtime API

This PR adds implements of `SyncPod` for new runtime API. Note that init containers is not included, it will in another following PR.

**DO-NOT-MERGE**. Based on #31322 and #31395, only last commit is for review.

CC @yujuhong @Random-Liu and @kubernetes/sig-node @kubernetes/sig-rktnetes
2016-09-15 22:26:52 -07:00
Kubernetes Submit Queue a39cee990c Merge pull request #32751 from caesarxuchao/specific-error-rolling-update
Automatic merge from submit-queue

Specific error message on failed rolling update issued by older kubectl against 1.4 master

Fix #32706

`kubernetes-e2e-gke-1.4-1.3-kubectl-skew` (1.3 kubectl and 1.4 master) test suite failed with:
```
k8s.io] Kubectl client [k8s.io] Kubectl rolling-update should support rolling-update to same image [Conformance]
...
Error from server: object is being deleted: replicationcontrollers "e2e-test-nginx-rc" already exists error: exit status 1 not to have occurred
```

It's because the old RC had an orphanFinalizer, so it is not deleted from the key-value store immediately. In turn, the creation of the new RC of the same name failed. 

In this failure, the RC and pods are updated, it's just that the RC is of different name, i.e., original name + a hash generated based on podTemplate. The error is confusing to user, but not that bad. So this PR just prints a warning message to instruct users how to work around.

1.4 kubectl rolling-update uses different logic so it's working.

@lavalamp @gmarek @janetkuo @pwittrock 

cc @liggitt for the ctx changes.
2016-09-15 21:41:56 -07:00
Vish Kannan 173fd499cf Merge pull request #32841 from kubernetes/revert-32251-fix-oom-policy
Revert "[kubelet] Fix oom-score-adj policy in kubelet"
2016-09-15 21:12:03 -07:00
Kubernetes Submit Queue a2c186dbd0 Merge pull request #32786 from aofry/issue-32747
Automatic merge from submit-queue

prevent printing of stack trace when proxying 304 requests in api gateway

partially addresses #32747.
2016-09-15 20:58:38 -07:00
Kubernetes Submit Queue 27c093ea90 Merge pull request #32048 from smarterclayton/consistent_errors
Automatic merge from submit-queue

Handle Stream() errors consistently in restclient

We should be following the same rules for Stream() as the normal body
request flow.

Also add slightly more output on a server error - in the future we may
want to clean this up but it's potentially hiding bad responses.

Related to #32009 but isn't the fix (so far)
2016-09-15 20:13:48 -07:00
Vish Kannan 492ca3bc9c Revert "[kubelet] Fix oom-score-adj policy in kubelet" 2016-09-15 19:28:59 -07:00
Kubernetes Submit Queue 0d8db69660 Merge pull request #32831 from hongchaodeng/deb
Automatic merge from submit-queue

etcd3/watcher: logging error

To debug #32770

If error happened, the watcher might just stop/exit silently.
2016-09-15 18:48:39 -07:00
Kubernetes Submit Queue 2c6620b1ee Merge pull request #32563 from ZTE-PaaS/zhangke-patch-045
Automatic merge from submit-queue

Check kubeClient nil in Kubelet and bugfix

1. check kubeClient nil first before using as it maybe nil
2. configMaps and secrets map do not be used properly and should use it as cache
2016-09-15 18:48:34 -07:00
Kubernetes Submit Queue 9a3429829c Merge pull request #32662 from humblec/glusterfs-default-volume
Automatic merge from submit-queue

Change the default volume type of GlusterFS provisioner.

At  present provisioner creates 'Distribute' Volume and  this patch change the default
volume type 'Distribute Replica:(3)' volume.
2016-09-15 18:07:14 -07:00
Hongchao Deng 3e9af272d5 etcd3/watcher: logging error 2016-09-15 17:23:04 -07:00
Chao Xu c4ea205aeb print instruction in case of failed kubectl 1.3 rolling-update against 1.4 cluster 2016-09-15 17:20:39 -07:00
Kubernetes Submit Queue fcc97f37ee Merge pull request #32718 from mikedanese/mv-informer
Automatic merge from submit-queue

move informer and controller to pkg/client/cache

@kubernetes/sig-api-machinery
2016-09-15 16:44:30 -07:00
Kubernetes Submit Queue 5fe3bd449f Merge pull request #30565 from lavalamp/improve-registered
Automatic merge from submit-queue

Centralize install code

Trying to figure out a way to do this that makes the changes as painless to roll out as possible. This is going to be a multi-step process...
2016-09-15 16:03:39 -07:00
Saad Ali cb88d88b3e Merge pull request #32251 from vishh/fix-oom-policy
[kubelet] Fix oom-score-adj policy in kubelet
2016-09-15 15:24:54 -07:00
nikhiljindal b84e53bc2b Allow describe ns to pass if server does not support resource quotas and limit ranges 2016-09-15 15:16:49 -07:00
Kubernetes Submit Queue 1c10f53863 Merge pull request #32493 from deads2k/client-06-discoveryrestmapper
Automatic merge from submit-queue

use discovery restmapper for kubectl

Updates the `kubectl` factory to use a discovery rest mapper for locating resources.  This allows generic gets.

@kargakis @sttts @fabianofranz I'll let you guys fight over it. :)
2016-09-15 14:39:58 -07:00
Chao Xu d122de5371 add the uid in a delete event to the absentOwnerCache 2016-09-15 13:53:47 -07:00
Paul Morie 703cc16403 Add missing kubelet godoc 2016-09-15 16:27:09 -04:00
Mike Danese a765d59932 move informer and controller to pkg/client/cache
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-09-15 12:50:08 -07:00
Chao Xu 21896dac4b add the uid in a delete event to the absentOwnerCache 2016-09-15 11:22:22 -07:00
Kubernetes Submit Queue 9f0dc7fe27 Merge pull request #32744 from yujuhong/fix_shim
Automatic merge from submit-queue

Clarify the "version" requirement in CRI and fix various bugs in dockershim

This fixes #32741
2016-09-15 08:50:59 -07:00
Pengfei Ni d65309399a Kubelet: add SyncPod for new runtime API 2016-09-15 23:32:36 +08:00
deads2k 771915c6c4 make shortcut expanding restmapper handle all 2016-09-15 11:03:51 -04:00
deads2k 4359c79f53 add FirstHitRESTMapper for adding thirdparty resources 2016-09-15 10:26:39 -04:00
deads2k 500cddc5c3 use discovery restmapper for kubectl 2016-09-15 10:26:39 -04:00
Humble Chirammal b4fd7e5591 Change the default volume type of GlusterFS provisioner.
At present, provisioner creates Distribute Volume and this patch
change the default volume type to Distribute-Replica(3) volume.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2016-09-15 19:00:21 +05:30
Kubernetes Submit Queue 0a62dab566 Merge pull request #32645 from wojtek-t/fix_cacher_logging
Automatic merge from submit-queue

Fix logging in cacher

@smarterclayton @liggitt @hongchaodeng
2016-09-15 05:56:39 -07:00
Kubernetes Submit Queue e3f0ce2347 Merge pull request #32586 from deads2k/api-05-restrict-versions
Automatic merge from submit-queue

restrict discoverable versions to those that have resources

Prevents versions with no resources from appearing in discovery.

@soltysh ptal.  I think you have some issues for this, mind wiring them up?

```
kubectl api-versions
apps/v1alpha1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1beta1
autoscaling/v1
batch/v1
certificates.k8s.io/v1alpha1
extensions/v1beta1
policy/v1alpha1
rbac.authorization.k8s.io/v1alpha1
storage.k8s.io/v1beta1
v1
```
Fixes  #29998.
2016-09-15 05:56:34 -07:00
d00369826 fea0c79054 fix certificates controller hotloop on unexpected API server rejections
Change-Id: Ib7d2e18bcaa498bddfc785f3ff12958dfaaecbc3
2016-09-15 20:10:21 +08:00
Adi Ofry b97b685b96 prevent printing of stack trace when proxying 304 requests in api gateway 2016-09-15 14:52:04 +03:00
Kubernetes Submit Queue 843d7cd24c Merge pull request #32576 from wongma7/revert-30825-pv-controller-informer
Automatic merge from submit-queue

Revert "Use PV shared informer in PV controller"

Fixes #32497 

Reverts kubernetes/kubernetes#30825
2016-09-15 04:37:29 -07:00
Dr. Stefan Schimanski 7f78661d0b Cleanup non-rest apiserver handlers
- rename MuxHelper -> PathRecorderMux
- move non-rest handlers into routes packages within genericapiserver and
  `pkg/routes` (those from master)
- move ui and logs handlers out of genericapiserver (they are
  not generic)
- make version handler configurable (`config.EnableVersion`)
2016-09-15 13:22:45 +02:00
Kubernetes Submit Queue dbdaf2c22b Merge pull request #32597 from liggitt/webhook-re-refactor
Automatic merge from submit-queue

Revert "Revert "Allow webhook authenticator to use TokenReviewsInterface""

Reverts https://github.com/kubernetes/kubernetes/pull/32591 (commit 0a02c8275d)
Readds https://github.com/kubernetes/kubernetes/pull/32547

Holding until GKE webhook authenticator is updated by @cjcullen
2016-09-15 03:56:10 -07:00
Kubernetes Submit Queue 265746af18 Merge pull request #31326 from feiskyer/kuberuntime-gc
Automatic merge from submit-queue

Kubelet: add garbage collection for new runtime API

This PR adds garbage collection for new runtime API.

Note that this PR also adds `CreatedAt` and `PodSandboxId` to `ListContainers()` result.

CC @yujuhong @Random-Liu  @kubernetes/sig-node @kubernetes/sig-rktnetes
2016-09-15 02:28:05 -07:00
Kubernetes Submit Queue edbe71ad58 Merge pull request #32529 from smarterclayton/move_unstructured
Automatic merge from submit-queue

Unstructured methods belong in unstructured.go

Simple code move

@krousey just movement
2016-09-15 01:05:31 -07:00
Kubernetes Submit Queue 1ad5c5e4f7 Merge pull request #32593 from johnbieren/master
Automatic merge from submit-queue

Fix audit_test regex for iso8601 timestamps

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:  The audit_test unit test fails as some iso8601 timestamps are of the form 2016-09-13T10:32:50.823081217Z and the current regex doesn't allow T's or Z's.

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

**Special notes for your reviewer**:

**Release note**:NONE
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```

Signed-off-by: Johnny Bieren <jbieren@redhat.com>
2016-09-14 23:47:23 -07:00
Kubernetes Submit Queue 6946cce099 Merge pull request #32533 from smarterclayton/rest_options_gc
Automatic merge from submit-queue

EnableGarbageCollection should be part of generic.RESTOptions
2016-09-14 23:02:23 -07:00
Kubernetes Submit Queue dab16bf8fd Merge pull request #32565 from jsafrane/deleter-plugin
Automatic merge from submit-queue

Do not report warning event when an unknown deleter is requested

When Kubernetes does not have a plugin to delete a PV it should wait for
either external deleter or storage admin to delete the volume instead of
throwing an error.

This is the same approach as in #32077

@kubernetes/sig-storage
2016-09-14 22:20:36 -07:00
Clayton Coleman 716bac3bbb
All REST that set DeleteCollectionWorkers should set EnableGC 2016-09-15 00:09:34 -04:00
Clayton Coleman acb4c00b39
EnableGarbageCollection should be a struct member on RESTOptions
Not a global. Now that we have RESTOptions this was an easy change.
2016-09-15 00:09:28 -04:00
Kubernetes Submit Queue 96d971fed3 Merge pull request #31704 from timothysc/etcd3_v3client_leak_fix
Automatic merge from submit-queue

Etcd3 v3client + grpc client leak fix

This re-enables the client and plumbs through the destroyFunc to cleanup clients. 

Fix for https://github.com/kubernetes/kubernetes/issues/31262
2016-09-14 20:51:23 -07:00
Kubernetes Submit Queue 98eadd6219 Merge pull request #32636 from justinsb/aws_slower_volume_poll
Automatic merge from submit-queue

AWS: Reduce frequency of volume-mount poll
2016-09-14 19:40:06 -07:00
Yu-Ju Hong 77aa4cd07c CRI: clarify the version string requirement 2016-09-14 18:03:12 -07:00
Saad Ali 1fcaf3aafc Merge pull request #32720 from mikedanese/run-update-all
fully verify client-gen in verification tests
2016-09-14 17:27:36 -07:00
Angus Salkeld a1b2fcb10f Disambiguate unsupported metrics from metrics errors 2016-09-15 10:05:30 +10:00
Yu-Ju Hong 13b23c51cb dockershim: fix docker filter, Hostname, and the apiversion 2016-09-14 16:42:02 -07:00
Mike Danese 2cbbaf4384 autogenerated 2016-09-14 16:33:12 -07:00
Kubernetes Submit Queue fa94308912 Merge pull request #31594 from brendandburns/kubecfg
Automatic merge from submit-queue

To improve error messages, validate the existence of a namespace.

Fixes #15542

@deads2k 
@kubernetes/kubectl
2016-09-14 15:14:06 -07:00
Justin Santa Barbara 3688dc4a72 AWS: More robust volume-mount poll
When we are mounting a lot of volumes, we frequently hit rate limits.

Reduce the frequency with which we poll the status; introduces a bit of
latency but probably matches common attach times pretty closely, and
avoids causing rate limit problems everywhere.

Also, we now poll for longer, as when we timeout, the volume is in an
indeterminate state: it may be about to complete.  The volume controller
can tolerate a slow attach/detach, but it is harder to tolerate the
indeterminism.

Finally, we ignore a sequence of errors in DescribeVolumes (up to 5 in a
row currently).  So we will eventually return an error, but a one
off-failure (e.g. due to rate limits) does not cause us to spuriously
fail.
2016-09-14 16:47:53 -04:00
Kubernetes Submit Queue 9aca785bc8 Merge pull request #32613 from madhusudancs/fed-clientcmd-bug-31947-fix
Automatic merge from submit-queue

Fix clientcmd for a non-host cluster client running in a pod. 

This is based on @errordeveloper's PR #32438. It fixes a case where default config is invalid and original config, i.e. `mergedConfig` is empty. It also adds a test for the case where default config is invalid and original config is neither invalid nor empty.

cc @errordeveloper @kubernetes/sig-cluster-federation @pwittrock @colhom
2016-09-14 13:10:27 -07:00
Vishnu kannan ba6feb2771 fix kubelet ignoring docker daemon in container feature
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-09-14 12:43:59 -07:00
Kubernetes Submit Queue b841a8bad3 Merge pull request #32627 from smarterclayton/relax_content_id
Automatic merge from submit-queue

Docker digest validation is too strict

Docker 1.10 does not guarantee that the pulled digest matches the digest
on disk when dealing with v1 schemas stored in a Docker registry. This
is the case for images like
centos/ruby-23-centos7@sha256:940584acbbfb0347272112d2eb95574625c0c60b4e2fdadb139de5859cf754bf
which as a result of #30366 cannot be pulled by Kube from a Docker 1.10
system.

This partially reverts commit 875fd16e1e.
2016-09-14 12:29:04 -07:00
Vishnu kannan e4acad7afb Fix oom-score-adj policy in kubelet.
Docker daemon and kubelet needs to be protected by setting oom-score-adj to -999.

Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-09-14 11:56:10 -07:00
Kubernetes Submit Queue f59f4aecfa Merge pull request #32660 from mksalawa/fix_usage_printing
Automatic merge from submit-queue

Fix printing container usage in kubectl top

**What this PR does / why we need it**:
Fix a bug in kubectl top, which showed the same value of usage for all containers in a pod.

**Release note**:
```release-note
NONE
```
2016-09-14 11:49:41 -07:00
Clayton Coleman 4a48bf8375
Docker digest validation is too strict
Docker 1.10 does not guarantee that the pulled digest matches the digest
on disk when dealing with v1 schemas stored in a Docker registry. This
is the case for images like
centos/ruby-23-centos7@sha256:940584acbbfb0347272112d2eb95574625c0c60b4e2fdadb139de5859cf754bf
which as a result of #30366 cannot be pulled by Kube from a Docker 1.10
system.

Instead, use RepoDigests field as the primary match, validating the
digest, and then fall back to ID (also validating the match). Adds more
restrictive matching.
2016-09-14 14:13:21 -04:00
Johnny Bieren df6299d110 Fixed edited regex in audit_test unit test
Signed-off-by: Johnny Bieren <jbieren@redhat.com>
2016-09-14 14:08:41 -04:00
Dr. Stefan Schimanski 54f5a9b423 Disable swagger spec caching without /version 2016-09-14 18:44:46 +02:00
Kubernetes Submit Queue fc466743a8 Merge pull request #32592 from dims/update-google-cloud-api-imports
Automatic merge from submit-queue

Update Google Cloud API client import paths
2016-09-14 08:39:49 -07:00
Brendan Burns 23c7c2e3e7 Add namespace error checking if a resource is not found. 2016-09-14 06:51:36 -07:00
Kubernetes Submit Queue e56a32a22d Merge pull request #31772 from gmarek/wrong_flag
Automatic merge from submit-queue

Create a flag for route reconciliation and deprecate unused node-sync-…

cc @pwittrock to decide if it can go in 1.4. It's a zero risk cleanup, that will reduce confusion about cluster configuration.
2016-09-14 06:22:47 -07:00
deads2k 26558da40d restrict discoverable versions to those that have resources 2016-09-14 09:16:11 -04:00
Kubernetes Submit Queue 33e5b0e0db Merge pull request #32504 from kargakis/top-pod-fixes
Automatic merge from submit-queue

kubectl: run validation for 'top pod'

@mksalawa @kubernetes/kubectl
2016-09-14 05:35:42 -07:00
Timothy St. Clair 5b11b5984e Fixes to cleanup storage clients during UT.
During etcd3.clientv3 integration we had discovered we were leaking connections
2016-09-14 07:27:21 -05:00
Timothy St. Clair 9f3841b452 Revert "Revert "Enable v3 Client as the default on UTs""
This reverts commit 9dcef2e3cd.
2016-09-14 07:27:21 -05:00
Kubernetes Submit Queue 6b1565d275 Merge pull request #30678 from ping035627/ping035627-patch-0816
Automatic merge from submit-queue

Recombine the condition for the "shouldScale" function

The PR recombine the condition for the "shouldScale" function, abstract the common condition(hpa.Status.LastScaleTime == nil).
2016-09-14 04:50:49 -07:00
mksalawa 7fe19e0c56 Fix printing container usage. 2016-09-14 12:11:24 +02:00
Kubernetes Submit Queue 5ffb523cf8 Merge pull request #32259 from ZTE-PaaS/zhangke-patch-040
Automatic merge from submit-queue

Improving StopContainer failed log level

Using at least Warning level will be more property
2016-09-14 02:53:55 -07:00
gmarek 4f0129b023 Create a flag for route reconciliatio and deprecate unused node-sync-period one 2016-09-14 11:49:50 +02:00
Dmitry Shulyak 0ddaa20bf1 Fix FakeNodeHandler Update behaviour
Two problems:
1. Get is always using Existing nodes slice, and you will for sure miss any
   updated data
2. Each Update duplicates node entry in UpdatedNodes slice

For the 1st, try to find a node in UpdatedNodes slice (same as for the List).
2nd - append only if there is no node with same name as updated, if there is
just replace object.

Change-Id: I9ef1cca2788ba946eee37fa1b037c124ad76074c
2016-09-14 12:34:37 +03:00
Maciej Szulik 7a34347f7f Move ScheduledJob controller to use generated clientset 2016-09-14 11:27:29 +02:00
Maciej Szulik 5894834cc8 Generated changes for clientset 2016-09-14 11:27:29 +02:00
Wojciech Tyczynski e5b3f19638 Fix logging in cacher 2016-09-14 09:13:41 +02:00
Kubernetes Submit Queue b256b07007 Merge pull request #32407 from deads2k/authz-01-lsar
Automatic merge from submit-queue

add local subject access review API

Adds a local subject access review endpoint to allow a project-admin (someone with full rights within a namespace) the power to inspect whether a person can perform an action in his namespace.  This is a separate resource be factoring like this ensures that it is impossible for him to look outside his namespace and makes it possible to create authorization rules that can restrict this power to a project-admin in his own namespace.  Other factorings require introspection of objects.

@kubernetes/sig-auth
2016-09-13 22:09:35 -07:00
Ke Zhang 423a51b632 Check kubeClient nil in Kubelet and bugfix 2016-09-14 12:57:42 +08:00
Kubernetes Submit Queue e357b9a6f4 Merge pull request #32582 from jlowdermilk/api-all
Automatic merge from submit-queue

make --runtime-config=api/all=true|false work

`Passing --runtime-config=api/all=true|false to apiserver will enable/disable all registered api groups`

Previously, only api/all=false was recognized, and it only disabled groups with resources.
2016-09-13 20:27:34 -07:00
Davanum Srinivas 64efc3a744 Update Google Cloud API client import paths
Bump version of golang.org/x/oauth2
Vendor google.golang.org/cloud/
Vendor google.golang.org/api/
Vendor cloud.google.com/go/compute/
Replace google.golang.org/cloud with cloud.google.com/go/

Fixes #30069
2016-09-13 22:21:06 -04:00
Pengfei Ni f774a68d52 Kubelet: add garbage collection for new runtime API 2016-09-14 09:09:45 +08:00
Kubernetes Submit Queue de9739e3c5 Merge pull request #31576 from feiskyer/kuberuntime-filter
Automatic merge from submit-queue

Kubelet: remove name filter from CRI

Since #30753 and #30463, `name` is not used to identify the container/sandbox, so remove it from CRI.

cc @yujuhong @kubernetes/sig-node @kubernetes/sig-rktnetes
2016-09-13 16:42:13 -07:00
Kubernetes Submit Queue c4893df894 Merge pull request #32151 from bboreham/fix-cni-on-gci
Automatic merge from submit-queue

Add flag to set CNI bin dir, and use it on gci nodes

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

When using `kube-up` on GCE, following #31023 which moved the workers from debian to gci, CNI just isn't working.  The root cause is basically as discussed in #28563: one flag (`--network-plugin-dir`) means two different things, and the `configure-helper` script uses it for the wrong purpose.

This PR adds a new flag `--cni-bin-dir`, then uses it to configure CNI as desired.

As discussed at #28563, I have also added a flag `--cni-conf-dir` so users can be explicit 

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

**Special notes for your reviewer**:

I left the old flag largely alone for backwards-compatibility, with the exception that I stop setting the default when CNI is in use.  The value of `"/usr/libexec/kubernetes/kubelet-plugins/net/exec/"` is unlikely to be what is wanted there.

**Release note**:
```release-note
Added new kubelet flags `--cni-bin-dir` and `--cni-conf-dir` to specify where CNI files are located.
Fixed CNI configuration on GCI platform when using CNI.
```
2016-09-13 16:42:06 -07:00
Madhusudan.C.S c4acaa6717 Add a test to verify that the client config is returned when default config is invalid. 2016-09-13 15:34:56 -07:00
Madhusudan.C.S 0433fe0d72 Do not return original config, i.e. mergeConfig, when it is empty and default config is invalid. 2016-09-13 15:33:51 -07:00
Bryan Boreham 8a69683178 Regenerate codecgen files 2016-09-13 21:42:53 +00:00
Kubernetes Submit Queue 804de8a149 Merge pull request #32244 from tksm/fix-cache-race
Automatic merge from submit-queue

LRUExpireCache#Get requires write lock

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

[LRUExpireCache#Get](dbfad789e3/pkg/util/cache/lruexpirecache.go (L48)) requires write lock since [groupcache/lru#Get](a6b377e340/lru/lru.go (L74)) needs to manipulate its list to track recently used item. Currently it uses read lock so it may introduce race condition.

- [test code which introduces race condition with current LRUExpireCache#Get](https://gist.github.com/tksm/17c7a610ed0574c165e6f6edeca351b7#file-lru_race_test-go)

**Which issue this PR fixes** #31081
2016-09-13 14:36:26 -07:00
Kubernetes Submit Queue f052de66ca Merge pull request #32585 from yujuhong/test_again
Automatic merge from submit-queue

dockershim: add unit tests for sandbox/container status

Also add a fake clock in the FakeDockerClient to allow testing container
CreatedAt, StartedAt, FinishedAt timestamps.
2016-09-13 13:55:07 -07:00
Bryan Boreham db5fa5297d Fix unit tests and known flags list 2016-09-13 20:42:52 +00:00
Jordan Liggitt 52c3081f6f
Revert "Revert "Allow webhook authenticator to use TokenReviewsInterface""
This reverts commit 0a02c8275d.
2016-09-13 16:23:17 -04:00
Johnny Bieren 6194bfb81d Fix audit_test regex for iso8601 timestamps
Signed-off-by: Johnny Bieren <jbieren@redhat.com>
2016-09-13 15:03:49 -04:00
Jeff Lowdermilk e85f8d700c make --runtime-config=api/all=true|false work
Currently, only api/all=false does something (disables
all groups that have resources). Make api/all=false disable all groups
(not just those with resources), and make api/all=true enable
all groups
2016-09-13 12:03:25 -07:00
Joe Finney 0a02c8275d Revert "Allow webhook authenticator to use TokenReviewsInterface"
This reverts commit e9914f2c4a.
2016-09-13 11:48:43 -07:00
Kubernetes Submit Queue 0d3799b8e2 Merge pull request #31600 from quinton-hoole/2016-08-10-fed-ingress-ctrl-share-uid-config
Automatic merge from submit-queue

Federated Ingress: unify UID's across Cluster Ingress Controllers
2016-09-13 11:48:18 -07:00
Yu-Ju Hong d3e1f2c75e dockershim: add unit tests for sandbox/container status
Also add a fake clock in the FakeDockerClient to allow testing container
CreatedAt, StartedAt, FinishedAt timestamps.
2016-09-13 10:32:28 -07:00
Kubernetes Submit Queue 7ba9660487 Merge pull request #32547 from liggitt/webhook-refactor
Automatic merge from submit-queue

Allow webhook authenticator to use TokenReviewsInterface

Refactors the authentication webhook to be able to be fed a kubeconfig file or a TokenReviewsInterface 

Fixes a bug with webhooks not retrying on 429/500 errors

Related to https://github.com/kubernetes/kubernetes/pull/32518#discussion_r78450170
2016-09-13 10:28:34 -07:00
Quinton Hoole fac6318c57 Federated Ingress: unify UID's across Cluster Ingress Controllers
Fixes #31180
2016-09-13 08:29:33 -07:00
Matthew Wong 25e9b9dcf9 Revert "Use PV shared informer in PV controller" 2016-09-13 10:12:34 -04:00
Pengfei Ni 4d85e48528 CRI: remove name from ContainerFilter and PodSandboxFilter 2016-09-13 22:11:49 +08:00
deads2k e5dbfdacc0 generated client 2016-09-13 08:54:23 -04:00
deads2k 8fac64b43f add localSAR 2016-09-13 08:54:23 -04:00
Kubernetes Submit Queue ac8aae584d Merge pull request #32393 from smarterclayton/incluster_namespace
Automatic merge from submit-queue

Allow namespace to be loaded from in-cluster config

This is a follow on from the previous commit that fixed ClientConfig.
Namespace can also be defaulted from ICC, and this correctly handles
that logic. Also add two debugging lines to ensure that it is easier in
the future to uncover problems here.

Fixes #32352

@deads2k
2016-09-13 04:02:21 -07:00
Kubernetes Submit Queue 544e64a7fb Merge pull request #32315 from liggitt/api-group-suffix
Automatic merge from submit-queue

Doc API group suffix, add test to catch new groups

Spawned from discussion in https://github.com/kubernetes/kubernetes/pull/31887

Doc and add tests to ensure new API groups are suffixed.

Also changed the doc to reference an API group containing the suffix as a starting point for new API groups.
2016-09-13 02:42:45 -07:00
Kubernetes Submit Queue 6ffd30c2df Merge pull request #31468 from mbohlool/master
Automatic merge from submit-queue

Improvements on OpenAPI spec generation

- Generating models using go2idl library (no reflection anymore)
- Remove dependencies on go-restful/swagger
- Generate one swagger.json file for each web-service
- Bugfix: fixed a bug in trie implementation

Reference: #13414


**Release note**:

```release-note
Generate separate OpenAPI spec for each API GroupVersion on /<Group>/<Version>/swagger.json
```
2016-09-13 01:56:23 -07:00
Jan Safranek 3eae8c9022 Do not report warning event when an unknown deleter is requested
When Kubernetes does not have a plugin to delete a PV it should wait for
either external deleter or storage admin to delete the volume instead of
throwing an error.

Related to #32077
2016-09-13 10:39:45 +02:00
Kubernetes Submit Queue 8a56b6b27c Merge pull request #32265 from lojies/errmodify
Automatic merge from submit-queue

modify error return

err is nil here,chage it to fmt.Errorf("cannot find SCSI controller in VM")
2016-09-13 01:16:03 -07:00
Kubernetes Submit Queue f7bea5d8fd Merge pull request #32290 from zhouhaibing089/lbaasv1-fix
Automatic merge from submit-queue

delete the member before delete the pool

fixes https://github.com/kubernetes/kubernetes/issues/32285. it is necessary to delete members before delete the pool.
2016-09-13 01:15:58 -07:00
Kubernetes Submit Queue 630c7532c6 Merge pull request #32274 from ping035627/ping035627-patch-0908
Automatic merge from submit-queue

Change all jsonmerge to strategicpatch

Implement all jsonmerge changed to strategicpatch in edit.go.
2016-09-13 01:15:52 -07:00
Kubernetes Submit Queue ba3ab80b09 Merge pull request #32060 from lojies/addaliasdeploy
Automatic merge from submit-queue

add alias deploy for deployment

deploy is also alias of deployment. add alias deploy for deployment so the help can see deploy in the Aliases like below:
```sh
k8s@k8s-node1:~/go/workspace/src/k8s.io/kubernetes/cmd/kubectl$ ./kubectl create dep -h
Create a deployment with the specified name.

Aliases:
deployment, dep, deploy
```
2016-09-13 00:29:31 -07:00
Wojciech Tyczynski 3a0112f6ee Revert "dockershim: add unit tests for sandbox/container status" 2016-09-13 09:01:19 +02:00
Kubernetes Submit Queue 8f2f836e4e Merge pull request #32106 from jellonek/fd_leaks
Automatic merge from submit-queue

Ensure that we are closing files.

**What this PR does / why we need it**: In several places we are leaking file descriptors. This could be problematic on systems with low ulimits for them.

**Release note**:
```release-note
```
2016-09-12 23:43:38 -07:00
mbohlool 469c7d37f3 Generated open-api definition file 2016-09-12 23:23:59 -07:00
Ke Zhang 347293617f Improving StopContainer failed log level 2016-09-13 14:23:15 +08:00
Kubernetes Submit Queue a44d2f8009 Merge pull request #32243 from caesarxuchao/generate-1-5-clientset
Automatic merge from submit-queue

Generate 1 5 clientset

Generate the 1.5 clientset. Stop updating 1.4 clientset. Remove 1.2 clientset.

@nikhiljindal @lavalamp 

I will rebase #31994 atop of this one.
2016-09-12 23:04:50 -07:00
Kubernetes Submit Queue ff1a92fa03 Merge pull request #32410 from euank/revert-rktshim-image-service
Automatic merge from submit-queue

Revert "Merge pull request #30513 from tmrts/kubelet-rkt-cri/use-imag…

This reverts commit aff7dfcaab, reversing
changes made to 7a4d81ea43.

See https://github.com/kubernetes/kubernetes/pull/30513#issuecomment-245949664, this breaks tests for the rkt runtime.

The original PR also changed the source of image truth from the api-service to cli, which could have further implications which @yifan-gu could speak better to, so I think it's safer to just revert for now and discuss further in the rktlet repo / pr. The reverted code effectively already exists (with the bug in question already fixed) here https://github.com/kubernetes-incubator/rktlet/pull/5 .. once that's merged, we can vendor and call it over here in place of #30513.

@yifan-gu / @tmrts  if you think continuing with the changes and rolling forwards (just adding the `--full` flag to list to fix the immediate bug) is better, feel free to close this and open a PR with that change, but I think this approach is overall better for the reasons in the previous paragraph.

cc @tmrts @yifan-gu @kubernetes/sig-rktnetes @pskrzyns
2016-09-12 22:26:34 -07:00
Kubernetes Submit Queue c39f5681b7 Merge pull request #32316 from deads2k/client-05-remaining-clients
Automatic merge from submit-queue

remove the rest of the non-generated clients from the kubectl code

Die `Client` Die!

It's always bigger than you think.  Last bit @kargakis after this, it's gone.
2016-09-12 21:45:16 -07:00
Jordan Liggitt e9914f2c4a
Allow webhook authenticator to use TokenReviewsInterface 2016-09-13 00:42:02 -04:00
Kubernetes Submit Queue c1f47581fa Merge pull request #32524 from derekwaynecarr/ns-controller-finalizer
Automatic merge from submit-queue

Namespace Controller handles items with finalizers gracefully

This PR does the following:

1. ensures the "orphan" finalizer is not added to items during DELETE COLLECTION calls
2. does not treat presence of a finalizer as an unexpected error condition.

The 15s wait should only happen when finalizers not added by GC are used.

I am aware of any finalizer like that at this time.

Fixes https://github.com/kubernetes/kubernetes/issues/32519
2016-09-12 19:07:06 -07:00
mbohlool 8153267ea8 Update generated proto and swagger docs 2016-09-12 18:47:03 -07:00
mbohlool 702f55e61d Add +k8s:openapi-gen tag to API types 2016-09-12 18:47:03 -07:00
mbohlool 6ba271b9ae Customize OpenAPI definition types
customize intstr, unversioned.time, and quantity OpenAPI definitions.
2016-09-12 18:47:03 -07:00
mbohlool 54fee8c253 Improvements on OpenAPI spec generation:
- Generating models using go2idl library (no reflection anymore)
- Remove dependencies on go-restful/swagger
- Generate one swagger.json file for each web-service
- Bugfix: fixed a bug in trie implementation
2016-09-12 18:47:03 -07:00
Kubernetes Submit Queue 51b5ff59b9 Merge pull request #32210 from deads2k/controller-01-cachewait-handle
Automatic merge from submit-queue

update error handling for daemoncontroller

Updates the DaemonSet controller to cleanly requeue with ratelimiting on errors, make use of the `utilruntime.HandleError` consistently, and wait for preconditions before doing work.

@ncdc @liggitt @sttts My plan is to use this one as an example of how to handle requeuing, preconditions, and processing error handling.
@foxish fyi

related to https://github.com/kubernetes/kubernetes/issues/30629
2016-09-12 17:13:19 -07:00
Clayton Coleman c95b9df894 Unstructured methods belong in unstructured.go
Simple code move
2016-09-12 18:52:47 -04:00
Kubernetes Submit Queue 6a9a93d469 Merge pull request #32242 from jingxu97/bug-wrongvolume-9-2
Automatic merge from submit-queue

Fix race condition in updating attached volume between master and node

This PR tries to fix issue #29324. The cause of this issue is that a race
condition happens when marking volumes as attached for node status. This
PR tries to clean up the logic of when and where to mark volumes as
attached/detached. Basically the workflow as follows,
1. When volume is attached sucessfully, the volume and node info is
added into nodesToUpdateStatusFor to mark the volume as attached to the
node.
2. When detach request comes in, it will check whether it is safe to
detach now. If the check passes, remove the volume from volumesToReportAsAttached
to indicate the volume is no longer considered as attached now.
Afterwards, reconciler tries to update node status and trigger detach
operation. If any of these operation fails, the volume is added back to
the volumesToReportAsAttached list showing that it is still attached.

These steps should make sure that kubelet get the right (might be
outdated) information about which volume is attached or not. It also
garantees that if detach operation is pending, kubelet should not
trigger any mount operations.
2016-09-12 15:29:38 -07:00
derekwaynecarr 80d8c330e6 Namespace controller does not treat objects with finalizers as an error condition 2016-09-12 17:30:00 -04:00
Jing Xu efaceb28cc Fix race condition in updating attached volume between master and node
This PR tries to fix issue #29324. This cause of this issue is a race
condition happens when marking volumes as attached for node status. This
PR tries to clean up the logic of when and where to mark volumes as
attached/detached. Basically the workflow as follows,
1. When volume is attached sucessfully, the volume and node info is
added into nodesToUpdateStatusFor to mark the volume as attached to the
node.
2. When detach request comes in, it will check whether it is safe to
detach now. If the check passes, remove the volume from volumesToReportAsAttached
to indicate the volume is no longer considered as attached now.
Afterwards, reconciler tries to update node status and trigger detach
operation. If any of these operation fails, the volume is added back to
the volumesToReportAsAttached list showing that it is still attached.

These steps should make sure that kubelet get the right (might be
outdated) information about which volume is attached or not. It also
garantees that if detach operation is pending, kubelet should not
trigger any mount operations.
2016-09-12 13:51:08 -07:00
Yu-Ju Hong 0075e9dbee dockershim: add unit tests for sandbox/container status
Also add a fake clock in the FakeDockerClient to allow testing container
CreatedAt, StartedAt, FinishedAt timestamps.
2016-09-12 12:55:49 -07:00
ymqytw c67a62da49 Fixes #30562: Refactor kubectl command options to use common struct for common file params 2016-09-12 11:01:37 -07:00
Yu-Ju Hong 84aab8d4a8 dockershim: utilize the Metadata in container names
This commit changes how the shim constructs and parses docker container names
by using the new "Metadata" types.
2016-09-12 10:58:21 -07:00
Yu-Ju Hong 7227641fc2 dockershim: move naming helpers to a separate file 2016-09-12 10:58:21 -07:00
Yu-Ju Hong a1833d1947 dockershim: bug fixes and more unit tests
Fixing the name triming and other small bugs. Added sandbox listing unit tests.
2016-09-12 10:58:21 -07:00