Commit Graph

45 Commits (a5ff573263822767eb7f072963c35915e67c0ec0)

Author SHA1 Message Date
goltermann 32d569d6c7 Fixing all the "composite literal uses unkeyed fields" Vet errors. 2016-03-25 15:25:09 -07:00
goltermann 34d4eaea08 Fixing several (but not all) go vet errors. Most are around string formatting, or unreachable code. 2016-03-22 17:26:50 -07:00
harry b0900bf0d4 Refactor diff into sub pkg 2016-03-21 20:21:39 +08:00
Yu-Ju Hong 0264ebdda1 kubelet: force status update when the deletion timestamp is set 2016-03-03 16:24:56 -08:00
Tim St. Clair 7b6d843309 Move test-only files to test-only packages 2016-03-01 09:11:32 -08:00
Yu-Ju Hong 866c52c8a9 kubelet: fix duplicated status updates at pod cleanup
cleanupTerminatedPods is responsible for checking whether a pod has been
terminated and force a status update to trigger the pod deletion. However, this
function is called in the periodic clenup routine, which runs every 2 seconds.
In other words, it forces a status update for each non-running (and not yet
deleted in the apiserver) pod. When batch deleting tens of pods, the rate of
new updates surpasses what the status manager can handle, causing numerous
redundant requests (and the status channel to be full).

This change forces a status update only when detecting the DeletionTimestamp is
set for a terminated pod. Note that for other non-terminated pods, the pod
workers should be responsible for setting the correct status after killling all
the containers.
2016-02-28 13:20:40 -08:00
Fabio Yeon a56a315d99 Revert "kubelet: fix duplicated status updates at pod cleanup" 2016-02-26 14:39:11 -08:00
Yu-Ju Hong 99587b7e3a kubelet: fix duplicated status updates at pod cleanup
cleanupTerminatedPods is responsible for checking whether a pod has been
terminated and force a status update to trigger the pod deletion. However, this
function is called in the periodic clenup routine, which runs every 2 seconds.
In other words, it forces a status update for each non-running (and not yet
deleted in the apiserver) pod. When batch deleting tens of pods, the rate of
new updates surpasses what the status manager can handle, causing numerous
redundant requests (and the status channel to be full).

This change forces a status update only when detecting the DeletionTimestamp is
set for a terminated pod. Note that for other non-terminated pods, the pod
workers should be responsible for setting the correct status after killling all
the containers.
2016-02-24 21:23:41 -08:00
Tim St. Clair 15d44d182a Fix possible data race in prober 2016-02-22 10:27:57 -08:00
Wojciech Tyczynski 93a0eac476 Revert "kubelet: fix duplicated status updates at pod cleanup" 2016-02-22 14:27:49 +01:00
k8s-merge-robot 6716344d24 Merge pull request #21438 from yujuhong/terminated_pods
Auto commit by PR queue bot
2016-02-22 03:05:01 -08:00
k8s-merge-robot eb45154996 Merge pull request #21348 from caesarxuchao/generate-fake-for-1-2
Auto commit by PR queue bot
2016-02-18 23:02:05 -08:00
Yu-Ju Hong 386453a09d kubelet: fix duplicated status updates at pod cleanup
cleanupTerminatedPods is responsible for checking whether a pod has been
terminated and force a status update to trigger the pod deletion. However, this
function is called in the periodic clenup routine, which runs every 2 seconds.
In other words, it forces a status update for each non-running (and not yet
deleted in the apiserver) pod. When batch deleting tens of pods, the rate of
new updates surpasses what the status manager can handle, causing numerous
redundant requests (and the status channel to be full).

This change forces a status update only when detecting the DeletionTimestamp is
set for a terminated pod. Note that for other non-terminated pods, the pod
workers should be responsible for setting the correct status after killling all
the containers.
2016-02-18 11:01:01 -08:00
k8s-merge-robot f0b56409cc Merge pull request #21197 from yujuhong/deleted_pod
Auto commit by PR queue bot
2016-02-18 01:02:40 -08:00
Chao Xu ad46715f51 generate fake client for release_1_2 2016-02-17 16:10:02 -08:00
Yu-Ju Hong 3072754c8b Avoid unnecessary GET request when updating pod status
When sending out an pod status update, kubelet

GETs the pod from the apiserver
Terminates if the apiserver returns an not found error; otherwise, proceed to
to update.
Even after a pod has been deleted, there might still be queued up updates for
the pod. This leads to expensive, unncessary GET operations. The situation is
worse when there are batch creation/deletion of a significant number of pods
(e.g., E2E tests), leaving many updates in the queue.

