Commit Graph

12140 Commits (be104a82716ba8e2ba19dd7278e5eafe1952e2a3)

Author SHA1 Message Date
k8s-merge-robot be104a8271 Merge pull request #25415 from hongchaodeng/e2
Automatic merge from submit-queue

etcd_watcher: make Deleted Event.Object's version consistent

### What's the problem?

In [sendDelete()](995f022808/pkg/storage/etcd/etcd_watcher.go (L437-L442)), Deleted Event.Object's resource version will be set to the latest resource version. This is actually an assumption made by cacher that all later events should have objects with larger verions; See [here](995f022808/pkg/storage/cacher.go (L579-L581)).

In sendModify(), it could also return Deleted event. However, the resource version is still the old version, which is inconsistent behavior with sendDelete().

### What's this PR?
This PR sets the version of oldObj in sendModify() to be the latest version.
Provided unit test for it.
2016-05-14 20:46:20 -07:00
k8s-merge-robot 5df28fa18d Merge pull request #24647 from yifan-gu/rkt_gc
Automatic merge from submit-queue

rkt: Refactor GarbageCollect to enforce GCPolicy.

Previously, we uses `rkt gc` to garbage collect dead pods, which is very coarse, and can cause the dead pods to be removed too aggressively. 

This PR improves the garbage collection, now after one GC iteration:
- The deleted pods will be removed.
- If the number of containers exceeds gcPolicy.MaxContainers,
  then containers whose ages are older than gcPolicy.minAge will be removed.

cc @kubernetes/sig-node @euank @sjpotter 

Pending on #23887 for the Godep updates.

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24647)
<!-- Reviewable:end -->
2016-05-14 12:13:01 -07:00
k8s-merge-robot 6fe3498ef9 Merge pull request #24625 from pmorie/dapi-volume-atomic
Automatic merge from submit-queue

Refactor downward API volume to use AtomicWriter

Make the downward API plugin use `AtomicWriter` instead.

@thockin @saad-ali @sdminonne

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24625)
<!-- Reviewable:end -->
2016-05-14 11:22:42 -07:00
k8s-merge-robot b8f1682695 Merge pull request #24090 from AdoHe/expose_rc
Automatic merge from submit-queue

fix expose multi protocols issue

Please refer #23882 for more detail. @bprashanth @bgrant0607 ptal.

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24090)
<!-- Reviewable:end -->
2016-05-14 07:15:58 -07:00
k8s-merge-robot 203b5b7c5f Merge pull request #24052 from deads2k/rate-limitting-requeue
Automatic merge from submit-queue

Rate limitting requeue

I think this will do what I want in almost every case.  I'm going to try it out for a single writer quota evaluation.

`NewRateLimitingQueue(NewControllerRateLimiter(qps, burst))` gives an `AddRateLimited(item)` that backs off based on the max of a bucket and exponential backoff per item.

@liggitt Want to see if the interface works for you too?

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24052)
<!-- Reviewable:end -->
2016-05-14 06:34:15 -07:00
k8s-merge-robot 290670d6c2 Merge pull request #25597 from saad-ali/renameNewGoRoutine
Automatic merge from submit-queue

Rename NewGoRoutine to Run in GoRoutineMap
2016-05-14 05:16:49 -07:00
k8s-merge-robot 67eaa02bd1 Merge pull request #25453 from nikhiljindal/fedServerAuth
Automatic merge from submit-queue

Moving federation-apiserver to use genericapiserver.ServerRunOptions and deleting federation-apiserver options

The remaining params were related to authz and authn and one parameter for WatchCacheSize.
Have moved them to genericapiserver.ServerRunOptions and now federation-apiserver can just use genericapiserver.ServerRunOptions()


cc @jianhuiz @kubernetes/sig-cluster-federation
2016-05-14 03:24:34 -07:00
k8s-merge-robot 4486385bc6 Merge pull request #25267 from pwittrock/kubectl-retry-simple
Automatic merge from submit-queue

Retry fetching http urls passed to '-f' in kubectl.

## Pull Request Guidelines

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
1. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
1. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.

```release-note
* kubectl now retries failed http gets for urls passed through the '-f' flag.
```


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

Closes #24089.
2016-05-13 22:44:24 -07:00
k8s-merge-robot 9796900306 Merge pull request #25551 from mml/db.store.codegen
Automatic merge from submit-queue

