Commit Graph

11980 Commits (22dfaef9f02e3f7cbb265a968555aed4fb44b50f)

Author SHA1 Message Date
k8s-merge-robot 22dfaef9f0 Merge pull request #24943 from XiaoningDing/federation-copy-server-address-by-client-cidr
Automatic merge from submit-queue

copy ServerAddressByClientCIDR to federation types

#24016
copy ServerAddressByClientCIDR to federation types
update generated files

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-05-10 20:22:34 -07:00
k8s-merge-robot c10d12b7b7 Merge pull request #24923 from mwielgus/drain-refactor
Automatic merge from submit-queue

Small refactoring around drain - move drain logic to separate function.

cc: @piosz @fgrzadkowski
2016-05-10 19:44:21 -07:00
Fabio Yeon 6071540799 Merge pull request #25249 from mkumatag/typo_fix
Rename a function parameter name in authn.go
2016-05-10 19:42:50 -07:00
Fabio Yeon 0809b2be4d Merge pull request #25119 from XiaoningDing/api-shared-annotations
move shared annotations to new api/annotations package
2016-05-10 19:34:17 -07:00
k8s-merge-robot bfccd929c6 Merge pull request #25414 from derekwaynecarr/quota_int_test_improvements
Automatic merge from submit-queue

Quota integration test improvements

This PR does the following:

* allow a replication manager to get created that does not record events
* improve the shutdown behavior of replication manager and resource quota to ensure doWork funcs exit properly
* update quota integration test to use non event generating replication manager, reduce number of pods to provision

I am hoping this combination of changes should fix the referenced flake.

Fixes https://github.com/kubernetes/kubernetes/issues/25037
2016-05-10 18:58:34 -07:00
k8s-merge-robot aa8fddb7d9 Merge pull request #25369 from liggitt/cached-watch
Automatic merge from submit-queue

Return 'too old' errors from watch cache via watch stream

Fixes #25151

This PR updates the API server to produce the same results when a watch is attempted with a resourceVersion that is too old, regardless of whether the etcd watch cache is enabled. The expected result is a `200` http status, with a single watch event of type `ERROR`. Previously, the watch cache would deliver a `410` http response.

This is the uncached watch impl:
```
// Implements storage.Interface.
func (h *etcdHelper) WatchList(ctx context.Context, key string, resourceVersion string, filter storage.FilterFunc) (watch.Interface, error) {
	if ctx == nil {
		glog.Errorf("Context is nil")
	}
	watchRV, err := storage.ParseWatchResourceVersion(resourceVersion)
	if err != nil {
		return nil, err
	}
	key = h.prefixEtcdKey(key)
	w := newEtcdWatcher(true, h.quorum, exceptKey(key), filter, h.codec, h.versioner, nil, h)
	go w.etcdWatch(ctx, h.etcdKeysAPI, key, watchRV)
	return w, nil
}
```

once the resourceVersion parses, there is no path that returns a direct error, so all errors would have to be returned as an `ERROR` event via the ResultChan().
2016-05-10 18:15:15 -07:00
k8s-merge-robot 9f00ed6075 Merge pull request #25377 from freehan/kubenetmutex
Automatic merge from submit-queue

modify kubenet mutex and add timer
2016-05-10 17:22:15 -07:00
derekwaynecarr 31970780cc Fix resource quota controller shutting down its worker threads 2016-05-10 19:50:36 -04:00
derekwaynecarr ff4a5e2068 Allow a replication manager to be created that does not record events 2016-05-10 19:50:36 -04:00
k8s-merge-robot a598ae2ab4 Merge pull request #25420 from caesarxuchao/finish-24099
Automatic merge from submit-queue

remove extra quotation mark that breaks API docs

Finish #24099
2016-05-10 16:08:55 -07:00
k8s-merge-robot d7cf4e60cb Merge pull request #25396 from hongchaodeng/w
Automatic merge from submit-queue

etcd3/watcher: Event.Object should have the same rev as etcd delete

### What's the problem?
When a delete is watched, the revision should be larger than any previous to guarantee ordering. However, currently etcd3 decodes the previous rev into returned object:

995f022808/pkg/storage/etcd3/watcher.go (L322)

This will break, for example, cacher's assumption here if it re-watch.
995f022808/pkg/storage/cacher.go (L579-L581)

The etcd2 impl. also takes the current ModifiedIndex to ensure it's a larger number:
995f022808/pkg/storage/etcd/etcd_watcher.go (L437-L442)

