Commit Graph

11575 Commits (d1c5ae65d800134b6cd03a9946f9a50eea419457)

Author SHA1 Message Date
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
Yifan Gu f64c47ef80 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'.
2016-04-14 18:42:44 -07:00
Yifan Gu e803f55e20 rkt: Update the directory path for saving auth config. 2016-04-14 18:40:14 -07:00
nikhiljindal 6eae11e166 Updating the schema validation code 2016-04-14 18:07:00 -07:00
Rudi C 43d2b572ef Remove dead code in kubelet.go
The only call to this was removed in #20204 by @HaiyangDING

cc @vishh
2016-04-14 20:17:22 -04:00
Random-Liu d3d98b372b Refactor StartContainer, StopContainer and RemoveContainer. 2016-04-14 17:05:46 -07:00
Random-Liu ba4a5ed39e Refactor CreateContainer. 2016-04-14 17:05:46 -07:00
Random-Liu da07fa9dd5 Refactor InspectContainer. 2016-04-14 17:05:46 -07:00
Random-Liu b348e7d1c9 Refactr ListContainers. 2016-04-14 17:05:05 -07:00
Daniel Smith bbe5299371 Merge pull request #23798 from nak3/bash-completion
Bash completion updates
2016-04-14 16:59:48 -07:00
Daniel Smith f0fad8ec3d Merge pull request #23985 from caesarxuchao/fix-23799
Handle empty perferredVersion
2016-04-14 16:56:07 -07:00
Daniel Smith 86b7dbb2c6 Merge pull request #23844 from Random-Liu/proper-fake-docker-version
Set fake docker client to minimum required version.
2016-04-14 16:55:47 -07:00
Daniel Smith a42d7fa31c Merge pull request #23756 from smarterclayton/force_delete
Add a client flag to delete "--now" for grace period 0
2016-04-14 16:55:07 -07:00
Daniel Smith 1d96b4c55b Merge pull request #23549 from deads2k/acting-as
add act-as powers
2016-04-14 15:12:45 -07:00
goltermann c226c9435b Fix misspellings in comments.
https://goreportcard.com/report/k8s.io/kubernetes#misspell
2016-04-14 13:57:45 -07:00
Daniel Smith 490c68dbe3 Merge pull request #23768 from wojtek-t/conversions_with_framework_6
Migrate to new conversions generator - part 2
2016-04-14 11:30:21 -07:00
deads2k ac4c545b91 add act-as powers 2016-04-14 12:49:10 -04:00
Kenjiro Nakayama c9d34870ed Update bashcompletion codes for kubectl expose 2016-04-14 23:43:48 +09:00
Kenjiro Nakayama 84e3ee8ec4 Update bashcompletion codes for kubectl annotate 2016-04-14 23:40:34 +09:00
Kenjiro Nakayama 910b6bce33 Update bashcompletion codes for kubectl patch 2016-04-14 23:40:31 +09:00
Kenjiro Nakayama 5cc540fec1 Update bashcompletion codes for kubectl edit 2016-04-14 23:34:58 +09:00
Wojciech Tyczynski 5a73a9d235 Parallelize computing predicates 2016-04-14 16:32:52 +02:00
Jordan Liggitt 6c1bcfa28d Use correct defaults when binding apiserver flags 2016-04-14 10:12:51 -04:00
Andy Goldstein 049e63d253 Honor starting resourceVersion in watch cache
Compare the requested resourceVersion to each event's resourceVersion to ensure events that occurred
in the past are not sent to the client.
2016-04-14 09:37:22 -04:00
k8s-merge-robot 9c0a0833b3 Merge pull request #23532 from yifan-gu/lifecycle
Automatic merge from submit-queue

rkt: Add pre-stop lifecycle hooks for rkt.

When a pod is being terminated, the pre-stop hooks of all the containers
will be run before the containers are stopped.


cc @yujuhong @Random-Liu @sjpotter
2016-04-14 06:34:10 -07:00
k8s-merge-robot 590a5f3ad7 Merge pull request #23444 from deads2k/add-requeue-after-duration
Automatic merge from submit-queue

add a delayed queueing option to the workqueue

Adds delayed requeuing to the workqueue so that I requeue an item to be retried at some later time in my controller with a series of backoff rules.  It lets me have the best of the retryManager and the work queue de-duping.  Tracking failures and backoffs is on the caller