The remaining API changes for PodDisruptionBudget.

It's mostly the boilerplate required for the registry, some extra codegen, and a few tests.

Will squash once we're sure it's good.
2016-05-13 20:15:15 -07:00
Matt Liggett f5e8d41431 Finish implementing policy API.
Registry implementation and addition to the master.
2016-05-13 17:27:58 -07:00
Jeff Lowdermilk 9a20ca2899 Merge pull request #25163 from derekwaynecarr/pod-eviction-grace-period-flag
Pod eviction grace period flag
2016-05-13 16:17:27 -07:00
saadali f7196337c7 Rename NewGoRoutine to Run in GoRoutineMap 2016-05-13 16:05:55 -07:00
k8s-merge-robot 24c46acd16 Merge pull request #24369 from Clarifai/ecr
Automatic merge from submit-queue

AWS: Allow cross-region image pulling with ECR

Fixes #23298
Definitely should be in the release notes; should maybe get merged in 1.2 along with #23594 after some soaking. Documentation changes to follow.

cc @justinsb @erictune @rata @miguelfrde

This is step two. We now create long-lived, lazy ECR providers in all regions.
When first used, they will create the actual ECR providers doing the work
behind the scenes, namely talking to ECR in the region where the image lives,
rather than the one our instance is running in.

Also:
- moved the list of AWS regions out of the AWS cloudprovider and into the
credentialprovider, then exported it from there.
- improved logging

Behold, running in us-east-1:

```
aws_credentials.go:127] Creating ecrProvider for us-west-2
aws_credentials.go:63] AWS request: ecr:GetAuthorizationToken in us-west-2
aws_credentials.go:217] Adding credentials for user AWS in us-west-2
Successfully pulled image "123456789012.dkr.ecr.us-west-2.amazonaws.com/test:latest"
```

*"One small step for a pod, one giant leap for Kube-kind."*

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24369)
<!-- Reviewable:end -->
2016-05-13 15:15:45 -07:00
Yifan Gu 9d5bcf4251 rkt: Add tests for GarbageCollect(). 2016-05-13 15:13:52 -07:00
Yifan Gu 06b1955c4a rkt: Refactor GarbageCollect() to enforce GCPolicy.MaxContainers. 2016-05-13 15:12:36 -07:00
Jeff Lowdermilk 3e83de8eeb Merge pull request #25399 from jsafrane/devel/wait-for-operation
Add GoRoutineMap.Wait method.
2016-05-13 15:09:30 -07:00
Jeff Lowdermilk 1661df4554 Merge pull request #25487 from derekwaynecarr/verify_resources
pod constraints func for quota validates resources
2016-05-13 15:07:23 -07:00
Jeff Lowdermilk 095e262461 Merge pull request #25361 from yifan-gu/imagestates
rkt: Implement ImageStats() for rkt.
2016-05-13 15:05:48 -07:00
Jeff Lowdermilk 8329b7d624 Merge pull request #25305 from AdoHe/pod_ip
add ip to pod wide output
2016-05-13 15:05:30 -07:00
Jeff Lowdermilk 1169743223 Merge pull request #25575 from fgrzadkowski/unschedulable_pod
Fix updating pod condition in scheduler
2016-05-13 15:05:19 -07:00
Jeff Lowdermilk 177c0efe72 Merge pull request #25552 from caesarxuchao/merge-finalizers
add merge tag to v1/ObjectMeta.Finalizers
2016-05-13 15:04:17 -07:00
k8s-merge-robot ce80372573 Merge pull request #25500 from mml/2016
Automatic merge from submit-queue

It's 2016, yo.
2016-05-13 14:24:57 -07:00
k8s-merge-robot 399b086620 Merge pull request #23684 from luxas/auto_label_arch
Automatic merge from submit-queue

Automatically add node labels beta.kubernetes.io/{os,arch}

Proposal: #17981
As discussed in #22623:
> @davidopp: #9044 says cloud provider but can also cover platform stuff.

Adds a label `beta.kubernetes.io/platform` to `kubelet` that informs about the os/arch it's running on.
Makes it easy to specify `nodeSelectors` for different arches in multi-arch clusters.

