-
Notifications
You must be signed in to change notification settings - Fork 38.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP/MESOS: handle slave-lost and REASON_SLAVE_REMOVED events #21366
Closed
jdef
wants to merge
12
commits into
kubernetes:master
from
mesosphere-backup:jdef_slave_lost_cleanup
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d1ef7f3
first pass at implementing cleanup when slave-lost message is receive…
fefaf18
shorter default suicide timeout; static pod source should send blank …
379a582
remove dependency on kubelet finished, executor shutdown uses simple …
1dd5e3f
change log.Error to log.Info for state transition edge case in reregi…
81d764c
add node condition for running-executor
2067590
fix broken unit test
d5d47d8
refactored filtering interface
620108b
add timestamped executor container UUID annotation to all pods
05f7486
refactor StatusUpdater into a more general node controller scaffold w…
bc2bf76
update reason code for nodes with out of date conditions
debd9bf
started implementation of a new controller
2d04f31
implemented first half of pod cleanup alg
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,10 @@ limitations under the License. | |
package service | ||
|
||
import ( | ||
log "github.com/golang/glog" | ||
// log "github.com/golang/glog" | ||
"k8s.io/kubernetes/pkg/kubelet" | ||
kubetypes "k8s.io/kubernetes/pkg/kubelet/types" | ||
"k8s.io/kubernetes/pkg/util/runtime" | ||
// "k8s.io/kubernetes/pkg/util/runtime" | ||
"k8s.io/kubernetes/pkg/util/wait" | ||
) | ||
|
||
|
@@ -35,50 +35,53 @@ type executorKubelet struct { | |
// Run runs the main kubelet loop, closing the kubeletFinished chan when the | ||
// loop exits. Like the upstream Run, it will never return. | ||
func (kl *executorKubelet) Run(mergedUpdates <-chan kubetypes.PodUpdate) { | ||
defer func() { | ||
// When this Run function is called, we close it here. | ||
// Otherwise, KubeletExecutorServer.runKubelet will. | ||
close(kl.kubeletDone) | ||
runtime.HandleCrash() | ||
log.Infoln("kubelet run terminated") //TODO(jdef) turn down verbosity | ||
// important: never return! this is in our contract | ||
select {} | ||
}() | ||
wait.Until(func() { kl.Kubelet.Run(mergedUpdates) }, 0, kl.executorDone) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. get rid of this entirely |
||
/* | ||
defer func() { | ||
// When this Run function is called, we close it here. | ||
// Otherwise, KubeletExecutorServer.runKubelet will. | ||
close(kl.kubeletDone) | ||
runtime.HandleCrash() | ||
log.Infoln("kubelet run terminated") //TODO(jdef) turn down verbosity | ||
// important: never return! this is in our contract | ||
select {} | ||
}() | ||
|
||
// push merged updates into another, closable update channel which is closed | ||
// when the executor shuts down. | ||
closableUpdates := make(chan kubetypes.PodUpdate) | ||
go func() { | ||
// closing closableUpdates will cause our patched kubelet's syncLoop() to exit | ||
defer close(closableUpdates) | ||
pipeLoop: | ||
for { | ||
select { | ||
case <-kl.executorDone: | ||
break pipeLoop | ||
default: | ||
// push merged updates into another, closable update channel which is closed | ||
// when the executor shuts down. | ||
closableUpdates := make(chan kubetypes.PodUpdate) | ||
go func() { | ||
// closing closableUpdates will cause our patched kubelet's syncLoop() to exit | ||
defer close(closableUpdates) | ||
pipeLoop: | ||
for { | ||
select { | ||
case u := <-mergedUpdates: | ||
case <-kl.executorDone: | ||
break pipeLoop | ||
default: | ||
select { | ||
case closableUpdates <- u: // noop | ||
case u := <-mergedUpdates: | ||
select { | ||
case closableUpdates <- u: // noop | ||
case <-kl.executorDone: | ||
break pipeLoop | ||
} | ||
case <-kl.executorDone: | ||
break pipeLoop | ||
} | ||
case <-kl.executorDone: | ||
break pipeLoop | ||
} | ||
} | ||
} | ||
}() | ||
}() | ||
|
||
// we expect that Run() will complete after closableUpdates is closed and the | ||
// kubelet's syncLoop() has finished processing its backlog, which hopefully | ||
// will not take very long. Peeking into the future (current k8s master) it | ||
// seems that the backlog has grown from 1 to 50 -- this may negatively impact | ||
// us going forward, time will tell. | ||
wait.Until(func() { kl.Kubelet.Run(closableUpdates) }, 0, kl.executorDone) | ||
// we expect that Run() will complete after closableUpdates is closed and the | ||
// kubelet's syncLoop() has finished processing its backlog, which hopefully | ||
// will not take very long. Peeking into the future (current k8s master) it | ||
// seems that the backlog has grown from 1 to 50 -- this may negatively impact | ||
// us going forward, time will tell. | ||
wait.Until(func() { kl.Kubelet.Run(closableUpdates) }, 0, kl.executorDone) | ||
|
||
//TODO(jdef) revisit this if/when executor failover lands | ||
// Force kubelet to delete all pods. | ||
kl.HandlePodDeletions(kl.GetPods()) | ||
//TODO(jdef) revisit this if/when executor failover lands | ||
// Force kubelet to delete all pods. | ||
kl.HandlePodDeletions(kl.GetPods()) | ||
*/ | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented package imports