### What's this PR?
It fixes above problem by using etcd's delete revision.
2016-05-10 16:08:50 -07:00
k8s-merge-robot 3894c7972c Merge pull request #25185 from freehan/kubenetgetpodstatus
Automatic merge from submit-queue

kubenet try to retrieve ip inside pod net namespace

Kubenet currently stores the ips of pods inside a map. Kubelet gets pod ip from kubenet during syncpod. If Kubelet restarts, all pods on the node lost their ips in podStatus. This PR adds logic to retrieve pod IP from pod netns. 

cc: @yujuhong
2016-05-10 16:08:45 -07:00
Fabio Yeon a167a6b4df Merge pull request #25308 from AdoHe/deployment_panic
fix rollout nil panice issue
2016-05-10 15:51:22 -07:00
Chao Xu a013351ba3 remove extra quotation mark that breaks API docs 2016-05-10 13:29:55 -07:00
Hongchao Deng cd3f7f41c1 etcd3/watcher: refactor test 2016-05-10 12:37:31 -07:00
Hongchao Deng da7e9783e8 etcd3/watcher: Event.Object should have the same rev as etcd delete
instead of previous object's revision.
2016-05-10 10:53:53 -07:00
jianhuiz 4e6e51dc26 copy ServerAddressByClientCIDR to federation types 2016-05-10 10:34:00 -07:00
Jordan Liggitt f80b59ba87 Return 'too old' errors from watch cache via watch stream 2016-05-10 10:59:53 -04:00
k8s-merge-robot 14b8f3350a Merge pull request #25008 from saad-ali/attachControllerSkeletonActual
Automatic merge from submit-queue

Introduce skeleton of new attach/detach controller

This PR introduces the skeleton of the new attach/detach controller for #20262
2016-05-10 04:04:29 -07:00
k8s-merge-robot bbdbfc8940 Merge pull request #24787 from nikhiljindal/storageVersion
Automatic merge from submit-queue

Moving StorageFactory building logic to genericapiserver

Adding a DefaultStorageFactoryBuilder which builds the required StorageFactory.
This allows us to remove the duplicated code between `cmd/kube-apiserver` and `federation/cmd/federated-apiserver`

cc @deads2k @lavalamp @jianhuiz
2016-05-10 03:24:15 -07:00
k8s-merge-robot 5ca769e0a3 Merge pull request #25038 from mfojtik/json-line
Automatic merge from submit-queue

Display line number on JSON errors

Related issue: https://github.com/kubernetes/kubernetes/issues/12231

This PR will introduce line numbers for all JSON errors in the CLI:

(this is existing error reporting for YAML)
```console
$ kubectl create -f broken.yaml
yaml: line 8: mapping values are not allowed in this context
```

(this is error reporting proposed in this PR for JSON)
```console
$ kubectl create -f broken.json
json: line 35: invalid character '{' after object key
```

(and this is the current reporting:)
```console
$ kubectl create -f broken.json
invalid character '{' after object key
```
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-05-10 02:49:01 -07:00
nikhiljindal 2ffa3b4586 Moving StorageFactory building logic to genericapiserver 2016-05-10 00:57:11 -07:00
k8s-merge-robot a57876b98c Merge pull request #25178 from zmerlynn/random_max_target_pools
Automatic merge from submit-queue

GCE: Allow node count to exceed GCE TargetPool maximums

```release-note
If the cluster node count exceeds the GCE TargetPool maximum (currently 1000),
randomly select which nodes are members of Kubernetes External Load Balancers.
```


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

If we would exceeded the TargetPool API maximums, instead just
randomly select some subsection of the nodes to include in the TP
instead.
2016-05-09 23:18:15 -07:00
k8s-merge-robot f9b8fd0c96 Merge pull request #25011 from zhouhaibing089/addclose
Automatic merge from submit-queue

followup to add http server close method

Fixes #25009, a follow up of https://github.com/kubernetes/kubernetes/pull/24595.
2016-05-09 22:32:02 -07:00
k8s-merge-robot c4214f743f Merge pull request #24918 from Random-Liu/add-docker-operation-timeout
Automatic merge from submit-queue

Kubelet: Add docker operation timeout

For #23563.
Based on #24748, only the last 2 commits are new.

This PR:
1) Add timeout for all docker operations.
2) Add docker operation timeout metrics
3) Cleanup kubelet stats and add runtime operation error and timeout rate monitoring.
4) Monitor runtime operation error and timeout rate in kubelet perf.

