Commit Graph

13830 Commits (63602348a46dae777038be34470c0d7d025420fe)

Author SHA1 Message Date
k8s-merge-robot 5427e8aa02 Merge pull request #29544 from lixiaobing10051267/masterFuncNote
Automatic merge from submit-queue

Func note is copied same as other one
2016-07-27 21:07:03 -07:00
k8s-merge-robot 40a6d68efb Merge pull request #29541 from lixiaobing10051267/masterTimeOut2
Automatic merge from submit-queue

Log information wrong while wait.ForeverTestTimeout
2016-07-27 21:06:52 -07:00
k8s-merge-robot 1ae9b73cd3 Merge pull request #29673 from pmorie/mount-collision
Automatic merge from submit-queue

Fix mount collision timeout issue

Short- or medium-term workaround for #29555.  The root issue being fixed here is that the recent attach/detach work in the kubelet uses a unique volume name as a key that tracks the work that has to be done for each volume in a pod to attach/mount/umount/detach.  However, the non-attachable volume plugins do not report unique names for themselves, which causes collisions when a single secret or configmap is mounted multiple times in a pod.

This is still a WIP -- I need to add a couple E2E tests that ensure that tests break in the future if there is a regression -- but posting for early review.

cc @kubernetes/sig-storage 

Ultimately, I would like to refine this a bit further.  A couple things I would like to change:

1.  `GetUniqueVolumeName` should be a property ONLY of attachable volumes
2.  I would like to see the kubelet apparatus for attach/mount/umount/detach handle non-attachable volumes specifically to avoid things like the `WaitForControllerAttach` call that has to be done for those volume types now
2016-07-27 21:06:47 -07:00
k8s-merge-robot 1f9c41dc3a Merge pull request #29495 from xiangpengzhao/fix-defer-fclose
Automatic merge from submit-queue

defer file.Close() in resource_printer.go
2016-07-27 19:19:34 -07:00
Yu-Ju Hong 03d11bcf4e Add a dockershim package
Add a new docker integration with kubelet using the new runtime API.
This change adds the package with some skeletons, and implements some
of the basic operations.
2016-07-27 18:30:25 -07:00
k8s-merge-robot e008087e0a Merge pull request #29457 from derekwaynecarr/service-node-port-quota-fix
Automatic merge from submit-queue

Quota was not counting services with multiple nodeports properly

```release-note
If a service of type node port declares multiple ports, quota on "services.nodeports" will charge for each port in the service.
```

Fixes https://github.com/kubernetes/kubernetes/issues/29456

/cc @kubernetes/rh-cluster-infra @sdminonne
2016-07-27 18:09:40 -07:00
Lantao Liu 01a5ddd782 Not to use SetWinsize in windows 2016-07-27 17:22:30 -07:00
k8s-merge-robot 75c93b4063 Merge pull request #29439 from matttproud/cleanups_volumeflocker
Automatic merge from submit-queue

volume/flocker: plug time.Ticker resource leak

This commit ensures that `flockerMounter.updateDatasetPrimary` does not leak
running `time.Ticker` instances.  Upon termination of the consuming routine, we
stop the tickers.

```release-note
* flockerMounter.updateDatasetPrimary no longer leaks running time.Ticker instances.
  Upon termination of the consuming routine, we stop the tickers.
```
2016-07-27 17:18:34 -07:00
k8s-merge-robot ab7d039c81 Merge pull request #29388 from ronnielai/image-gc-check
Automatic merge from submit-queue

Avoiding trying to gc images with no tags which are still in use

#29325
2016-07-27 16:44:50 -07:00
k8s-merge-robot 3301f6d14f Merge pull request #29356 from smarterclayton/init_containers
Automatic merge from submit-queue

LimitRanger and PodSecurityPolicy need to check more on init containers

Container limits not applied to init containers. HostPorts not checked on podsecuritypolicy

@pweil- @derekwaynecarr
2016-07-27 16:09:34 -07:00
Paul Morie c884297990 Fix collisions issues / timeouts for mounts
For non-attachable volumes, do not call GetVolumeName on the plugin and instead
generate a unique name based on the identity of the pod and the name of the volume
within the pod.
2016-07-27 17:53:50 -04:00
Yu-Ju Hong 0ac247c6a7 Add kuberuntime.go 2016-07-27 14:34:30 -07:00
k8s-merge-robot e86b3f266c Merge pull request #29641 from ivan4th/fix-configmap-race
Automatic merge from submit-queue

Fix wrapped volume race

**EDIT:** now covers configmap, secret, downwardapi & git_repo volume plugins.

Fixes #29297.

wrappedVolumeSpec used by configMapVolumeMounter and
configMapVolumeUnmounter contained a pointer to api.Volume which was
being patched by NewWrapperMounter/NewWrapperUnmounter, causing race
condition during configmap volume mounts.

