Commit Graph

13830 Commits (63602348a46dae777038be34470c0d7d025420fe)

Author SHA1 Message Date
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
k8s-merge-robot 2c490945e8 Merge pull request #28758 from xiang90/clean_service
Automatic merge from submit-queue

controller/service: minor cleanup

1. always handle short case first for if statement

2. do not capitalize error message

3. put the mutex before the fields it protects

4. prefer switch over if elseif.
2016-07-21 14:08:14 -07:00
derekwaynecarr 2f4a4ea4cf Kubelet parses and validates eviction-minimum-reclaim flag 2016-07-21 16:46:12 -04:00
k8s-merge-robot 0ff40f3a19 Merge pull request #29103 from xiangpengzhao/fix_if_conditions
Automatic merge from submit-queue

Fix incorrect if conditions

When the current conditions `if inspect == nil && inspect.Config == nil && inspect.Config.Labels == nil` is true, the func containerAndPodFromLabels will return. else will not. Suppose `inspect != nil` but `inspect.Config == nil`, the current conditions will be false and the func won't return, then the below `labels := inspect.Config.Labels` will lead to panic.
2016-07-21 12:25:10 -07:00
xiangpengzhao 91d11ed703 Add f.Close() for applyOOMScoreAdj 2016-07-21 13:07:30 -04:00
k8s-merge-robot 42a1deeff3 Merge pull request #26861 from xiang90/embed
Automatic merge from submit-queue

cacher.go: embed storage.Interface into cacher

Continuous effort to simplify cacher implementation.
2016-07-21 09:50:19 -07:00
lixiaobing10051267 57eabf2b7e Garbagecollector.go 2016-07-21 22:31:08 +08:00
k8s-merge-robot 1cf3f1cf03 Merge pull request #29237 from ncdc/fixup-windows-term
Automatic merge from submit-queue

Fix Windows terminal handling

Fix some issues with Windows terminal handling with respect to TTYs that came up as part of the
code that adds support for terminal resizing.

cc @smarterclayton @sttts @csrwng
2016-07-21 07:24:13 -07:00
derekwaynecarr d6e23b984c Add codegen artifacts for kubelet flag 2016-07-21 10:06:17 -04:00
derekwaynecarr 99bddd23c4 Add eviction minimum reclaim option to kubelet 2016-07-21 10:06:17 -04:00
k8s-merge-robot 0b1f0e8353 Merge pull request #29234 from mtaufen/doublecode-volume-newmainkubelet
Automatic merge from submit-queue

Remove duplicate code

I think this code is wrongly duplicated. See #29233. Feel free to correct me if I am wrong.
2016-07-21 06:48:51 -07:00
Scott Creeley 11d1289afa Add volume and mount logging 2016-07-21 09:10:00 -04:00
k8s-merge-robot ac17b239b6 Merge pull request #29145 from yifan-gu/no_chtime
Automatic merge from submit-queue

rkt: Don't return if the service file doesn't exist when killing the pod

Remove an unused logic. Also this prevents the KillPod() from failing
when the service file doesn't exist. E.g., it can be removed by garbage
collection in a rare case:

1, There are already more than `gcPolicy.MaxContainers` containers running
   on the host.
2, The new pod(A) starts to run but doesn't enter 'RUNNING' state yet.
3, GC is triggered, and it sees the pod(A) is in an inactive state (not running),
   and the it needs to remove the pod to force the `gcPolicy.MaxContainers`.
4, GC fails to remove the pod because `rkt rm` fails when the pod is running,
   but it removes the service file anyway.
5, Follow up KillPod() call will fail because it cannot find the service file
   on disk.

Also this is possible only when the pod has been in prepared state for longer
than 1 min, which sounds like another issue.

cc @kubernetes/sig-rktnetes
2016-07-21 05:20:15 -07:00
Dominika Hodovska 037d116add Factory for SharedIndexInformers 2016-07-21 14:04:48 +02:00
k8s-merge-robot f4543250a8 Merge pull request #29133 from deads2k/priority-queue
Automatic merge from submit-queue

use a separate queue for initial quota calculation