@yujuhong 
/cc @gmarek Because of the metrics change.
/cc @kubernetes/sig-node
2016-05-09 21:51:52 -07:00
Zach Loafman faf0c44429 GCE: Allow nodes to exceed target pool maximums
If we would exceeded the TargetPool API maximums, instead just
randomly select some subsection of the nodes to include in the TP
instead.
2016-05-09 21:44:58 -07:00
k8s-merge-robot def7639457 Merge pull request #25245 from pmorie/kubelet/cadvisor
Automatic merge from submit-queue

Reduce kubelet LOC: extract cadvisor

Step 2 of #25028 

@yujuhong @kubernetes/sig-node
2016-05-09 21:09:42 -07:00
Minhan Xia 3573903a8d modify kubenet mutex and add timer 2016-05-09 14:54:15 -07:00
k8s-merge-robot 8a81000b71 Merge pull request #25331 from hongchaodeng/w
Automatic merge from submit-queue

etcd3/watcher: fix goroutine leak if ctx is canceled

### Problem
In reflector.go, it could probably call Stop() without retrieving all results
from ResultChan(). See [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/client/cache/reflector.go#L369). A potential leak is that when an error has happened, it could block on resultChan,
and then cancelling context in Stop() wouldn't unblock it.

### What's this PR?
This fixes the problem by making it also select ctx.Done and cancel context afterwards if error happened.
2016-05-09 12:12:15 -07:00
saadali 214b4c28bc Skeleton of new attach detach controller 2016-05-09 11:34:11 -07:00
jianhuiz 441e206671 move server client shared annotations to new api/annotations package 2016-05-09 11:10:44 -07:00
Hongchao Deng 97f4647dc3 etcd3/watcher: fix goroutine leak if ctx is canceled
In reflector.go, it could probably call Stop() without retrieving all results
from ResultChan().
A potential leak is that when an error has happened, it could block on resultChan,
and then cancelling context in Stop() wouldn't unblock it.
This fixes the problem by making it also select ctx.Done and cancel context
afterwards if error happened.
2016-05-09 09:06:11 -07:00
k8s-merge-robot 6596ae0c61 Merge pull request #24838 from saad-ali/attachControllerOpMap
Automatic merge from submit-queue

Add data structure for managing go routines by name

This PR introduces a data structure for managing go routines by name. It prevents the creation of new go routines if an existing go routine with the same name exists. This will enable parallelization of the designs in https://github.com/kubernetes/kubernetes/issues/20262 and https://github.com/kubernetes/kubernetes/issues/21931 with sufficient protection to prevent starting multiple operations on the same volume.
2016-05-09 06:31:22 -07:00
Wojciech Tyczynski 3c089bff41 Merge pull request #25344 from wojtek-t/fix_dynamic_client_with_protobufs
Fix dynamic client in protobuf configuration
2016-05-09 15:06:43 +02:00
k8s-merge-robot 545d56a63b Merge pull request #24810 from derekwaynecarr/sources_cleanup
Automatic merge from submit-queue

Clean-up sources ready tracking in kubelet

moved sources ready tracking behind an interface, made it thread-safe.
2016-05-09 05:48:09 -07:00
k8s-merge-robot 1a1229e206 Merge pull request #24795 from deads2k/use-all-attributes
Automatic merge from submit-queue

enable resource name and service account cases for impersonation

Adds the resource name check since that attribute was added for authorization.  Also adds a check against a separate resource for service accounts.  Allowing impersonation of service accounts to use a different resource check places control of impersonation with the same users to have the power to get the SA tokens directly.

@kubernetes/kube-iam 
@sgallagher FYI
2016-05-09 04:58:19 -07:00
Wojciech Tyczynski ca5f18370a Fix dynamic client in protobuf configuration 2016-05-09 13:52:10 +02:00
k8s-merge-robot 2cf511b1f5 Merge pull request #24750 from derekwaynecarr/kubelet_eviction_flag_parsing
Automatic merge from submit-queue

Kubelet eviction flag parsers and tests

The first two commits are from https://github.com/kubernetes/kubernetes/pull/24559 that have achieved LGTM.  

The last commit is only part that is interesting, it adds the parsing logic to handle the flags, and reserves `pkg/kubelet/eviction` for eviction manager logic.
2016-05-09 04:15:04 -07:00
Wojciech Tyczynski a7be41d4fe Merge pull request #25332 from wojtek-t/fix_protobuf_failures
Fix protobuf failures
2016-05-09 10:23:20 +02:00
Wojciech Tyczynski 1ea0d46bb3 Set headers in Watch() and Stream() requests 2016-05-09 09:33:13 +02:00
Wojciech Tyczynski ac5d2cec44 Test if headers are set 2016-05-09 09:31:49 +02:00
k8s-merge-robot 2f1a9dd65c Merge pull request #24696 from saad-ali/attachControllerSkeleton
Automatic merge from submit-queue

Add data structure for storing attach detach controller state.

This PR introduces the data structure for maintaining the in-memory state for the new attach/detach controller (#20262).
2016-05-08 23:44:38 -07:00
k8s-merge-robot cd3ab5d82d Merge pull request #24655 from njuicsgz/master
Automatic merge from submit-queue

kube-proxy userspace, enable RR if connect endpoint which is session affinity fails

for issue #24648
2016-05-08 23:04:23 -07:00
Tim Hockin 817abc3213 Kill our atomic pkg, now that 1.6 is req'd 2016-05-08 20:30:37 -07:00
Tim Hockin 527cb50583 Demand at least go1.6 2016-05-08 20:30:37 -07:00
k8s-merge-robot fe135fc251 Merge pull request #24630 from euank/redundant-created
Automatic merge from submit-queue

kubelet: Remove redundant `Container.Created`

As far as I can tell, this has been supplanted by a) the `DockerJSON.CreatedAt` field and b) the
`ContainerStatus.CreatedAt`, where the first is used for creating the
second.