See https://github.com/kubernetes/kubernetes/issues/29297#issuecomment-235403806 for complete explanation.
The subtle bug was introduced by #18445, it also can affect other volume plugins utilizing `wrappedVolumeSpec` technique, if this PR is correct/accepted will make more PRs for secrets etc. Although tmpfs variety of inner `emptyDir` volume appears to be less susceptible to this race, there's chance it can fail too.

The errors produced by this race look like this:
```Jul 19 17:05:21 ubuntu1604 kubelet[17097]: I0719 17:05:21.854303   17097 reconciler.go:253] MountVolume operation started for volume "kubernetes.io/configmap/foo-files"
 (spec.Name: "files") to pod "11786582-4dbf-11e6-9fc9-64cca009c636" (UID: "11786582-4dbf-11e6-9fc9-64cca009c636").
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: I0719 17:05:21.854842   17097 reconciler.go:253] MountVolume operation started for volume "kubernetes.io/configmap/bar-file
s" (spec.Name: "files") to pod "117d2c22-4dbf-11e6-9fc9-64cca009c636" (UID: "117d2c22-4dbf-11e6-9fc9-64cca009c636").
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: E0719 17:05:21.860796   17097 configmap.go:171] Error creating atomic writer: stat /var/lib/kubelet/pods/117d2c22-4dbf-11e6-9fc9-64cca009c636/volumes/kubernetes.io~configmap/files: no such file or directory
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: E0719 17:05:21.861070   17097 goroutinemap.go:155] Operation for "kubernetes.io/configmap/bar-files" failed. No retries permitted until 2016-07-19 17:07:21.861036886 +0200 CEST (durationBeforeRetry 2m0s). error: MountVolume.SetUp failed for volume "kubernetes.io/configmap/bar-files" (spec.Name: "files") pod "117d2c22-4dbf-11e6-9fc9-64cca009c636" (UID: "117d2c22-4dbf-11e6-9fc9-64cca009c636") with: stat /var/lib/kubelet/pods/117d2c22-4dbf-11e6-9fc9-64cca009c636/volumes/kubernetes.io~configmap/files: no such file or directory
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: E0719 17:05:21.861271   17097 configmap.go:171] Error creating atomic writer: stat /var/lib/kubelet/pods/11786582-4dbf-11e6-9fc9-64cca009c636/volumes/kubernetes.io~configmap/files: no such file or directory
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: E0719 17:05:21.862284   17097 goroutinemap.go:155] Operation for "kubernetes.io/configmap/foo-files" failed. No retries permitted until 2016-07-19 17:07:21.862275753 +0200 CEST (durationBeforeRetry 2m0s). error: MountVolume.SetUp failed for volume "kubernetes.io/configmap/foo-files" (spec.Name: "files") pod "11786582-4dbf-11e6-9fc9-64cca009c636" (UID: "11786582-4dbf-11e6-9fc9-64cca009c636") with: stat /var/lib/kubelet/pods/11786582-4dbf-11e6-9fc9-64cca009c636/volumes/kubernetes.io~configmap/files: no such file or directory```

Note "Error creating atomic writer" errors.
This problem can be reproduced by making kubelet mount multiple config map volumes in parallel.
2016-07-27 14:24:14 -07:00
Clayton Coleman 958d78cb10
Init container quota is inaccurate
Usage charged should be max of greater of init container or all regular
containers. Also, need to validate init container inputs
2016-07-27 15:44:18 -04:00
Ron Lai 64981aaf46 Avoiding trying to gc images with no tags which are still in use 2016-07-27 10:31:47 -07:00
Mike Danese 792868c743 periodically reload the cni plugin config
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-07-27 10:07:52 -07:00
Avesh Agarwal cb7766de19 Fix kubelet to not accept negative eviction (hard, soft) thresholds
and add unit tests
2016-07-27 10:56:31 -04:00
Clayton Coleman d67187856f
No PetSet client in client/unversioned
Also add fakes
2016-07-27 10:08:58 -04:00
deads2k aa3db4d995 make the resource prefix in etcd configurable for cohabitation 2016-07-27 07:51:40 -04:00
k8s-merge-robot 5b7f7e7bd3 Merge pull request #29365 from lixiaobing10051267/masterLen
Automatic merge from submit-queue

len(vmList) output format not correct

len(vmList) output format not correct, not "%s", is "%d".
2016-07-27 02:41:58 -07:00
Ivan Shvedunov df1e925143 Fix wrapped volume race
This fixes race conditions in configmap, secret, downwardapi & git_repo
volume plugins.
wrappedVolumeSpec vars used by volume mounters and unmounters contained
a pointer to api.Volume structs which were being patched by
NewWrapperMounter/NewWrapperUnmounter, causing race condition during
volume mounts.
2016-07-27 12:24:46 +03:00
k8s-merge-robot d897db4ac5 Merge pull request #28933 from smarterclayton/accept_content_types
Automatic merge from submit-queue