When the quota controller gets backed up on resyncs, it can take a long time to observe the first usage stats which are needed by the admission plugin.  This creates a second queue to prioritize the initial calculation.
2016-07-21 04:46:59 -07:00
Klaus Ma d0c67d8fee Removed unnecessary empty line. 2016-07-21 18:07:36 +08:00
Wojciech Tyczynski 85de930a66 ReplicaSet controller can set/remove ControllerRef 2016-07-21 11:36:52 +02:00
lixiaobing10051267 0e8dd302d1 len(vmList) output format not correct 2016-07-21 16:57:37 +08:00
Wojciech Tyczynski 4d0d115690 Revert "add tokenreviews endpoint to implement webhook" 2016-07-21 09:40:35 +02:00
lixiaobing10051267 54341caa87 TestLoadBalancer() test v1 not v2 2016-07-21 15:30:37 +08:00
k8s-merge-robot f8fd8046e7 Merge pull request #29275 from wojtek-t/rs_shared_pod_informer
Automatic merge from submit-queue

Use sharedPodInformer in ReplicaSet controller

@caesarxuchao
2016-07-21 00:05:01 -07:00
k8s-merge-robot 1784e99a1d Merge pull request #29102 from ping035627/ping035627-patch-0719
Automatic merge from submit-queue

Optimise getAPIGroupVersion function in genericapiserver.go

About the newAPIGroupVersion and the getAPIGroupVersion function  in genericapiserver.go, I think they can optimise.
2016-07-20 23:31:17 -07:00
Dhawal Patel 93fb8c93c9 Fixes #28643. Pass nodeName to VolumeManager instead of hostName. 2016-07-20 23:03:56 -07:00
k8s-merge-robot 165add8692 Merge pull request #29034 from ivan4th/fix-init-container-update-validation
Automatic merge from submit-queue

Fix init container update validation for pods

Partial fix #26840