@smarterclayton @pweil-  this would help us move to using the informer everywhere and de-duping at that level.
2016-04-14 05:02:24 -07:00
k8s-merge-robot 62d65f3ce6 Merge pull request #23770 from dagnello/update-openstack-cloudprovider-instance-tests
Automatic merge from submit-queue

Extend OpenStack Cloud Provider Instance Tests

Adding OpenStack cloud provider Instance coverage for:
ExternalID
InstanceID
2016-04-14 04:26:42 -07:00
k8s-merge-robot e121b562c5 Merge pull request #23262 from sttts/sttts-bash-completion-flag-equal
Automatic merge from submit-queue

Make kubectl bash-completion namespace and resource alias aware

![kubectl-completion](https://cloud.githubusercontent.com/assets/730123/13912456/94abf9a2-ef3d-11e5-9c8a-3df7058ea8f0.gif)

- filter resource listing by `--namespace` flag given before in the command line
```bash
$ kubectl get pod --namespace=kube-system <tab><tab>
kube-dns-v9-2wuzj   kube-dns-v9-llqxa
```
- add completion of `--namespace`
```bash
$ kubectl get pod --namespace=<tab><tab>
[*]         default      ingress      kube-system
```

- add support for plural nouns and aliases like `rc`
2016-04-14 04:26:40 -07:00
k8s-merge-robot 04df711a35 Merge pull request #24035 from jsafrane/devel/nsenter-error-messages
Automatic merge from submit-queue

Add path to log messages.

It is useful to see the path that failed to mount in the log messages.

Fixes #23990.
2016-04-14 03:47:26 -07:00
k8s-merge-robot df21974730 Merge pull request #21741 from resouer/oomscore
Automatic merge from submit-queue

Use OomScoreAdj in kubelet for newer docker api

fixes: #20121

Related: client side PR [pull 454](https://github.com/fsouza/go-dockerclient/pull/454)

Godeps has already been updated to `0099401a7342ad77e71ca9f9a57c5e72fb80f6b2`, which included client side's modification. But it seems too aggressive to upgrade the docker api version of kubelet.
2016-04-14 03:07:41 -07:00
k8s-merge-robot 429228d403 Merge pull request #23953 from nikhiljindal/u8sServer
Automatic merge from submit-queue

moving genericapiserver command line flags to genericapiserver

cc @kubernetes/sig-api-machinery
2016-04-13 23:15:24 -07:00
k8s-merge-robot 1ccb4cf497 Merge pull request #23542 from caesarxuchao/clientset-release-1-3
Automatic merge from submit-queue

Clientset release 1.3

This PR creates the release 1.3 client set. We'll keep updating this client set until we cut release 1.3. In the meantime, the release 1.2 client set will be locked.

@lavalamp
2016-04-13 18:27:59 -07:00
Chao Xu 64e414fe39 e2e test for 1.3 2016-04-13 16:49:24 -07:00
k8s-merge-robot 20eccc24cd Merge pull request #24143 from goltermann/vetclean
Automatic merge from submit-queue

Final vet fixes; enabling vet checks in verify scripts.

Fixes #22523, #22524
2016-04-13 16:46:46 -07:00
Hongchao Deng b9745999c9 Decouple etcd node.expiration logic from DeleitonTimestamp 2016-04-13 15:11:53 -07:00
Daniel Smith 4c539bf082 Merge pull request #23490 from wojtek-t/remove_set_from_storage_interface
Remove Set() from storage.Interface.
2016-04-13 14:22:05 -07:00
Daniel Smith 498dc418ed Merge pull request #23122 from screeley44/volmount_errors
Return more useful error information when a persistent volume fails to mount
2016-04-13 14:20:51 -07:00
goltermann a3104ba96c Final vet fixes; enabling vet checks in verify scripts. 2016-04-13 13:51:51 -07:00
nikhiljindal 8d7a8c6ae6 moving genericapiserver command line flags to genericapiserver 2016-04-13 13:28:18 -07:00
Chao Xu 31cd4c124d handle empty perferredVersion 2016-04-13 13:18:31 -07:00
Chao Xu 27ad11a503 created release 1.3 2016-04-13 13:02:40 -07:00
k8s-merge-robot ae57644172 Merge pull request #23435 from jsafrane/devel/fix-nsenter-mkdir
Automatic merge from submit-queue

Fixed mounting with containerized kubelet

`NsenterMounter.IsLikelyNotMountPoint()` should return `ErrNotExist` when the
checked directory does not exists - the regular mounted does this and
some volume plugins depend on this behavior.

See for example: https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/aws_ebs/aws_util.go#L72
2016-04-13 08:35:08 -07:00
Robert Rati 83de3e9733 Added optional delays to starting controller managers. #22669 2016-04-13 09:52:28 -04:00
k8s-merge-robot 8eb19c7889 Merge pull request #22154 from sdminonne/service_nodeports_quotas
Automatic merge from submit-queue

Adding nodeports services to quota

To fix #21677
@derekwaynecarr
2016-04-13 05:50:27 -07:00
k8s-merge-robot f5e8e7453b Merge pull request #23806 from smarterclayton/streaming_watch
Automatic merge from submit-queue

Implement a streaming serializer for watch

Changeover watch to use streaming serialization. Properly version the
watch objects. Implement simple framing for JSON and Protobuf (but not
YAML).

@wojtek-t @lavalamp
2016-04-13 05:18:17 -07:00
k8s-merge-robot 9c5680bac3 Merge pull request #23904 from pmorie/kubelet-volumes-comments
Automatic merge from submit-queue

Add godoc to kubelet/volumes.go

Noticed that `mountExternalVolumes`, of all things, was missing Godoc while working w/ @screeley44.  Decided to add some tonight since I have been making noise about grokkability of the kubelet lately.

@kubernetes/sig-storage
2016-04-13 03:01:32 -07:00
Harry Zhang c31ec5607a Refactor version cache into kubelet util 2016-04-13 00:42:22 -04:00
harry f9e2f522b4 Add cache for api version
Expose runtime interface
2016-04-12 22:34:59 -04:00
Harry Zhang b4244a079f Implement OomScoreAdj in kubelet 2016-04-12 22:34:58 -04:00
Lantao Liu 41953bae49 Add unit test for generateAPIPodStatus 2016-04-12 16:37:26 -07:00
Lantao Liu b49357be22 Cleanup the waiting state related code 2016-04-12 16:37:26 -07:00
Yifan Gu cc4336829d rkt: Add pre-stop lifecycle hooks for rkt.
When a pod is being terminated, the pre-stop hooks of all the containers
will be run before the containers are stopped.
2016-04-12 13:10:51 -07:00
Random-Liu 2b9f6bea18 Fix PullImage and corresponding node e2e test. 2016-04-12 10:42:25 -07:00
k8s-merge-robot f4a421d4bb Merge pull request #24008 from liggitt/watch_cache
Automatic merge from submit-queue

Make watch cache treat resourceVersion consistent with uncached watch

Fixes #24004

This makes the watch cache handle resourceVersion consistent with an uncached watch API call, and the documented behavior. Watching from resourceVersion=X delivers watch events *after* version X (X is not included):

> // When specified with a watch call, shows changes that occur after that particular version of a resource.
> // Defaults to changes from the beginning of history.
> ResourceVersion string
2016-04-12 10:23:33 -07:00
Chao Xu f315ffd8b1 make default thirdparty resource preferredVersion; adding back discovery tests 2016-04-12 10:09:09 -07:00
k8s-merge-robot e93c0d727f Merge pull request #20204 from HaiyangDING/predlib
Automatic merge from submit-queue

Move predicates into library

This PR tries to implement #12744 

Any suggestions/ideas are welcome. @davidopp 

current state: integration test fails if including podCount check in Kubelet.
    
DONE:
    1. refactor all predicates: predicates return fitOrNot(bool) and error(Error) in which the latter is of type PredicateFailureError or InsufficientResourceError
    2. GeneralPredicates() is a predicate function, which includes serveral other predicate functions (PodFitsResource, PodFitsHost, PodFitsHostPort). It is registered as one of the predicates in DefaultAlgorithmProvider, and is also called in canAdmitPod() in Kubelet and should be called by other components (like rescheduler, etc if necessary. See discussion in issue #12744
TODO:
    1. determine which predicates should be included in GeneralPredicates()
    2. separate GeneralPredicates() into: a.) GeneralPredicatesEvictPod() and b.) GeneralPredicatesNotEvictPod()
    3. DaemonSet should use GeneralPredicates()
2016-04-12 07:44:45 -07:00
Jordan Liggitt ada60236f7 Make watch cache behave like uncached watch 2016-04-12 10:14:07 -04:00
k8s-merge-robot fcddb9cba5 Merge pull request #16964 from liggitt/json_precision
Automatic merge from submit-queue

Preserve int data when unmarshaling

There are several places we use `json.Unmarshal` into an unstructured map (StrategicMergePatch, UnstructuredJSONScheme, many others).

In this scenario, the json package converts all numbers to float64. This exposes many of the int64 fields in our API types to corruption when the unstructured map is marshalled back to json.

A simple example is a pod with an `"activeDeadlineSeconds": 1000000`. Trying to use `kubectl label`, `annotate`, `patch`, etc results in that int64 being converted to a float64, submitted to the server, and the server rejecting it with an error about "cannot unmarshal number 1e+6 into Go value of type int64"

The json package provides a way to defer conversion of numbers (`json.Decoder#UseNumber`), but does not actually do conversions to int or float. This PR makes use of that feature, and post-processes the unmarshalled map to convert json.Number objects to either int64 or float64 values
2016-04-12 07:09:32 -07:00
k8s-merge-robot acf9492cb1 Merge pull request #23660 from goltermann/vetclean
Automatic merge from submit-queue

Additional go vet fixes

Mostly:
- pass lock by value
- bad syntax for struct tag value
- example functions not formatted properly
2016-04-12 06:22:16 -07:00
k8s-merge-robot fda8ec2f5d Merge pull request #24015 from yujuhong/rss_memory
Automatic merge from submit-queue

kubele: add RSS memroy to the summary API
2016-04-12 05:51:35 -07:00
James Ravn 5bb0595260 Make deserialization cache size configurable
Instead of the default 50K entries, allow users to specify more sensible
sizes for their cluster.
2016-04-12 13:42:27 +01:00
Salvatore Dario Minonne 15b7577454 Adding nodeports services to quota 2016-04-12 11:09:16 +02:00
Jordan Liggitt 37c86041ca Preserve int64 data when patching 2016-04-11 16:23:28 -04:00
Vishnu kannan b06bb6bb8e OOM Score adjusting logic in kubelet should handle containers that exit quickly.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-04-11 11:21:48 -07:00
Clayton Coleman 3474911736 Implement a streaming serializer for watch
Changeover watch to use streaming serialization. Properly version the
watch objects. Implement simple framing for JSON and Protobuf (but not
YAML).
2016-04-11 11:22:05 -04:00
Clayton Coleman 87146c4255 Fix compilation errors in protobuf and add decode test 2016-04-11 11:22:04 -04:00
Clayton Coleman bfc991646b Implement correct and memory safe framing and add tests 2016-04-11 11:22:04 -04:00
k8s-merge-robot 6a87dba0b8 Merge pull request #22733 from resouer/flow-control
Automatic merge from submit-queue

Add flow control pkg

minor fix ref #15634
Refactor pkg names in back off related files
2016-04-11 06:18:51 -07:00
Wojciech Tyczynski 81265b8f85 Regenerate files 2016-04-11 08:07:40 +02:00
Wojciech Tyczynski 7448cc04e1 Switch to new generator 2016-04-11 08:04:45 +02:00
Wojciech Tyczynski cd2de7d4cd Merge pull request #23741 from wojtek-t/conversions_with_framework_5
Small improvements in conversion generator
2016-04-10 22:51:26 -07:00
Wojciech Tyczynski 6d954a1490 Merge pull request #23871 from smarterclayton/proto_timestamp
Implement a simpler unversioned.Time serialization
2016-04-10 22:47:49 -07:00
HaiyangDING 41ed85479a move predicates into library (address #12744)
DONE:
1. refactor all predicates: predicates return fitOrNot(bool) and error(Error) in which the latter is of type
	PredicateFailureError or InsufficientResourceError. (For violation of either MaxEBSVolumeCount or
        MaxGCEPDVolumeCount, returns one same error type as ErrMaxVolumeCountExceeded)
2. GeneralPredicates() is a predicate function, which includes serveral other predicate functions (PodFitsResource,
        PodFitsHost, PodFitsHostPort). It is registered as one of the predicates in DefaultAlgorithmProvider, and
        is also called in canAdmitPod() in Kubelet and should be called by other components (like rescheduler, etc)
        if necessary. See discussion in issue #12744
3. remove podNumber check from GeneralPredicates
4. HostName is now verified in Kubelet's canAdminPod(). add TestHostNameConflicts in kubelet_test.go
5. add getNodeAnyWay() method in Kubelet to get node information in standaloneMode

TODO:
1. determine which predicates should be included in GeneralPredicates()
2. separate GeneralPredicates() into:
	a. GeneralPredicatesEvictPod() and
	b. GeneralPredicatesNotEvictPod()
3. DaemonSet should use GeneralPredicates()
2016-04-11 00:57:03 +08:00
k8s-merge-robot 7ed19f7fde Merge pull request #24054 from nikhiljindal/typeObject
Automatic merge from submit-queue

Allowing type object in kubectl swagger validation

Allowing `"type": "object"` in kubectl swagger validation.

We will cherrypick this in 1.2
This allows 1.2 kubectl to work with 1.3 api server which will use `"type":"object"` instead of `"type":"any"`.
Ref https://github.com/kubernetes/kubernetes/issues/4700#issuecomment-194719759

cc @bgrant0607
2016-04-09 14:52:35 -07:00
Jeff Lowdermilk 1a9cb97bdd Merge pull request #23658 from Random-Liu/fix-termination-message-path
Fix TerminationMessagePath
2016-04-08 20:54:14 -07:00
Jeff Lowdermilk 2dd9bf535f Merge pull request #23723 from intelsdi-x/stage1_image_rkt_deprecated_flag
keep deprecated flag stage1-image with rkt
2016-04-08 20:53:09 -07:00
nikhiljindal b476ee4b12 Allowing type object in kubectl swagger validation 2016-04-08 17:26:35 -07:00
Jeff Lowdermilk 2fb745f01d Merge pull request #23661 from spxtr/oidc
Remove retries from most oidc tests.
2016-04-08 14:33:34 -07:00
Jeff Lowdermilk c3dac2d18b Merge pull request #23449 from swagiaal/pv-recycle-race-logging
Add loging to the recently recycled PV section
2016-04-08 13:30:23 -07:00
Jeff Lowdermilk ade0e30313 Merge pull request #23814 from vbehar/fix_typo
fix typo (in godoc)
2016-04-08 12:57:15 -07:00
derekwaynecarr 22fc4340a7 Expose SummaryProvider for reuse by other parts of kubelet 2016-04-08 14:25:39 -04:00
Yu-Ju Hong 388b4ff569 kubele: add RSS memroy to the summary API 2016-04-08 11:05:20 -07:00
Jeff Lowdermilk 9be85fbaf0 Merge pull request #23541 from bprashanth/fw_default
Default firewall port to TCP when unspecified.
2016-04-08 09:32:00 -07:00
derekwaynecarr a9e362d70c Add memory available to summary stats provider 2016-04-08 12:30:41 -04:00
Jeff Lowdermilk f41f5dc823 Merge pull request #23853 from janetkuo/revert-rollingupdate-latest
Revert "rolling update will check whether the image is distinct or not, however the image with tag latest should be excluded"
2016-04-08 09:29:32 -07:00
Jan Safranek be2ca8dec3 Add path to log messages.
It is useful to see the path that failed to mount in the log messages.
2016-04-08 09:41:09 +02:00
Clayton Coleman ea3467f822 Add a client flag for --now delete
Is equivalent to --grace-period=0 but is more intuitive for end users.
2016-04-07 23:45:08 -04:00
Hongchao Deng 71b46f3f57 fix build 2016-04-07 19:22:28 -07:00
zhouhaibing089 597fdede5a the component status health check should check whether the scheme of backend storage url is https or not 2016-04-08 07:26:27 +08:00
Joe Finney ae79677fd0
Remove global var for OIDC retry/backoff, and remove retries from unit tests. 2016-04-07 14:18:29 -07:00
k8s-merge-robot 22f01f1041 Merge pull request #23891 from caesarxuchao/client-gen-cmd-doc
Automatic merge from submit-queue

Client-gen: show the command used to generate the package in doc.go

#22928 adds a comment in every generated file to show the arguments supplied to client-gen. I received comment (https://github.com/kubernetes/kubernetes/pull/22928#issuecomment-201078363) that it generates too many one-line changes every time the command line argument is changed. To address this problem, this PR only generates that line in doc.go.

@jianhuiz @krousey
2016-04-07 13:13:51 -07:00
Jordan Liggitt bf097ea233 fake util.clock tick 2016-04-07 15:10:50 -04:00
Jordan Liggitt 290d970282 make delayed workqueue use channels with single writer 2016-04-07 15:10:25 -04:00
Paul Morie 9069cbb086 Correctly handle secret and configMap envs in kubectl describe 2016-04-07 14:16:59 -04:00
deads2k d12a4d6d5a add a delayed queueing option to the workqueue 2016-04-07 14:02:50 -04:00
Scott Creeley 36970deeca reword volume mount errUnsupportedVolume error and surface true error to describe event 2016-04-07 09:55:01 -04:00