Use response content-type on restclient errors

Also allow a new AcceptContentTypes field to allow the client to ask for
a fallback serialization when getting responses from the server. This
allows a new client to ask for protobuf and JSON, falling back to JSON
when necessary.

The changes to request.go allow error responses from non-JSON servers to
be properly decoded.

@wojtek-t - also alters #28910 slightly (this is better output)
2016-07-26 22:56:53 -07:00
k8s-merge-robot 994239dc00 Merge pull request #28821 from colemickens/azure-cloudprovider-pr
Automatic merge from submit-queue

Add an Azure CloudProvider Implementation

This PR adds `Azure` as a cloudprovider provider for Kubernetes. It specifically adds support for native pod networking (via Azure User Defined Routes) and L4 Load Balancing (via Azure Load Balancers).

I did have to add `clusterName` as a parameter to the `LoadBalancers` methods. This is because Azure only allows one "LoadBalancer" object per set of backend machines. This means a single "LoadBalancer" object must be shared across the cluster. The "LoadBalancer" is named via the `cluster-name` parameter passed to `kube-controller-manager` so as to enable multiple clusters per resource group if the user desires such a configuration.

There are few things that I'm a bit unsure about:

1. The implementation of the `Instances` interface. It's not extensively documented, it's not really clear what the different functions are used for, and my questions on the ML didn't get an answer.

2. Counter to the comments on the `LoadBalancers` Interface, I modify the `api.Service` object in `EnsureLoadBalancerDeleted`, but not with the intention of affecting Kube's view of the Service. I simply do it so that I can remove the `Port`s on the `Service` object and then re-use my reconciliation logic that can handle removing stale/deleted Ports. 

3. The logging is a bit verbose. I'm looking for guidance on the appropriate log level to use for the chattier bits.

Due to the (current) lack of Instance Metadata Service and lack of Virtual Machine Identity in Azure, the user is required to do a few things to opt-in to this provider. These things are called-out as they are in contrast to AWS/GCE:

1. The user must provision an Azure Active Directory ServicePrincipal with `Contributor` level access to the resource group that the cluster is deployed in. This creation process is documented [by Hashicorp](https://www.packer.io/docs/builders/azure-setup.html) or [on the MSDN Blog](https://blogs.msdn.microsoft.com/arsen/2016/05/11/how-to-create-and-test-azure-service-principal-using-azure-cli/).

2. The user must place a JSON file somewhere on each Node that conforms to the `AzureConfig` struct defined in `azure.go`. (This is automatically done in the Azure flavor of [Kubernetes-Anywhere](https://github.com/kubernetes/kubernetes-anywhere).)

3. The user must specify `--cloud-config=/path/to/azure.json` as an option to `kube-apiserver` and `kube-controller-manager` similarly to how the user would need to pass `--cloud-provider=azure`.

I've been running approximately this code for a month and a half. I only encountered one bug which has since been fixed and covered by a unit test. I've just deployed a new cluster (and a Type=LoadBalancer nginx Service) using this code (via `kubernetes-anywhere`) and have posted [the `kube-controller-manager` logs](https://gist.github.com/colemickens/1bf6a26e7ef9484a72a30b1fcf9fc3cb) for anyone who is interested in seeing the logs of the logic.

If you're interested in this PR, you can use the instructions in my [`azure-kubernetes-demo` repository](https://github.com/colemickens/azure-kubernetes-demo) to deploy a cluster with minimal effort via [`kubernetes-anywhere`](https://github.com/kubernetes/kubernetes-anywhere). (There is currently [a pending PR in `kubernetes-anywhere` that is needed](https://github.com/kubernetes/kubernetes-anywhere/pull/172) in conjuncture with this PR). I also have a pre-built `hyperkube` image: `docker.io/colemickens/hyperkube-amd64:v1.4.0-alpha.0-azure`, which will be kept in sync with the branch this PR stems from.

I'm hoping this can land in the Kubernetes 1.4 timeframe.

CC (potential code reviewers from Azure): @ahmetalpbalkan @brendandixon @paulmey

CC (other interested Azure folk): @brendandburns @johngossman @anandramakrishna @jmspring @jimzim

CC (others who've expressed interest): @codefx9 @edevil @thockin @rootfs
2016-07-26 21:56:49 -07:00
k8s-merge-robot d82e404a00 Merge pull request #28351 from sttts/sttts-kubectl-create-quota
Automatic merge from submit-queue

Add support for kubectl create quota command

Follow-up of https://github.com/kubernetes/kubernetes/pull/19625

```
Create a resourcequota with the specified name, hard limits and optional scopes

Usage:
  kubectl create quota NAME [--hard=key1=value1,key2=value2] [--scopes=Scope1,Scope2] [--dry-run=bool] [flags]

Aliases:
  quota, q


Examples:
  // Create a new resourcequota named my-quota
  $ kubectl create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10

  // Create a new resourcequota named best-effort
  $ kubectl create quota best-effort --hard=pods=100 --scopes=BestEffort
```
2016-07-26 21:20:04 -07:00
k8s-merge-robot 5a7b52b8d2 Merge pull request #26942 from xiangpengzhao/fix_testcase
Automatic merge from submit-queue

Fix panic in schema test

If the swagger files for testing are lost, the func `loadSchemaForTest` or `NewSwaggerSchemaFromBytes` will return a non-nil error and a nil schema. In this case, the calling for `ValidateBytes` will result in panic. So, call Fatalf instead of Errorf.

Also fix minor typos.

Test logs:

```
--- FAIL: TestLoad (0.01s)
	schema_test.go:131: Failed to load: open ../../../api/swagger-spec/v1.json: no such file or directory
--- FAIL: TestValidateOk (0.00s)
	schema_test.go:138: Failed to load: open ../../../api/swagger-spec/v1.json: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x4d52df]

goroutine 10 [running]:
panic(0x15fffa0, 0xc8200100a0)
	/usr/local/go/src/runtime/panic.go:481 +0x3e6
testing.tRunner.func1(0xc820085a70)
	/usr/local/go/src/testing/testing.go:467 +0x192
panic(0x15fffa0, 0xc8200100a0)
	/usr/local/go/src/runtime/panic.go:443 +0x4e9
k8s.io/kubernetes/pkg/api/validation.TestValidateOk(0xc820085a70)
	/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/api/validation/schema_test.go:159 +0x79f
testing.tRunner(0xc820085a70, 0x22aad68)
	/usr/local/go/src/testing/testing.go:473 +0x98
created by testing.RunTests
	/usr/local/go/src/testing/testing.go:582 +0x892
FAIL	k8s.io/kubernetes/pkg/api/validation	0.048s
```
2016-07-26 20:35:32 -07:00
k8s-merge-robot ffff1ab63c Merge pull request #28319 from grodrigues3/revert-comments-tLogf
Automatic merge from submit-queue

reverted the code from 23688 that cause race condition with older version of Go

```release-note
* release-note-None
```


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-26 19:56:47 -07:00
lojies 79f09cb687 add shorthand cm for configmaps 2016-07-27 10:54:11 +08:00
lixiaobing10051267 77f133dc84 Func note is copied same as other one
Delete the func note
2016-07-27 10:15:18 +08:00
DongXiugang 418b9c1ca2 fix a wrong word in the comment
the wrong word in this sentence "If msg is empty, a suitable default message with be sent." “with” change to "will".
2016-07-27 09:13:34 +08:00
k8s-merge-robot b8e78b3310 Merge pull request #29558 from janetkuo/deployment-rollover-minreadyseconds-e2e
Automatic merge from submit-queue

Use nonexistent image instead of minReadySeconds in deployment rollover e2e test

Fixes #26834 

@kubernetes/deployment
2016-07-26 15:34:14 -07:00
Cole Mickens 2ebffb431d implement azure cloudprovider 2016-07-26 14:50:33 -07:00
Cole Mickens 6ad9dc659f add clusterName to Loadbalancer methods 2016-07-26 14:50:33 -07:00
Dr. Stefan Schimanski 199f991f6a Add --scopes to kubectl-create-quota and add tests 2016-07-26 14:12:35 +02:00
maaz khan 5b95524d65 Add support for kubectl create quota command 2016-07-26 11:32:08 +02:00
AdoHe 0949e08336 fix kubectl rolling update empty file cause panic issue 2016-07-26 02:37:55 -04:00
Matt T. Proud 76aab29ede pkg/controller/node/nodecontroller: simplify mutex
Similar to #29598, we can rely on the zero-value construction behavior
to embed `sync.Mutex` into parent structs.
2016-07-26 07:06:16 +02:00
Matt T. Proud 4e0a1858f9 pkg/util/goroutinemap: apply idiomatic Go cleanups
Package goroutinemap can be structurally simplified to be more
idiomatic, concise, and free of error potential.  No structural changes
are made.

It is unconventional declare `sync.Mutex` directly as a pointerized
field in a parent structure.  The `sync.Mutex` operates on pointer
receivers of itself; and by relying on that, the types that contain
those fields can be safely constructed using
https://golang.org/ref/spec#The_zero_value.

The duration constants are already of type `time.Duration`, so
re-declaring that is redundant.
2016-07-26 07:00:26 +02:00
Matt T. Proud 5c6292c074 pkg/various: plug leaky time.New{Timer,Ticker}s
According to the documentation for Go package time, `time.Ticker` and
`time.Timer` are uncollectable by garbage collector finalizers.  They
leak until otherwise stopped.  This commit ensures that all remaining
instances are stopped upon departure from their relative scopes.
2016-07-26 06:20:31 +02:00
Ron Lai 5aabeb67b3 Trigger container cleanup within a pod when a container exiting event is detected. 2016-07-25 18:43:49 -07:00
k8s-merge-robot ed3a29bd6a Merge pull request #29581 from Random-Liu/panic-if-cadvisor-not-started
Automatic merge from submit-queue

Kubelet: Fail kubelet if cadvisor is not started.

Fixes https://github.com/kubernetes/kubernetes/issues/28997.

We started cadvisor in `sync.Do()`, which only run once no matter cadvisor successfully starts or not.

Once it fails, kubelet will be stuck in a bad state. Kubelet could never start sync loop because there is an internal error, but kubelet would never retry starting cadvisor again.

This PR just fails kubelet when cadvisor start fails, and then relies on the babysitter to restart kubelet.
In the future, we may want to add backoff logic in the babysitter to protect the system.

On the other hand, https://github.com/kubernetes/kubernetes/pull/29492 will fix cadvisor side to prevent cadvisor failing because of these kind of transient error.

Mark P1 to match the original issue.

@dchen1107 @vishh
2016-07-25 18:29:29 -07:00
Anish Bhatt 531a961a96 Check iscsi iface file for transport name 2016-07-25 18:15:25 -07:00
Random-Liu 973f2fcd86 Fail kubelet if cadvisor is not started. 2016-07-25 16:46:18 -07:00
k8s-merge-robot b4b430bf0d Merge pull request #28833 from tnguyen-rh/fix-docstring
Automatic merge from submit-queue

Fix docstring: Say "flag options" instead of "flag statements"

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-25 16:16:06 -07:00
k8s-merge-robot 4251ebd1eb Merge pull request #29310 from euank/cni-lo
Automatic merge from submit-queue

network/cni: Unconditionally bring up `lo` interface

This is already done in kubenet. This specifically fixes an issue where a kubelet-managed network for the rkt runtime does not have an "UP" lo interface.

Fixes #28561

If this fix doesn't seem right, it could also be implemented by rkt effectively managing two "cni" network plugins, one for the user requested network, one for lo.

Followup CRs can improve unit testing further and then possibly remove the vendor directory logic (which seems like dead code)

cc @kubernetes/sig-rktnetes @kubernetes/sig-network @dcbw
2016-07-25 15:43:21 -07:00
k8s-merge-robot b851e8d699 Merge pull request #29363 from lixiaobing10051267/masterV1
Automatic merge from submit-queue

TestLoadBalancer() test v1 not v2

TestLoadBalancer() should test v1 and TestLoadBalancerV2() test v2, but In TestLoadBalancerV() there are codes:
cfg.LoadBalancer.LBVersion = "v2"
2016-07-25 14:15:27 -07:00
k8s-merge-robot 0354a9027a Merge pull request #29328 from pmorie/kubelet-move
Automatic merge from submit-queue

Extract kubelet node status into separate file

Extract kubelet node status management into a separate file as a continuation of the kubelet code simplification effort.
2016-07-25 13:35:39 -07:00
k8s-merge-robot 84724b789e Merge pull request #29291 from jimmidyson/prometheus-duplicate-labels
Automatic merge from submit-queue

Remove duplicate prometheus metrics

This was a relic from before Kubernetes set Docker labels properly. Cadvisor now properly exposes the Docker labels (e.g. `io.kubernetes.pod.name` as `io_kubernetes_pod_name`, etc) so this is no longer required & actually results in unnecessary duplicate Prometheus labels.
2016-07-25 12:19:55 -07:00
Janet Kuo b45afc04a2 Use nonexistent image instead of minReadySeconds in deployment rollover e2e test 2016-07-25 11:45:46 -07:00
k8s-merge-robot b38271b6d5 Merge pull request #29518 from hongchaodeng/cleanup
Automatic merge from submit-queue

cleanup wrong naming: limitrange -> hpa

The code is in `horizontalpodautoscaler/strategy.go`, but the parameter is "limitrange". This is legacy copy-paste issue...
2016-07-25 11:43:36 -07:00
k8s-merge-robot ad4243f647 Merge pull request #29507 from k82cn/update_node_NewStorage_comments
Automatic merge from submit-queue

Corrected comments of node.NewStorage

Corrected comments of `node.NewStorage`.
2016-07-25 11:43:31 -07:00
k8s-merge-robot c186afd46e Merge pull request #29122 from ronnielai/image-gc-1-1
Automatic merge from submit-queue

Syncing imaging pulling backoff logic

- Syncing the backoff logic in the parallel image puller and the sequential image puller to prepare for merging the two pullers into one.
- Moving image error definitions under kubelet/images
2016-07-25 11:43:22 -07:00
k8s-merge-robot 8bc8cfd131 Merge pull request #29462 from pmorie/package-doc
Automatic merge from submit-queue

Add package docs for pod security policy

Add some go package doc for this because I am an obsessive nerd.

cc @pweil-
2016-07-25 10:58:29 -07:00
k8s-merge-robot ca06157421 Merge pull request #28162 from kargakis/annotation-fixes-for-scaling
Automatic merge from submit-queue

controller: update all rs annotations on a scaled rollout

Closes https://github.com/kubernetes/kubernetes/issues/28145

@kubernetes/deployment
2016-07-25 10:58:18 -07:00
k8s-merge-robot 27bb99d41e Merge pull request #27554 from deads2k/allow-new-groups
Automatic merge from submit-queue

make addition group RESTStorage registration easier

Starts factoring out `RESTStorage` creation to eventually allow for decoupled API group `RESTStorage` configuration.

Right now you can't add additional groups without modifying the main API Group registration in master.go.  Allows the `master.Config` to hold a function that can build a `RESTStorage` based on the `Master` struct.

@lavalamp @caesarxuchao @kubernetes/sig-api-machinery 
@liggitt @smarterclayton
2016-07-25 10:25:30 -07:00
k8s-merge-robot c29f3238ec Merge pull request #26411 from zefciu/b17542
Automatic merge from submit-queue

Validation logic applied to edited file

The file that is submitted via ``edit`` is now subject to validation
logic as any other file. The validation flags were added to the ``edit``
command.

Fixes:  #17542
2016-07-25 09:18:55 -07:00
deads2k 6f7007afc5 make addition group registration easier 2016-07-25 08:23:24 -04:00
lixiaobing10051267 9be345cb8f Log information wrong while wait.ForeverTestTimeout 2016-07-25 17:35:11 +08:00
Hongchao Deng 60d165a830 storage error: precondition failure should return invalid object error 2016-07-24 20:21:42 -07:00
Clayton Coleman 203cf2be6f
Use response content-type on restclient errors
Also allow a new AcceptContentTypes field to allow the client to ask for
a fallback serialization when getting responses from the server. This
allows a new client to ask for protobuf and JSON, falling back to JSON
when necessary.

The changes to request.go allow error responses from non-JSON servers to
be properly decoded.
2016-07-24 12:08:40 -04:00
Hongchao Deng f431d4c209 rename: limitrange -> hpa 2016-07-23 22:10:58 -07:00
k8s-merge-robot 17e31bacbc Merge pull request #29510 from Quentin-M/fix_rkt_dns_perm
Automatic merge from submit-queue

rkt: Fix /etc/hosts /etc/resolv.conf permissions

#29024 introduced copying /etc/hosts and /etc/resolv.conf before mounting them into rkt containers. However, the new files' permissions are set to 0640, which make these files unusable by any other users than root in the container as shown below. This small patch changes the permissions to 0644, as typically set.

```
# host rabbitmq
rabbitmq.default.svc.cluster.local has address 10.3.0.211
# ls -la /etc/resolv.conf
-rw-r-----. 1 root root 102 Jul 23 13:20 /etc/resolv.conf
# sudo -E -u foo bash
$ cat /etc/resolv.conf
cat: /etc/resolv.conf: Permission denied
$ host rabbitmq
;; connection timed out; no servers could be reached
# exit
# chmod 0644 /etc/resolv.conf /etc/hosts
# sudo -E -u foo host rabbitmq
rabbitmq.default.svc.cluster.local has address 10.3.0.211
```

cc @kubernetes/sig-rktnetes @yifan-gu @euank
2016-07-23 12:55:10 -07:00
k8s-merge-robot cbe8cd58a9 Merge pull request #29490 from justinsb/fix_cloudprovider_contract_comments
Automatic merge from submit-queue

Correctly document cloudprovider Instances contract
2016-07-23 11:10:54 -07:00
Quentin Machu 9bf0ae5d78 rkt: Fix /etc/hosts /etc/resolv.conf permissions
This enables any users on the container to resolve DNS, instead of only root.
2016-07-23 13:32:37 +00:00
Klaus Ma 2ee0f69ebd Corrected comments of node.NewStorage 2016-07-23 19:44:55 +08:00
k8s-merge-robot 3e41bc8d6c Merge pull request #29430 from lixiaobing10051267/masterBreak
Automatic merge from submit-queue

To break the loop when object found in removeOrphanFinalizer()

To break the loop when object found in removeOrphanFinalizer()
2016-07-23 01:32:37 -07:00
k8s-merge-robot 696cca21e2 Merge pull request #28813 from xiang90/pv_1
Automatic merge from submit-queue

controller/volume: simplify sync logic in syncBoundClaim

Remove all unnecessary branchings.
2016-07-23 00:51:49 -07:00
k8s-merge-robot 1e7c513824 Merge pull request #29404 from derekwaynecarr/eviction-manager-runtime-dependent
Automatic merge from submit-queue

Eviction manager needs to start as runtime dependent module

To support disk eviction, the eviction manager needs to know if there is a dedicated device for the imagefs.  In order to know that information, we need to start the eviction manager after cadvisor.  This refactors the location eviction manager is started.

/cc @kubernetes/sig-node @kubernetes/rh-cluster-infra @vishh @ronnielai
2016-07-23 00:20:05 -07:00
k8s-merge-robot ce4d73ff1a Merge pull request #29485 from saad-ali/fixIssue29358InstanceNotFound
Automatic merge from submit-queue

Assume volume is detached if node doesn't exist
2016-07-22 23:45:52 -07:00
k8s-merge-robot d525d5345e Merge pull request #29119 from wongma7/pv-gid-squash2
Automatic merge from submit-queue

Allow PVs to specify supplemental GIDs

Retry of https://github.com/kubernetes/kubernetes/pull/28691 . Adds a Kubelet helper function for getting extra supplemental groups
2016-07-22 22:36:51 -07:00
saadali 89fd358c52 Assume volume detached if node doesn't exist
Fixes #29358
2016-07-22 22:07:32 -07:00
k8s-merge-robot 2e53a24889 Merge pull request #29400 from derekwaynecarr/min-reclaim-parse
Automatic merge from submit-queue

Add parsing code in kubelet for eviction-minimum-reclaim

The kubelet parses the eviction-minimum-reclaim flag and validates it for correctness.

The first two commits are from https://github.com/kubernetes/kubernetes/pull/29329 which has already achieved LGTM.
2016-07-22 21:35:35 -07:00
xiangpengzhao 236a225060 defer file.Close() in resource_printer.go 2016-07-22 23:24:01 -04:00
Justin Santa Barbara 29e95431c5 Correctly document cloudprovider Instances contract
The requirement that ExternalID returns InstanceNotFound when the
instance not found was incorrectly documented on InstanceID and
InstanceType.  This requirement arises from the node controller, which
is the only place that checks for the InstanceNotFound error.
2016-07-22 21:59:31 -04:00
k8s-merge-robot 75689dd4d2 Merge pull request #28539 from derekwaynecarr/credential_provider_timeout
Automatic merge from submit-queue

Fix httpclient setup for gcp credential provider to have timeout

The default http client has no timeout.

This could cause problems when not on GCP environments.

This PR changes to use a 10s timeout, and ensures the transport has our normal defaults applied.

/cc @ncdc @liggitt
2016-07-22 18:01:41 -07:00
k8s-merge-robot 63e23a2c75 Merge pull request #28414 from brendandburns/thirdparty
Automatic merge from submit-queue

Allow multiple APIs to register for the same API Group

Fixes https://github.com/kubernetes/kubernetes/issues/23831

@kubernetes/sig-api-machinery 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-22 15:35:00 -07:00
Matthew Wong ae1575b5cc Set extra supplemental groups for rkt 2016-07-22 17:43:24 -04:00
Matthew Wong cbdd121d2d Remove pod mutation for PVs with supplemental GIDs 2016-07-22 17:41:44 -04:00
Euan Kemp 6aed2a0b1d network/cni: Search `vendorDir` for lo plugin too
Though frankly the vendor dir thing should probably be removed in a
followup PR.
2016-07-22 14:40:44 -07:00
Euan Kemp 8f7b5bcfd3 network/cni: Always setup 'lo'
See issue #28561
2016-07-22 14:40:35 -07:00
Chao Xu 5d6b671d49 make CertificateSigningRequestList.Items a required field 2016-07-22 13:19:48 -07:00
k8s-merge-robot df2cf16ddb Merge pull request #26709 from hodovska/master
Automatic merge from submit-queue

Allow shareable resources for admission control plugins.

Changes allow admission control plugins to share resources. This is done via new PluginInitialization structure. The structure can be extended for other resources, for now it is an shared informer for namespace plugins (NamespiceLifecycle, NamespaceAutoProvisioning, NamespaceExists).

If a plugins needs some kind of shared resource e.g. client, the client shall be added to PluginInitializer and Wants methods implemented to every plugin which will use it.
2016-07-22 11:07:05 -07:00
derekwaynecarr 305411b59b Fix bug in node port counting in quota not counting multi-node ports 2016-07-22 13:56:55 -04:00
Paul Morie 66e7257a81 Add package docs for pod security policy 2016-07-22 13:35:37 -04:00
k8s-merge-robot e9e774cfb4 Merge pull request #28431 from brendandburns/thirdparty2
Automatic merge from submit-queue

Fix a problem with multiple APIs clobbering each other in registration.

Fixes https://github.com/kubernetes/kubernetes/issues/24392

@kubernetes/sig-api-machinery 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-22 09:41:58 -07:00
k8s-merge-robot c5abb90c2f Merge pull request #29329 from derekwaynecarr/min-reclaim-flag
Automatic merge from submit-queue

Add kubelet flag for eviction-minimum-reclaim

This is taken from #27199 as its the most burdensome to rebase and should have little disagreement.

/cc @vishh @ronnielai PTAL
2016-07-22 09:08:43 -07:00
derekwaynecarr 3e75f2effb Eviction manager needs to start as runtime dependent module 2016-07-22 10:19:40 -04:00
k8s-merge-robot ba51b6b977 Merge pull request #29300 from janetkuo/kubectl-set-image-record-patch
Automatic merge from submit-queue

Use patch when recording commands in kubectl set image

1. Use `Patch` to mitigate update conflict. See http://stackoverflow.com/questions/38476531/kubernetes-kubectl-set-image-deployment-not-able-to-record-history
2. Return warning instead of error when fail to record command

@kubernetes/kubectl
2016-07-22 06:00:15 -07:00
k8s-merge-robot e2fb251c2a Merge pull request #29266 from xiangpengzhao/fix_defer_close
Automatic merge from submit-queue

Add f.Close() for applyOOMScoreAdj
2016-07-22 05:24:28 -07:00
k8s-merge-robot 60e59c9461 Merge pull request #29184 from wojtek-t/rs_controller_ref
Automatic merge from submit-queue

ReplicaSet controller can set/remove ControllerRef

This is mostly a copy from https://github.com/kubernetes/kubernetes/pull/27600
2016-07-22 04:18:00 -07:00
k8s-merge-robot e562ce54b1 Merge pull request #29026 from runcom/user-in-cri
Automatic merge from submit-queue

CRI: add LinuxUser to LinuxContainerConfig

Following discussion in https://github.com/kubernetes/kubernetes/pull/25899#discussion_r70996068

The Container Runtime Interface should provide runtimes with User information to run the container process as (OCI being one of them).
This patch introduces a new field `user` into `LinuxContainerConfig` structure. The `user` field introduces also a new type structure `LinuxUser` which consists of `uid`, `gid` and `additional_gids`. 

The `LinuxUser` struct has been embedded into `LinuxContainerConfig` to leave space for future implementations which are not Linux-related (e.g. Windows may have a different representation of _Users_).

If you feel naming can be better we can probably move `LinuxUser` to `UnixUser` also. 

/cc @mrunalp @vishh @euank @yujuhong 

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-07-22 03:11:56 -07:00
k8s-merge-robot bf817a3830 Merge pull request #26939 from zhouhaibing089/healthz-fix
Automatic merge from submit-queue

fixes the usage doc in package healthz

Briefly, the comments in `pkg/healthz/doc.go` is not correct.
2016-07-22 02:39:11 -07:00
k8s-merge-robot 835ee70c45 Merge pull request #28909 from foxish/foxish-issue-28785
Automatic merge from submit-queue

Create event only if creation of PVC failed.

Fixes #28785.
We should report an event only if the petset can't find a PVC and can't create it either.

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-22 02:39:06 -07:00
k8s-merge-robot 2f96bc2b15 Merge pull request #29240 from dhawal55/fix_volume_mounting
Automatic merge from submit-queue

NewVolumeManager expects nodeName instead of hostName.
2016-07-22 01:13:52 -07:00
Wojciech Tyczynski 33e612e101 Revert "cacher.go: embed storage.Interface into cacher" 2016-07-22 07:28:45 +02:00
Paul Morie 249da77371 Extract kubelet node status into separate file 2016-07-22 01:21:30 -04:00
k8s-merge-robot 480e8a30ef Merge pull request #29316 from ronnielai/docker-image-remove
Automatic merge from submit-queue

Removing images with multiple tags

If an image has multiple tags, we need to remove all the tags in order to make docker image removing successful.

#28491
2016-07-21 17:47:17 -07:00
k8s-merge-robot 4694a6dd71 Merge pull request #24797 from screeley44/vols_debug_mkfs
Automatic merge from submit-queue

add enhanced volume and mount logging for block devices

Fixes #24568 

Adding better logging and debugging for block device volumes and the shared SafeFormatAndMount (aws, gce, flex, rbd, cinder, etc...)
2016-07-21 17:12:33 -07:00
Janet Kuo 623a97c685 Use patch when recording commands in kubectl set image 2016-07-21 15:33:34 -07:00
Ron Lai e25da21503 Clear tags to remove images with multiple tags 2016-07-21 14:14:32 -07:00
k8s-merge-robot 223d1cf836 Merge pull request #29367 from k82cn/rm_empty_line
Automatic merge from submit-queue

Removed unnecessary empty line.
2016-07-21 14:08:18 -07:00