The remaining issues with `kubectl apply` on pods with init containers
are caused by temporary annotation-based representation and
will resolve themselves once init containers leave alpha state.
Also, this PR makes sure internal and external objects don't get mixed up by the
PATCH handler (see related issue #25106).

This PR is an alternative for #28557 which met criticism from @smarterclayton 
and @liggitt for working around the temporary issue with annotations.
#28557 is a full fix for #26840 and contains an e2e test that cannot pass
without the `VolumeMounts` workaround. As there appears to be no
good way to include an e2e test that's known to be failing in k8s source,
I've removed it from this PR.

Either this PR or #28557 should be applied, but not both.
2016-07-20 22:56:00 -07:00
k8s-merge-robot 8ead63f127 Merge pull request #28788 from deads2k/wire-authentication
Automatic merge from submit-queue

add tokenreviews endpoint to implement webhook

Wires up an API resource under `apis/authentication.k8s.io/v1beta1` to expose the webhook token authentication API as an API resource.  This allows one API server to use another for authentication and uses existing policy engines for the "authoritative" API server to controller access to the endpoint.

@cjcullen you wrote the initial type
2016-07-20 22:23:45 -07:00
k8s-merge-robot 99e24da2ff Merge pull request #29077 from saad-ali/fixIssue29051NamespaceDeletion
Automatic merge from submit-queue

Fix "PVC Volume not detached if pod deleted via namespace deletion" issue

Fixes #29051: "PVC Volume not detached if pod deleted via namespace deletion"

This PR:
* Fixes a bug in `desired_state_of_the_world_populator.go` to check the value of `exists` returned by the `podInformer` so that it can delete pods even if the delete event is missed (or fails).
* Reduces the desired state of the world populators sleep period from 5 min to 1 min (reducing the amount of time a volume would remain attached if a volume delete event is missed or fails).
2016-07-20 20:40:32 -07:00
Clayton Coleman affd79fdc0
InitContainers are not checked for hostPort ranges
PodSecurityPolicy must verify that host port ranges are guarded on init
containers.
2016-07-20 23:19:34 -04:00
xiangpengzhao c51346e5cc Fix incorrect if conditions and add test case 2016-07-20 20:50:02 -04:00
k8s-merge-robot 4379619a63 Merge pull request #28939 from saad-ali/fixIssue28616ParallelMount
Automatic merge from submit-queue

Allow mounts to run in parallel for non-attachable volumes

This PR:
* Fixes https://github.com/kubernetes/kubernetes/issues/28616
  * Enables mount volume operations to run in parallel for non-attachable volume plugins.
  * Enables unmount volume operations to run in parallel for all volume plugins.
* Renames `GoRoutineMap` to `GoroutineMap`, resolving a long outstanding request from @thockin: `"Goroutine" is a noun`
2016-07-20 14:56:58 -07:00
Ron Lai ee4822e476 Moving image pulling errors under kubelet/images 2016-07-20 14:20:53 -07:00
Ron Lai 7500d706ad sync backoff logic 2016-07-20 14:20:53 -07:00
Michail Kargakis 62afa3de71 controller: update all rs annotations on a scaled rollout
When a new rollout with a different size than the previous size of the
deployment is initiated then only the new replica set will notice the
new size. Old replica sets are not updated by the rollout path.
2016-07-20 22:40:43 +02:00
k8s-merge-robot afe4977c9b Merge pull request #28975 from ronnielai/image-gc-1
Automatic merge from submit-queue

ImagePuller refactoring

A plain refactoring
- Moving image pullers to a new pkg/kubelet/images directory
- Hiding image pullers inside the new ImageManager 

The next step is to consolidate the logic of the serialized and the parallel image pullers inside ImageManager

xref: #25577
2016-07-20 13:37:48 -07:00
k8s-merge-robot e2a697db47 Merge pull request #29246 from Random-Liu/fix-image-remove-bug
Automatic merge from submit-queue

Kubelet: Set PruneChildren when removing image.

This is a bug introduced during switching to engine-api. https://github.com/kubernetes/kubernetes/issues/23563.

When removing image, there is an option `noprune`:
```
If prune is true, ancestor images will each attempt to be deleted quietly.
```

In go-dockerclient, the default value of the option is ["noprune=false"](https://github.com/fsouza/go-dockerclient/blob/master/image.go#L171), which means that ancestor images should be also removed. This is the expected behaviour.

However in engine-api, the option is changed to `PruneChildren`, and the default value is `PruneChildren=false`, which means that ancestor images won't be removed.
This makes `ImageRemove` only remove the first layer of the image, which causes the image garbage collection not working as expected.

This should be fixed in 1.3.
And thanks to @ronnielai for finding the bug! :)

/cc @kubernetes/sig-node
2016-07-20 12:59:53 -07:00
k8s-merge-robot c0557a6b66 Merge pull request #29171 from euank/determine-container-ip-args
Automatic merge from submit-queue

docker_manager: Correct determineContainerIP args

This could result in the network plugin not retrieving the pod ip in a
call to SyncPod when using the `exec` network plugin.
The CNI and kubenet network plugins ignore the name/namespace arguments,
so they are not impacted by this bug.

I verified the second included test failed prior to correcting the
argument order.

Fixes #29161 

cc @yujuhong
2016-07-20 12:26:37 -07:00
deads2k 2256c6e619 fix String protobuf generator 2016-07-20 15:11:57 -04:00
deads2k 2c4a9f2e8d interesting changes to add tokenreviews endpoint to implement webhook 2016-07-20 15:11:56 -04:00
deads2k bfa2ff00b9 generated code changes 2016-07-20 15:11:56 -04:00
k8s-merge-robot c09956e13f Merge pull request #29215 from ericchiang/http-probe-checker-test-dont-sr-compare-errors
Automatic merge from submit-queue

pkg/probe/http: don't compare error strings in tests

TestHTTPProbeChecker fails on the Go1.7 release candidates. The
package's history show that this was the case for Go1.5 and Go1.6
as well.

The test depend on errors holding specific string values, behavior
not guarenteed in the standard library API, and causing new test
failures every minor Go release. Just look for an error rather than
trying to inspect it using string comparison. If we feel this
impacts coverage we can add more test cases.

Fixes #15952
2016-07-20 11:51:52 -07:00
k8s-merge-robot 1ecd4efce6 Merge pull request #29169 from kevinjkj/kevinjkj-patch-4
Automatic merge from submit-queue

Add defer

Add defer?
2016-07-20 11:51:47 -07:00
k8s-merge-robot 8043baf12d Merge pull request #29071 from albatross0/fix_rbac_for_serviceaccounts
Automatic merge from submit-queue

Fix RBAC authorizer of ServiceAccount

RBAC authorizer assigns a role to a wrong service account.

How to reproduce

1.Create role and rolebinding to allow default user in kube-system namespace to read secrets in kube-system namespace.

```
# kubectl create -f role.yaml
# kubectl create -f binding.yaml
```

```yaml
# role.yaml
kind: Role
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: secret-reader
  namespace: kube-system
rules:
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["get", "watch", "list"]
    nonResourceURLs: []
```

```yaml
# binding.yaml
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name: read-secrets
  namespace: kube-system
subjects:
  - kind: ServiceAccount
    name: default
    namespace: kube-system
roleRef:
  kind: Role
  namespace: kube-system
  name: secret-reader
  apiVersion: rbac.authorization.k8s.io/v1alpha1
```

2.Set a credential of default user

```
$ kubectl config set-credentials default_user --token=<token_of_system:serviceaccount:kube-system:default>
$ kubectl config set-context default_user-context --cluster=test-cluster --user=default_user
$ kubectl config use-context default_user-context
```

3.Try to get secrets as default user in kube-system namespace

```
$ kubectl --namespace=kube-system get secrets
the server does not allow access to the requested resource (get secrets)
```

As shown above, default user could not access to secrets.
But if I have kube-system user in default namespace, it is allowed access to secrets.


4.Create a service account and try to get secrets as kube-system user in default namespace

```
# kubectl --namespace=default create serviceaccount kube-system
serviceaccount "kube-system" created
$ kubectl config set-credentials kube-system_user --token=<token_of_system:serviceaccount:default:kube-system>
$ kubectl config set-context kube-system_user-context --cluster=test-cluster --user=kube-system_user
$ kubectl config use-context kube-system_user-context
$ kubectl --namespace=kube-system get secrets
NAME                  TYPE                                  DATA      AGE
default-token-8pyb3   kubernetes.io/service-account-token   3         4d

```
2016-07-20 11:51:42 -07:00
k8s-merge-robot 10211f4df2 Merge pull request #29268 from lixiaobing10051267/masterExpected2
Automatic merge from submit-queue

Information is opposite to real meaning to express

master is not equal to expectedMaster, the meaning should be the master is unexpected:
	master, err := mesosCloud.Master(clusterName)
	if master != expectedMaster {
		t.Fatalf("Master returns the expected value: (expected: %#v, actual: %#v", expectedMaster, master)
2016-07-20 11:11:51 -07:00
k8s-merge-robot a0da4153b6 Merge pull request #29260 from lixiaobing10051267/masterErr
Automatic merge from submit-queue

Modify err output format from %s to %v

t.Errorf err output format should be %v
2016-07-20 11:11:46 -07:00
k8s-merge-robot 60f9ce8a41 Merge pull request #29253 from lixiaobing10051267/masterLBname
Automatic merge from submit-queue

format number not consistent with real variable number

glog.Infof format number not consistent with real variable number, should add %s for second var because loadBalancerName is string:
func (c *Cloud) ensureLoadBalancer(namespacedName types.NamespacedName, loadBalancerName string, ...
2016-07-20 11:11:42 -07:00
k8s-merge-robot 6df62ff39c Merge pull request #29162 from xiangpengzhao/fix_err_to_cerr
Automatic merge from submit-queue

Fix wrong variable of error

Should not log `err` but `cerr`.
2016-07-20 11:11:33 -07:00
k8s-merge-robot 7620ed4b52 Merge pull request #28963 from cdrage/better-warning-kubecontroller
Automatic merge from submit-queue

Warn when missing cloud-provider on kube controller
2016-07-20 11:11:23 -07:00
Andy Goldstein 77b0547b3d Fix Windows terminal handling
Fix some issues with Windows terminal handling with respect to TTYs that came up as part of the
code that adds support for terminal resizing.
2016-07-20 13:37:14 -04:00
k8s-merge-robot a0a0760027 Merge pull request #25307 from derekwaynecarr/set_uid_from_context
Automatic merge from submit-queue

Allow handlers earlier in a request flow to inject a UID for an object

This lets admission controllers specify a stable UID for an object prior to its creation.  That lets the admission controller then record a reference to the object on another resource using that stable UID prior to the object being created.  This would be a prerequisite for supporting quota reservations.

/cc @smarterclayton @lavalamp @deads2k
2016-07-20 09:58:51 -07:00
albatross0 d1b14e2fae Fix RBAC authorizer of ServiceAccount
RBAC authorizer assigns a role to a wrong service account.
2016-07-21 01:50:08 +09:00
Ron Lai 367a683273 Wrapping image pullers inside ImageManager 2016-07-20 09:47:11 -07:00
Ron Lai 56b9daf50f Moving image pullers to images directory 2016-07-20 09:47:11 -07:00
Jimmi Dyson 21231e1e83
Remove duplicate prometheus metrics 2016-07-20 16:00:21 +01:00
Timothy St. Clair 8cb799c789 Revert "Follow on for 1.4 to default HTTP2 on by default"
This reverts commit efe25553cd.
2016-07-20 08:47:15 -05:00
Dominika Hodovska ba40a528e1 PluginInitializer as a new part of NewFromPlugins method 2016-07-20 12:53:52 +02:00
Dominika Hodovska fc0a3c6dcb Allow shareable resources for admission control plugins 2016-07-20 12:53:52 +02:00
Wojciech Tyczynski 2794cf538c Use sharedPodInformer in ReplicaSet controller 2016-07-20 12:25:26 +02:00
lixiaobing10051267 025135de6a Information is opposite to real meaning to express 2016-07-20 16:54:19 +08:00
saadali afd8a58e5c Reduce DSW populator sleep period from 5 min to 1 2016-07-20 01:03:04 -07:00
saadali d210c2231f Check pod exist in attach controller DSW populator
Fix bug in desired_state_of_the_world_populator.go to check exists so
that it can delete pods even if the delete event is missed (or fails)
2016-07-20 01:03:04 -07:00
lixiaobing10051267 e3bff25dbb Modify err output format from %s to %v 2016-07-20 15:06:47 +08:00
k8s-merge-robot ad7ececcd0 Merge pull request #28765 from nhlfr/api-proxy-regex
Automatic merge from submit-queue

Make "attach" and "exec" rejection in proxy more explicit

```release-note
kubectl proxy changed to now allow urls to pods with "attach" or "exec" in the pod name
```

The more explicit regular expression for rejection makes a possibility of accessing pods (or any other resources) which contain "attach" or "exec" in their names via proxy API. It was not possible before.

Also, the reference for "run" resource was removed, because it doesn't exist in any of k8s APIs currently.

Fixes: #21464
2016-07-19 23:06:58 -07:00
k8s-merge-robot 8c84fae03e Merge pull request #28701 from pmorie/bandwidth-test
Automatic merge from submit-queue

Move ExtractPodBandwidthResources test into appropriate package

Found during #28511, this test is in the wrong package currently.

cc @kubernetes/sig-network
2016-07-19 21:57:30 -07:00
saadali 88d495026d Allow mounts to run in parallel for non-attachable
Allow mount volume operations to run in parallel for non-attachable
volume plugins.

Allow unmount volume operations to run in parallel for all volume
plugins.
2016-07-19 21:54:26 -07:00
k8s-merge-robot a3110dcb41 Merge pull request #28417 from kevensen/awszonefix
Automatic merge from submit-queue

AWS: Added experimental option to skip zone check

This pull request resolves #28380.  In the vast majority of cases, it is appropriate to validate the AWS region against a known set of regions.  However, there is the edge case where this is undesirable as Kubernetes may be deployed in an AWS-like environment where the region is not one of the known regions.

By adding the optional **DisableStrictZoneCheck true** to the **[Global]** section in the aws.conf file (e.g. /etc/aws/aws.conf) one can bypass the ragion validation.
2016-07-19 21:03:28 -07:00
lixiaobing10051267 6de7bc0085 format number not consistent with real variable number 2016-07-20 11:14:45 +08:00
k8s-merge-robot 411c32bc98 Merge pull request #27520 from olegshaldybin/format-apiserver-options
Automatic merge from submit-queue

Format apiserver options

Trivial change, code formatting only: it was hard to read long lines, and my editor was really slow when scrolling through them.
2016-07-19 19:58:01 -07:00
Random Liu 51184db4df Set PruneChildren when removing image. 2016-07-20 02:07:28 +00:00
k8s-merge-robot a279673de6 Merge pull request #25764 from gtank/certificates-api-controller-v3
Automatic merge from submit-queue

Certificate signing controller for TLS bootstrap (alpha)

The controller handles generating and signing certificates when a CertificateSigningRequest has the "Approved" condition. Uses cfssl to support a wide set of possible keys and algorithms. Depends on PR #25562, only the last two commits are relevant to this PR.

cc @mikedanese

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-19 18:45:31 -07:00
k8s-merge-robot a95180e06f Merge pull request #29228 from janetkuo/available-time-log
Automatic merge from submit-queue

Log the time when checking deployment's pod availability

https://github.com/kubernetes/kubernetes/issues/26834#issuecomment-233764007
2016-07-19 17:35:45 -07:00
PingWang 4daea70ad7 Optimise getAPIGroupVersion function in genericapiserver.go
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

gofmt -s -w

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-20 08:17:36 +08:00
Michael Taufen 1e13b9b2de Remove duplicate code 2016-07-19 14:51:25 -07:00
Ivan Shvedunov 02baa44948 Fix update validation for pods w/init containers. 2016-07-20 00:30:12 +03:00
Janet Kuo 07d25fdc47 Log the time when checking deployment's pod availability 2016-07-19 14:08:28 -07:00
k8s-merge-robot 9ada26d6cd Merge pull request #29219 from caesarxuchao/fix-testeventf
Automatic merge from submit-queue

Don't do string(int)

This is causing https://github.com/kubernetes/kubernetes/pull/29147 to fail the unit test, because the bug prints control character to the test log, and the grep at this [line](https://github.com/kubernetes/kubernetes/blob/master/hack/make-rules/test.sh#L190) returns `Binary file (standard input) matches` error. I don't know why this bug isn't caught before.
2016-07-19 14:06:57 -07:00
Kenneth D. Evensen d69fe11c09
Fixing gofmt errors 2016-07-19 16:50:55 -04:00
derekwaynecarr 09bac89aff Add support to quota pvc storage requests 2016-07-19 16:08:49 -04:00
Michal Rostecki 3ed9768a51 Make "attach" and "exec" rejection in proxy more explicit
The more explicit regular expression for rejection makes a
possibility of accessing pods (or any other resources) which
contain "attach" or "exec" in their names via proxy API. It
was not possible before.

Also, the reference for "run" resource was removed, because
it doesn't exist in any of k8s APIs currently.

Fixes: #21464
2016-07-19 20:50:19 +02:00
Chao Xu 99d8868c7c don't use string(index) 2016-07-19 11:41:16 -07:00
Paul Morie d9ffcace6a Move ExtractPodBandwidthResources test into appropriate package 2016-07-19 14:34:08 -04:00
George Tankersley 9e45f62fc3 codegen: update componentconfig 2016-07-19 11:25:38 -07:00
George Tankersley 803c7ac299 certificates: implement certificates controller 2016-07-19 11:25:38 -07:00
Eric Chiang a1b310e004 pkg/probe/http: don't compare error strings in tests
TestHTTPProbeChecker fails on the Go1.7 release candidates. The
package's history show that this was the case for Go1.5 and Go1.6
as well.

The test depend on errors holding specific string values, behavior
not guarenteed in the standard library API, and causing new test
failures every minor Go release. Just look for an error rather than
trying to inspect it using string comparison. If we feel this
impacts coverage we can add more test cases.
2016-07-19 11:13:36 -07:00
k8s-merge-robot 1c5af3e72f Merge pull request #29209 from dims/fix-glog-log-with-formatting
Automatic merge from submit-queue

Use Infof/Warningf when appropriate

When we use a format string, we should use Infof/Warningf instead
of Info/Warning
2016-07-19 10:41:26 -07:00
k8s-merge-robot 1014b35065 Merge pull request #29125 from mwielgus/extra-debug-hpa
Automatic merge from submit-queue

Extra debug information in HPA events

Fixes: #29004
2016-07-19 10:41:09 -07:00
k8s-merge-robot 372fb5cd5f Merge pull request #29085 from xiangpengzhao/delete_redundant_case
Automatic merge from submit-queue

Delete redundant if condition

The case `containerStatus == nil` has already been checked just above. It's redundant here.
2016-07-19 10:41:04 -07:00
deads2k 2ea342289e use a separate queue for initial quota calculation 2016-07-19 13:38:39 -04:00
Davanum Srinivas ee8507a5ae Use Infof/Warningf when appropriate
When we use a format string, we should use Infof/Warningf instead
of Info/Warning
2016-07-19 12:10:53 -04:00
Euan Kemp 13dca52f3c kubelet: Log new pod ips 2016-07-19 09:09:00 -07:00
k8s-merge-robot d9fbb9f600 Merge pull request #29188 from mfojtik/retry-on-update
Automatic merge from submit-queue

Retry updating deployment only on update conflict error
2016-07-19 08:46:50 -07:00
Marcin Wielgus 75b91ff972 Extra debug information in HPA events 2016-07-19 17:00:45 +02:00
k8s-merge-robot 73a3d48dc8 Merge pull request #29196 from lixiaobing10051267/masterDiskName
Automatic merge from submit-queue

glog.Warning output content not complete, lack of string fomat "%s"
2016-07-19 07:31:24 -07:00
k8s-merge-robot d4d83adf85 Merge pull request #29191 from wojtek-t/extend_gce_logging
Automatic merge from submit-queue

Extend logging for GCE load balancer creation

For #29189 debugging.
2016-07-19 06:54:53 -07:00
k8s-merge-robot 0e9ac96368 Merge pull request #29134 from derekwaynecarr/quota_improvement
Automatic merge from submit-queue

Improve quota controller performance by eliminating unneeded list calls

Previously, when syncing quota usage, we asked each registered `Evaluator` to determine the usage it knows to track associated with a `GroupKind` even if that particular `GroupKind` had no associated resources under quota.

This fix makes it that when we sync a quota that just had only `Pod` related compute resources, we do not also calculate the usage stats for things like `ConfigMap`, `Secret`, etc. per quota.

This should be a significant performance gain when running large numbers of `Namespace`'s each with `ResourceQuota` that tracks a subset of resources.

/cc @deads2k @kubernetes/rh-cluster-infra
2016-07-19 06:54:48 -07:00
lixiaobing10051267 1a01308356 glog.Warning output content not complete, lack of string fomat "%s" 2016-07-19 20:35:52 +08:00
Wojciech Tyczynski 84f7ceb80a Extend logging for GCE load balancer creation 2016-07-19 13:38:51 +02:00
k8s-merge-robot 8c6336b12a Merge pull request #29101 from gmarek/allocator2
Automatic merge from submit-queue

Retry assigning CIDRs

Fix #28879, ref #29064

cc @bgrant0607 @bprashanth @alex-mohr
2016-07-19 04:35:23 -07:00
Michal Fojtik 3095437300 Retry updating deployment only on update conflict error 2016-07-19 13:01:06 +02:00
k8s-merge-robot 1026eecc9d Merge pull request #26012 from sitepod/third-party-resource-list-json-fix
Automatic merge from submit-queue

include metadata in third party resource list serialization

Third party resource listing does not include important metadata such as resourceVersion and apiVersion. This commit includes the missing metadata and also replaces the string templating with an anonymous struct.
2016-07-19 04:00:34 -07:00
k8s-merge-robot 0bfaae16a0 Merge pull request #29118 from xiangpengzhao/fix_reversed_var_order
Automatic merge from submit-queue

Fix reversed order of variables

The order of variables in log is reversed.
2016-07-19 02:52:25 -07:00
k8s-merge-robot be8abdabf8 Merge pull request #27157 from soltysh/scheduledjob_test_2
Automatic merge from submit-queue

Scheduledjob test cont.

This continuation of #25737.

@erictune @caesarxuchao ptal

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-19 02:52:19 -07:00
k8s-merge-robot 6c1675a5cd Merge pull request #29080 from Random-Liu/continue-cleanup-despite-of-error
Automatic merge from submit-queue

Make kubelet continue cleanup when there is noncritical error.

Fix https://github.com/kubernetes/kubernetes/issues/29078.

Even though there is error when cleaning up pod directory or bandwidth limits, kubelet could continue cleanup the following stuff.
However, when runtime cache or runtime returns error, cleanup should fail, because the following cleanup relies on the `runningPod`.

@yujuhong 
/cc @kubernetes/sig-node
2016-07-19 01:43:29 -07:00