```console
$ kubectl get no --show-labels
NAME        STATUS    AGE       LABELS
127.0.0.1   Ready     1m        beta.kubernetes.io/platform=linux-amd64,kubernetes.io/hostname=127.0.0.1
$ kubectl describe no
Name:			127.0.0.1
Labels:			beta.kubernetes.io/platform=linux-amd64,kubernetes.io/hostname=127.0.0.1
CreationTimestamp:	Thu, 31 Mar 2016 20:39:15 +0300
```
@davidopp @vishh @fgrzadkowski @thockin @wojtek-t @ixdy @bgrant0607 @dchen1107 @preillyme
2016-05-13 13:25:34 -07:00
Matt Liggett 2bc46d5085 It's 2016, yo. 2016-05-13 12:41:40 -07:00
Jeff Lowdermilk 1616239b4a Merge pull request #25436 from smarterclayton/defend_proto
Add a defensive sanity check to protobuf marshal
2016-05-13 10:45:58 -07:00
Jeff Lowdermilk e9aecf6b9e Merge pull request #25181 from janetkuo/kubectl-suggest
kubectl suggest for get (list, ps), and delete(rm)
2016-05-13 10:08:22 -07:00
Filip Grzadkowski 6c6862216b Fix updating pod condition in scheduler 2016-05-13 19:00:58 +02:00
Jeff Lowdermilk 1fe0e0778f Merge pull request #24080 from tyangliu/fix-infra-network-cfg
Pass dockerOpts by reference to setInfraContainerNetworkConfig
2016-05-13 09:53:39 -07:00
Jeff Lowdermilk ab4ffd3a1a Merge pull request #23752 from bparees/interrupt
make interrupt default exit with rc=1 and handle SIGHUP
2016-05-13 09:52:56 -07:00
derekwaynecarr 12229f3473 Add generated artifacts for new kubelet flag 2016-05-13 11:44:20 -04:00
derekwaynecarr d6354a54ad Add kubelet flag for eviction max pod grace period 2016-05-13 11:19:05 -04:00
k8s-merge-robot bb3f5b1768 Merge pull request #23090 from tgraf/ipv6
Automatic merge from submit-queue

Add IPv6 address support for pods - does NOT include services

This allows a container to have an IPv6 address only and extracts the address via nsenter and iproute2 or the docker client directly. An IPv6 address is now correctly reported when describing a pod.

@thockin @kubernetes/sig-network

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/23090)
<!-- Reviewable:end -->
2016-05-13 06:32:00 -07:00
k8s-merge-robot 17345bf857 Merge pull request #25372 from derekwaynecarr/more-eviction-flags
Automatic merge from submit-queue

Add eviction-pressure-transitition-period flag to kubelet

This PR does the following:
* add the new flag to control how often a node will go out of memory pressure or disk pressure conditions see: https://github.com/kubernetes/kubernetes/pull/25282
* pass an `eviction.Config` into `kubelet` so we can group config

/cc @vishh
2016-05-13 05:46:15 -07:00
k8s-merge-robot 4591aa0f3b Merge pull request #25306 from pmorie/configmap-medium
Automatic merge from submit-queue

Use local disk for ConfigMap volume instead of tmpfs

So that ConfigMap volumes are counted against pod's storage quota.

@kubernetes/sig-node 
cc @derekwaynecarr @vishh
2016-05-13 05:07:01 -07:00
k8s-merge-robot b7e2e2b494 Merge pull request #25297 from mml/db.tweak
Automatic merge from submit-queue

A few followups from #24697
2016-05-13 04:17:45 -07:00
k8s-merge-robot f6c2560f68 Merge pull request #25565 from wojtek-t/traces_in_replication_controller
Automatic merge from submit-queue

Add traces to ReplicationController

Ref #25563
2016-05-13 03:41:31 -07:00
Wojciech Tyczynski 327c9486e1 Add traces to ReplicationController 2016-05-13 10:30:45 +02:00
k8s-merge-robot a503bcd78e Merge pull request #25065 from derekwaynecarr/pod_worker_updates
Automatic merge from submit-queue

PodWorkers UpdatePod takes options struct

First commit from https://github.com/kubernetes/kubernetes/pull/24843 

