Commit Graph

11569 Commits (616af686cbb50dc42434d7a9864e2cf465cb9ab9)

Author SHA1 Message Date
k8s-merge-robot 616af686cb Merge pull request #23694 from hongchaodeng/w
Automatic merge from submit-queue

etcd3/store: watcher implementation

ref: https://github.com/kubernetes/kubernetes/issues/22448

This PR does:
- Provide a watcher that uses etcd v3 API to watch changes via etcd and process them based on existing logic of storage.Interface.Watch(), WatchList().
- By using the watcher, very trivial to implement Watch() and WatchList() in etcd3 storage.Interface implementation.
2016-04-18 08:23:13 -07:00
k8s-merge-robot 5ad27f2720 Merge pull request #23575 from deads2k/shared-cache
Automatic merge from submit-queue

shared controller informers

Related to https://github.com/kubernetes/kubernetes/issues/14978

This demonstrates how controllers which use an `Informer`, would be able to share the same watch and store.  A similar "setup and run" approach could be done for an `IndexInformer` to share that cache.  I found adding listeners here to be easier than intercepting at the watch interface (problems with resourceVersion) or the reflector (same plumbing, but you have to fan out to multiple stores).

We could also use the cache we build here to back several of the admission plugins that currently run their own lookup caches today.

If there's interest, I can finish out the `SharedInformer` and switch the low hanging fruit over.  

@kubernetes/rh-cluster-infra @smarterclayton @liggitt @wojtek-t
2016-04-18 07:48:29 -07:00
k8s-merge-robot d37e6ad332 Merge pull request #24126 from Random-Liu/fix-pull-image
Automatic merge from submit-queue

Fix PullImage and add corresponding node e2e test

Fixes #24101. This is a bug introduced by #23506, since ref #23563.

The root cause of #24101 is described [here](https://github.com/kubernetes/kubernetes/issues/24101#issuecomment-208547623).

This PR
1) Fixes #24101 by decoding the messages returned during pulling image, and return error if any of the messages contains error.
2) Add the node e2e test to detect this kind of failure.
3) Get present check out of `ConformanceImage.Remove()` and `ConformanceImage.Pull()`. Because sometimes we may expect error to occur in `PullImage()` and `RemoveImage()`, but even that doesn't happen, the `Present()` check will still return error and let the test pass.

@yujuhong @freehan @liangchenye 

Also /cc @resouer, because he is doing the image related functions refactoring.
2016-04-18 07:05:44 -07:00
Hongchao Deng e18b4e67be etcd3/store: watcher implementation 2016-04-18 21:41:53 +08:00
deads2k f0c33d65b6 start sharing the pod cache and list/watch 2016-04-18 08:51:55 -04:00
deads2k 96d1f48b0b add SharedInformer 2016-04-18 08:51:55 -04:00
k8s-merge-robot d0b52dd8b3 Merge pull request #24107 from yifan-gu/load_bridge
Automatic merge from submit-queue

kubenet: Load bridge netfilter module in Init().

This lets the kubenet loads the bridge netfilter module and set bridge-nf-call-iptables=1

Fix #24018 

Follow up PRs would be appreciate if we also load the module in the bridge plugin binary itself. Ref https://github.com/kubernetes/kubernetes/issues/24018#issuecomment-207682514

cc @kubernetes/sig-node @sjpotter @euank
2016-04-18 00:08:25 -07:00
k8s-merge-robot 62fd60565a Merge pull request #24048 from liggitt/apiserver-defaults
Automatic merge from submit-queue

Use correct defaults when binding apiserver flags

defaults should be set in the struct-creating function, then the current struct field value used as the default when binding the flag
2016-04-17 20:59:38 -07:00
k8s-merge-robot 9637b09f69 Merge pull request #24047 from derekwaynecarr/reuse_summary_provider
Automatic merge from submit-queue

Expose SummaryProvider for reuse by other parts of kubelet