The `.Created` field was only written to as far as I can see.

cc @yifan-gu & @Random-Liu 

Is there any reason we might want to keep this around?
2016-05-08 16:21:05 -07:00
k8s-merge-robot 41b7b04faf Merge pull request #24554 from ingvagabund/dhodovska-events-flag-for-describers
Automatic merge from submit-queue

Introduce events flag for describers

Printing events for a given object is not always needed. Thus, introducing --show-events=false to ``kubectl describe`` to skip events printing.

Fixes: #24239
2016-05-08 14:41:28 -07:00
k8s-merge-robot d4b1b6776a Merge pull request #24557 from swagiaal/attacher-interface
Automatic merge from submit-queue

 Abstract node side functionality of attachable plugins

- Create PhysicalAttacher interface to abstract MountDevice and
  WaitForAttach.
- Create PhysicalDetacher interface to abstract WaitForDetach and
  UnmountDevice.
- Expand unit tests to check that Attach, Detach, WaitForAttach,
  WaitForDetach, MountDevice, and UnmountDevice get call where
  appropriet.

Physical{Attacher,Detacher} are working titles suggestions welcome. Some other thoughts:
- NodeSideAttacher or NodeAttacher.
- AttachWatcher
- Call this Attacher and call the Current Attacher CloudAttacher.
- DeviceMounter (although there are way too many things called Mounter right now :/)

This is to address: https://github.com/kubernetes/kubernetes/pull/21709#issuecomment-192035382

@saad-ali
2016-05-08 14:04:44 -07:00
k8s-merge-robot f40fe7173b Merge pull request #24304 from cjcullen/cacheauth
Automatic merge from submit-queue

Support persisting config from kubecfg AuthProvider plugins

Plumbs through an interface to the plugin that can persist a `map[string]string` config for just that plugin. Also adds `config` to the AuthProvider serialization type, and `Login()` to the AuthProvider plugin interface.
Modified the gcp AuthProvider to cache short-term access tokens in the kubecfg file.

Builds on #23066 
@bobbyrullo @deads2k @jlowdermilk @erictune
2016-05-08 13:27:57 -07:00
k8s-merge-robot 53b3ef2122 Merge pull request #23988 from php-coder/kubectl_describe_multiline_labels
Automatic merge from submit-queue

kubectl describe: show multiple labels/annotations on multiple lines

Small UX improvement: when there is more than one label/annotation, it's more readable to see them on the different lines.

Before:
```console
$ kubectl describe svc
Name:			s2i-test
Namespace:		test2
Labels:			app=s2i-test,foo=bar
...
```
After:
```console
$ kubectl describe svc
Name:			s2i-test
Namespace:		test2
Labels:			app=s2i-test
				foo=bar
...
```
This change affects output of the labels/annotations in many of the sub-commands of the `kubectl describe`.

PTAL @smarterclayton @kargakis
2016-05-08 12:51:45 -07:00