Second commit:
The `PodWorkers.UpdatePod` operation is updated as follows:
* use options struct to pass arguments
* add a pod status func to allow override status
* add pod termination grace period if sync operation requires a kill pod
* add a call-back that is error aware

Third commit:
Add a `killPodNow` to kubelet that does a blocking kill pod call that properly integrates with pod workers.

The plan is to pass `killPodNow` as a function pointer into the out of resource killer.

```
// KillPodFunc kills a pod.
// The pod status is updated, and then it is killed with the specified grace period.
// This function must block until either the pod is killed or an error is encountered.
// Arguments:
// pod - the pod to kill
// status - the desired status to associate with the pod (i.e. why its killed)
// gracePeriodOverride - the grace period override to use instead of what is on the pod spec
type KillPodFunc func(pod *api.Pod, status api.PodStatus, gracePeriodOverride *int64) error
```

You can see it being used here in the WIP out of resource killer PR.

1344f858fb (diff-92ff0f643237f29824b4929574f84609R277)

/cc @vishh @yujuhong @pmorie
2016-05-12 19:50:26 -07:00
k8s-merge-robot 4dc0b8780c Merge pull request #24742 from derekwaynecarr/format_resources
Automatic merge from submit-queue

Add utility for kubelet to log resource lists consistently

This is a simple utility for logging resource lists with standardized output.

I find it useful when logging work in node eviction, similar to kubelet logging convention for pods in same package.

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24742)
<!-- Reviewable:end -->
2016-05-12 16:27:02 -07:00
derekwaynecarr 6fefb428c1 Add killPodNow to kubelet 2016-05-12 19:17:08 -04:00
Saad Ali 5a99fcd21b Merge pull request #25431 from janetkuo/deployment-client-check
Add interface check in Deployment's client
2016-05-12 15:55:43 -07:00
Saad Ali 4aa332e8f2 Merge pull request #25523 from saad-ali/modifyDetachToUseSpec
Modify Detach method to take disk name
2016-05-12 15:53:18 -07:00
Saad Ali 25f37007aa Merge pull request #24846 from pmorie/kubelet-test-loc
Reduce LOC in kubelet tests
2016-05-12 15:52:27 -07:00
Saad Ali 19169889d4 Merge pull request #24908 from pmorie/daemon-controller-loc
Reduce LOC in daemon controller tests
2016-05-12 15:51:55 -07:00
Saad Ali 870a1634b1 Merge pull request #24722 from derekwaynecarr/kubelet_testing
Code cleanups in kubelet_test.go
2016-05-12 15:51:00 -07:00
Saad Ali ab6c3121eb Merge pull request #25191 from rajdeepd/master
Added negative test case for namespace
2016-05-12 15:50:13 -07:00
k8s-merge-robot 04416c6b2d Merge pull request #24136 from derekwaynecarr/fix_constants
Automatic merge from submit-queue

Resource name constants were incorrect in versioned types.go

The constant field names and actual values to quota requests and limits for cpu and memory were incorrect in the v1 types.go file.

Important to note for reviewer:
* the constant fields here are unused in the project at this time
* the values those unused constant fields mapped to are not actually supported by the project
* there is no backwards compatibility concern, but if/when we look to convert to using versioned clients, we should have the correct constant fields and values.

The correct values were here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/api/types.go#L2213

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24136)
<!-- Reviewable:end -->
2016-05-12 15:49:20 -07:00
Saad Ali 06a893b3c1 Merge pull request #25472 from deads2k/tolerate-nil-error
tolerate nil error in HandleError
2016-05-12 15:48:35 -07:00
derekwaynecarr dee976ad79 Add generated artifacts for kubelet flags 2016-05-12 17:54:20 -04:00
k8s-merge-robot 5c30f983d9 Merge pull request #25018 from smarterclayton/fast_conversion
Automatic merge from submit-queue

Reduce allocations during conversion, enable new UnsafeConvertToVersion path

Cleans up the conversion path to avoid a few unnecessary allocations, then creates a new UnsafeConvertToVersion path that will allow encode/decode to bypass copying the object for performance. In that subsequent PR, ConvertToVersion will start to call Copy() and we will refactor conversions to reuse as much of the existing object as possible.

Also changes the unversioned.ObjectKind signature to not require allocations - speeds up a few common paths.
2016-05-12 14:50:01 -07:00