To support out of resource killing in the kubelet, we will introduce a new top-level module that will ensure node stability by checking if eviction thresholds have been met for memory and file-system usage on the node.  In addition, it will then need information about pod memory and disk usage in order to make an eviction selection.  Currently, this information is collected in `SummaryProvider` but it's hidden away and not available for re-use by other top-level modules of the kubelet.  This initial refactor adds the ability to get summary stat information from the `ResourceAnalyzer` so it can be reused by other top-level modules.

I suspect we will further re-factor this area as code evolves, but this unblocks further progress on out-of-resource killing.

/cc @vishh @timothysc @kubernetes/sig-node @kubernetes/rh-cluster-infra
2016-04-17 20:22:57 -07:00
k8s-merge-robot e81663c824 Merge pull request #24006 from caesarxuchao/thirdparty-preferredversion
Automatic merge from submit-queue

Use the first version as thirdparty resource preferredVersion

First commit is a one-liner, which implements the server-half of #23985.

The other two commits rearrange the test code, and add back a commented out test of thirdparty resource.

@lavalamp @nikhiljindal
2016-04-17 16:02:59 -07:00
k8s-merge-robot 5f3f06f0b1 Merge pull request #24022 from hongchaodeng/dep
Automatic merge from submit-queue

Bump up etcd dependency to fix data race

ref: https://github.com/kubernetes/kubernetes/pull/23694

What this PR does
- Bumping up the godep of etcd to fix data race in etcd watcher. Without this change, watcher PR builds will fail in race detection.
- Small changes to fix builds after upgrade
2016-04-17 12:01:32 -07:00
k8s-merge-robot 9e7ed221ed Merge pull request #24379 from huang195/quota_fixes
Automatic merge from submit-queue

minor comment and code fixes

1. Correct a comment: return value should be nil, and not true
2. Early loop break
2016-04-17 08:02:47 -07:00
k8s-merge-robot 75b49f591a Merge pull request #23948 from derekwaynecarr/memory_available
Automatic merge from submit-queue

Add memory available to summary stats provider

To support out of resource killing when low on memory, we want to let operators specify eviction thresholds based on available memory instead of memory usage for ease of use when working with heterogeneous nodes.  

So for example, a valid eviction threshold would be the following: 
* If node.memory.available < 200Mi for 30s, then evict pod(s)

For the node, `memory.availableBytes` is always known since the `memory.limit_in_bytes` is always known for root cgroup.  For individual containers in pods, we only populate the `availableBytes` if the container was launched with a memory limit specified.  When no memory limit is specified, the cgroupfs sets a value of 1 << 63 in the `memory.limit_in_bytes` so we look for a similar max value to handle unbounded limits, and ignore setting `memory.availableBytes`.

FYI @vishh @timstclair - as discussed on Slack.

/cc @kubernetes/sig-node @kubernetes/rh-cluster-infra
2016-04-17 06:32:36 -07:00
k8s-merge-robot 2b9637da6a Merge pull request #23945 from smarterclayton/move_reset_metrics
Automatic merge from submit-queue

Move /resetMetrics to DELETE /metrics

Reduces the surface area of the API server slightly and allows
downstream components to have deleteable metrics. After this change
genericapiserver will *not* have metrics unless the caller defines it
(allows different apiserver implementations to make that choice on their
own).

@wojtek-t
2016-04-17 05:58:26 -07:00
Wojciech Tyczynski 495e274500 Merge pull request #24384 from Random-Liu/disable-version-cache
Disable the version cache to fix #24298.
2016-04-17 04:48:07 -07:00
k8s-merge-robot 2bf52175f9 Merge pull request #23923 from hongchaodeng/exp
Automatic merge from submit-queue

Decouple etcd node.expiration logic from DeleitonTimestamp

ref: https://github.com/kubernetes/kubernetes/issues/23902
2016-04-17 04:12:26 -07:00
Random-Liu 19249a8cbc Disable the version cache to fix #24298. 2016-04-17 03:14:03 -07:00
k8s-merge-robot 8990897ce6 Merge pull request #23940 from freehan/netinterface
Automatic merge from submit-queue