This change checks whether a pod exists before GET the pod from the apiserver
to avoid redundant GETs.
2016-02-12 14:59:18 -08:00
Lantao Liu 77b6f14f86 Change pod in probe update to pod uid. 2016-02-12 05:02:31 +00:00
Jan Chaloupka 4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
Chao Xu 184440f8ef rename release_1_2 to internalclientset 2016-02-05 14:02:28 -08:00
Chao Xu 1b047f8e67 rename legacy to core 2016-02-04 14:26:56 -08:00
Chao Xu f9f5736b01 grep sed 2016-02-03 13:06:07 -08:00
Chao Xu cddd7b56a4 replace client with clientset in kubelet and other places 2016-02-02 20:28:45 -08:00
Yu-Ju Hong f1535a0d4c Don't handle graceful deletion of mirror pods in status manager 2016-01-19 16:47:57 -08:00
Lantao Liu 4c37dbe6e6 Merge pull request #19690 from Random-Liu/fix-bug-in-status-test
Fix bug in status/manager_test.go
2016-01-18 01:15:16 -08:00
k8s-merge-robot 0051dcc83e Merge pull request #19560 from Random-Liu/format-reconcile-log
Auto commit by PR queue bot
2016-01-17 04:51:05 -08:00
Random-Liu 8fb056d258 Add getTestPod() to avoid sharing object among test cases 2016-01-15 11:22:15 -08:00
Random-Liu fed61731f1 Fix bug in needsReconcile 2016-01-14 13:44:02 -08:00
Random-Liu acb74454dc Format reconcile log with format.Pod(pod) 2016-01-12 12:03:16 -08:00
Random-Liu 5b4a210d49 Add reconcile support in kubelet 2016-01-10 01:35:07 -08:00
deads2k 9fda7f1812 update StatusDetails to handle Groups 2015-12-17 09:14:12 -05:00
k8s-merge-robot 073661514e Merge pull request #18129 from yujuhong/fix_status
Auto commit by PR queue bot
2015-12-10 03:35:33 -08:00
Tim St. Clair 2430454eea Update PodReady condition when updating container readiness 2015-12-04 15:40:33 -08:00
Yu-Ju Hong c8a075ad62 Do not delete pod status entry when apiserver returns NotFound error
The logic doesn't apply to static pods as their corresponding mirror pod may
not have been created yet, or may be in the process of recreation. Deleting the
pod status immediately resets the version of the status for the static pod,
while the apiStatusVersion remains unchanged. This could lead to incorrect
versioning and hence stale pod status in the apiserver.
2015-12-03 13:11:48 -08:00
Yu-Ju Hong a4816b3bcb Make kublet/util/format.go a separate package
The formatting function is used often in logging. This improves the readability
by shortening the length of the call. Also change the fomartted string to
include the pod UID.
2015-12-03 12:47:36 -08:00
Tim St. Clair d2532b50ce Correct backwards pod mappings
The mapping of static pod <--> mirror pod UIDs was backwards in a couple
places. Fortunately, they canceled each other out. Fixed, and added a
test case.
2015-11-24 18:32:44 -08:00
Tim St. Clair a1960b0a21 More detailed logging of pod status updates. 2015-11-24 10:48:28 -08:00
Tim St. Clair fbc5a7d034 Sync status to new mirror pods 2015-11-13 18:09:17 -08:00
Tim St. Clair 67cfed5bf3 Don't wait for sync to update readiness
Push status updates as soon as readiness state changes for containers,
rather than waiting for the sync loop to update the status. In
particular, this should help new containers to come online faster.

Additionally, consolidates prober test helpers into a single file.
2015-11-10 14:00:12 -08:00
Tim St. Clair 858126b42a Clean up static/mirror pod status logic
- status.Manager always deals with the local (static) pod, but gets the
  mirror pod when syncing
  - This lets components like the probe workers ignore mirror pods
2015-11-04 11:42:25 -08:00
Tim St. Clair 9a2089adc8 Concurrency fixes in status.Manager
- Fix deadlock when syncing deleted pods with full update channel
- Prevent sending stale updates to API server
- Don't delete cached status when sync fails (causes problems for prober)
2015-10-28 17:40:55 -07:00
eulerzgy ea86e66fbe Del capatical local packagename for kubeletUtil 2015-10-15 09:58:10 +08:00
Yu-Ju Hong a3e60cc32e Rename imported package local name kubeletTypes to kubetypes
According to the naming guidelines, package name should not include mixedCaps.
2015-10-09 10:24:31 -07:00
nikhiljindal b99d225d19 Setting PodReadyCondition.LastTransitionTime 2015-09-29 17:23:32 -07:00
Daniel Martí 586cb9126a Move pkg/util.Time to pkg/api/unversioned.Time
Along with our time.Duration wrapper, as suggested by @lavalamp.
2015-09-17 17:51:27 -07:00
Tim St. Clair 1f91fffb57 Move kubelet.statusManager to status.Manager
This refactor is in preparation for moving more state handling to the
status manager. It will become the canonical cache for the latest
information on running containers and probe status, as part of the
prober refactoring.
2015-09-11 12:22:01 -07:00