Commit Graph

3134 Commits (1c72ba68109e0d4fcc4fe7283a193a75f4832a5b)

Author SHA1 Message Date
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 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
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
Ron Lai 64981aaf46 Avoiding trying to gc images with no tags which are still in use 2016-07-27 10:31:47 -07:00
Random-Liu 973f2fcd86 Fail kubelet if cadvisor is not started. 2016-07-25 16:46:18 -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 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
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
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
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 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
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
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
derekwaynecarr 3e75f2effb Eviction manager needs to start as runtime dependent module 2016-07-22 10:19:40 -04: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 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
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
Ron Lai e25da21503 Clear tags to remove images with multiple tags 2016-07-21 14:14:32 -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
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
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
Dhawal Patel 93fb8c93c9 Fixes #28643. Pass nodeName to VolumeManager instead of hostName. 2016-07-20 23:03:56 -07: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
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
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
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
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
Random Liu 51184db4df Set PruneChildren when removing image. 2016-07-20 02:07:28 +00:00
Michael Taufen 1e13b9b2de Remove duplicate code 2016-07-19 14:51:25 -07:00
Paul Morie d9ffcace6a Move ExtractPodBandwidthResources test into appropriate package 2016-07-19 14:34:08 -04: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
Euan Kemp 13dca52f3c kubelet: Log new pod ips 2016-07-19 09:09:00 -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 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
Euan Kemp fec83a9e28 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
2016-07-18 23:29:27 -07:00
k8s-merge-robot 3786701280 Merge pull request #28865 from ronnielai/image-gc-0
Automatic merge from submit-queue

Moving event.go from kubelet/container to kubelet/events
2016-07-18 22:54:03 -07:00