switch to use ContainerID instead of DockerID in network plugin interface

fix: #15663
2016-04-17 01:12:51 -07:00
k8s-merge-robot a275a045d1 Merge pull request #23914 from sky-uk/make-etcd-cache-size-configurable
Automatic merge from submit-queue

Make etcd cache size configurable

Instead of the prior 50K limit, allow users to specify a more sensible size for their cluster.

I'm not sure what a sensible default is here. I'm still experimenting on my own clusters. 50 gives me a 270MB max footprint. 50K caused my apiserver to run out of memory as it exceeded >2GB. I believe that number is far too large for most people's use cases.

There are some other fundamental issues that I'm not addressing here:
- Old etcd items are cached and potentially never removed (it stores using modifiedIndex, and doesn't remove the old object when it gets updated)
- Cache isn't LRU, so there's no guarantee the cache remains hot. This makes its performance difficult to predict. More of an issue with a smaller cache size.
- 1.2 etcd entries seem to have a larger memory footprint (I never had an issue in 1.1, even though this cache existed there). I suspect that's due to image lists on the node status.

This is provided as a fix for #23323
2016-04-17 00:06:31 -07:00
k8s-merge-robot 2e87b0e363 Merge pull request #23699 from Random-Liu/container-related-functions
Automatic merge from submit-queue

Kubelet: Refactor container related functions in DockerInterface

For #23563.
Based on #23506, will rebase after #23506 is merged.

The last 4 commits of this PR are new.
This PR refactors all container lifecycle related functions in DockerInterface, including:
* ListContainers
* InspectContainer
* CreateContainer
* StartContainer
* StopContainer
* RemoveContainer

@kubernetes/sig-node
2016-04-16 21:41:19 -07:00
k8s-merge-robot 822618afb5 Merge pull request #23912 from smarterclayton/watch_until
Automatic merge from submit-queue

Add watch.Until, a conditional watch mechanism

A more powerful tool than wait.Poll, allows a watch interface to drive conditionals to react to changes on a resource or resources. Provide a set of standard conditions that are in common use in the code, and updates e2e to use a few of these.

Extracted from #23567
2016-04-16 21:05:40 -07:00
k8s-merge-robot d44457ebaf Merge pull request #23903 from zhouhaibing089/https-fix
Automatic merge from submit-queue

the component status health check should check whether the scheme of backend storage url is https or not

fix https://github.com/kubernetes/kubernetes/issues/23897, when querying the component status of etcd (backend storage), the scheme of url is not checked and use `http` always, this commit aims to fix this.
2016-04-16 20:22:57 -07:00
k8s-merge-robot 1087162548 Merge pull request #23841 from dagnello/update-openstack-cloudprovider-volume-tests
Automatic merge from submit-queue

Extend OpenStack Cloud Provider Volume Tests

Adding coverage for:
getVolume
AttachDisk
DetachDisk
2016-04-16 17:44:09 -07:00
k8s-merge-robot bfc953cd4b Merge pull request #23890 from pmorie/kubectl-describe-envs
Automatic merge from submit-queue

Correctly handle secret and configMap envs in kubectl describe

Fixes #23679 

cc @kubernetes/kubectl @jwforres
2016-04-16 17:08:58 -07:00
k8s-merge-robot f1eff2a737 Merge pull request #23862 from nelcy/flexsecrets
Automatic merge from submit-queue

Flexvolume: Add support for multiple secrets

This PR adds support to pass multiple secrets for flexvolume plugins.

To allow multiple secrets, secrets are now passed as:
"kubernetes.io/secret/id-rsa":"value-2\r\n\r\n","kubernetes.io/secret/id-rsa.pub":"value-1\r\n"
2016-04-16 16:32:48 -07:00
k8s-merge-robot 957ee1d50a Merge pull request #23819 from rrati/controller-manager-startup-delay
Automatic merge from submit-queue

Added optional delays to starting controller managers. #22669
2016-04-16 15:33:32 -07:00
k8s-merge-robot 167e4d03cc Merge pull request #23734 from sky-uk/fix-update-for-expired-events
Automatic merge from submit-queue

Fix expired event logic to use 404 instead of 500

It seems this logic was never updated once apiserver started returning 404s for expired (missing) events.

This change corrects it to use a 404 so events will get resent correctly if they were expired in etcd.

Fixes #23637.
2016-04-16 12:46:07 -07:00
k8s-merge-robot 7664509c73 Merge pull request #24248 from wojtek-t/parallel_predicates
Automatic merge from submit-queue

Parallelize computing predicates in scheduler

@davidopp
2016-04-16 09:51:45 -07:00
Hai Huang b6557babf2 minor comment and code fixes 2016-04-16 10:18:43 -04:00
k8s-merge-robot fe6a7a2c7d Merge pull request #23689 from maclof/drain-replicaset-pods
Automatic merge from submit-queue

Drain pods created from ReplicaSets

Refer to my issue here: https://github.com/kubernetes/kubernetes/issues/23531
2016-04-16 00:37:41 -07:00
k8s-merge-robot bf69b2a862 Merge pull request #24302 from therc/patch-1
Automatic merge from submit-queue

Remove dead code in kubelet.go
2016-04-16 00:00:29 -07:00
k8s-merge-robot 49dd31a9a8 Merge pull request #23643 from smarterclayton/leak
Automatic merge from submit-queue

interrupt package (attach and edit) could leak a goroutine
2016-04-16 00:00:24 -07:00
Clayton Coleman 845e496572 Convert poll in e2e with watch.Until 2016-04-15 22:21:42 -04:00
k8s-merge-robot ed87db5040 Merge pull request #23437 from DirectXMan12/bug/cannot-edit-across-gv
Automatic merge from submit-queue

Make kubectl edit not convert GV on edits

Previously, kubectl edit was using a decoder to load in edits that
converted to the internal version.  It would then re-encode this
decoded value to produce a patch.  However, if you were editing
in the object in a GroupVersion that was not the internal version,
this would cause the kubectl edit command to attempt to produce
a patch which changed the GroupVersion, which would fail.

Now, we use a plain deserializer instead, so no conversion or
defaulting occurs when loading in the edited file.

Ref #23378
2016-04-15 16:32:17 -07:00
k8s-merge-robot 03f48e730e Merge pull request #22810 from amygdala/cassandra2
Automatic merge from submit-queue

phase 2 of cassandra example overhaul

Here's the next iteration in overhauling this example, towards https://github.com/kubernetes/kubernetes/issues/20961.  This removes the pod adoption part, but doesn't (yet) otherwise change any of the resources used.

It also includes some README cleanup, and removes some explicit specification of labels in the rc yaml.

This PR doesn't yet add any commentary on how we're using the seed provider (re: https://github.com/kubernetes/kubernetes/issues/20961#issuecomment-190405959 etc.).  Maybe we should add that.

Also: LMK if this PR should include any changes to the links out to the docs.

cc @bgrant0607 @johndmulhausen
2016-04-15 15:41:01 -07:00
k8s-merge-robot 61c0424b27 Merge pull request #24301 from yifan-gu/host_net
Automatic merge from submit-queue

rkt: Fix hostnetwork.

Mount hosts' /etc/hosts, /etc/resolv.conf, set host's hostname
when running the pod in the host's network.

Fix #24235 

cc @kubernetes/sig-node
2016-04-15 13:59:27 -07:00
k8s-merge-robot f83c0aef4a Merge pull request #23852 from yifan-gu/previous_log
Automatic merge from submit-queue

rkt: Use rkt pod's uuid as the systemd service file's name.

Previously, the service file's name is 'k8s_${POD_UID}.service',
which means we need to `systemctl daemon-reload` if the we replace
the content of the service file (e.g. pod is restarted).

However this makes the journal in the previous pod get disconnected.

This PR solves the issue by using the unique rkt uuid as the service
file's name. After the change, the service file's name will be:
'k8s_${rkt_uuid}.service'.


Fix #23691
2016-04-15 12:04:06 -07:00
Clayton Coleman f89bde1415 Add watch.Until, a conditional watch mechanism
Also add helpers for collecting the events that happen during a watch
and a helper that makes it easy to start a watch from any object with
ObjectMeta.
2016-04-15 11:49:07 -04:00
Clayton Coleman 0f95b91f96 Move /resetMetrics to DELETE /metrics
Reduces the surface area of the API server slightly and allows
downstream components to have deleteable metrics. After this change
genericapiserver will *not* have metrics unless the caller defines it
(allows different apiserver implementations to make that choice on their
own).
2016-04-15 11:44:17 -04:00
k8s-merge-robot ff1da7674d Merge pull request #24268 from wojtek-t/remove_old_conversions_generator
Automatic merge from submit-queue

Remove old conversion generator
2016-04-15 04:25:19 -07:00
k8s-merge-robot d56ec66e7c Merge pull request #23667 from yifan-gu/config
Automatic merge from submit-queue

rkt: Update the directory path for saving auth config.

Since #23308 is merged, now we have more stable way to determine where to store the auth configs.

cc @yujuhong @sjpotter
2016-04-15 03:22:44 -07:00
Wojciech Tyczynski 89e860e622 Remove old conversion generator 2016-04-15 12:07:57 +02:00
Chakravarthy Nelluri f53bc4ebe0 Flexvolume: Add support for multiple secrets 2016-04-15 02:40:38 -07:00
Marc Lough fdf409861a Drain pods created from ReplicaSets 2016-04-15 08:51:40 +01:00
k8s-merge-robot 8f3c623287 Merge pull request #23594 from Clarifai/ecr
Automatic merge from submit-queue

Allow lazy binding in credential providers; don't use it in AWS yet

This is step one for cross-region ECR support and has no visible effects yet.
I'm not crazy about the name LazyProvide. Perhaps the interface method could
remain like that and the package method of the same name could become
LateBind(). I still don't understand why the credential provider has a
DockerConfigEntry that has the same fields but is distinct from
docker.AuthConfiguration. I had to write a converter now that we do that in
more than one place.

In step two, I'll add another intermediate, lazy provider for each AWS region,
whose empty LazyAuthConfiguration will have a refresh time of months or years.
Behind the scenes, it'll use an actual ecrProvider with the usual ~12 hour
credentials, that will get created (and later refreshed) only when kubelet is
attempting to pull an image. If we simply turned ecrProvider directly into a
lazy provider, we would bypass all the caching and get new credentials for
each image pulled.
2016-04-14 23:42:07 -07:00
k8s-merge-robot ea932c0956 Merge pull request #21224 from Random-Liu/add-unit-test-for-convert-function
Automatic merge from submit-queue

Kubelet: Better-defined Container Waiting state

For issue #20478 and #21125.

This PR corrected logic and add unit test for `ShouldContainerBeRestarted()`, cleaned up `Waiting` state related code and added unit test for `generateAPIPodStatus()`.

Fixes #20478
Fixes #17971

@yujuhong
2016-04-14 23:05:55 -07:00
k8s-merge-robot 2382fec956 Merge pull request #23894 from vishh/oom-score-adj-error
Automatic merge from submit-queue

Do not throw creation errors for containers that fail immediately after being started

Fixes (hopefully) #23607 

cc @dchen1107
2016-04-14 22:29:14 -07:00
Amy Unruh 8846b313dc phase 2 of cassandra example overhaul 2016-04-14 21:55:23 -07:00
Yifan Gu dfb6dd010f rkt: Fix hostnetwork.
Mount hosts' /etc/hosts, /etc/resolv.conf, set host's hostname
when running the pod in the host's network.

Besides, do not set the DNS flags when running in host's network.
2016-04-14 18:44:09 -07:00
Yifan Gu 02c0f41c88 kubenet: Load bridge netfilter module in Init().
Also set 'bridge-nf-call-iptables' to true.
2016-04-14 18:43:22 -07:00