Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Enable agent restart without impacting running services #63

Merged
merged 6 commits into from
Feb 22, 2021

Conversation

soenkeliebau
Copy link
Member

Change dependency on Krustlet to use our fork, which skips draining pods when shutting down.

Draining all pods on agent shudown would mean stopping all services that are managed by the agent, which is not feasible for our scenario.

Also added check during startup whether the service is already up and running, if it is already running we don't start it again.

fixes #24

…ods when shutting down.

Draining all pods on agent shudown would mean stopping all services that are managed by the agent, which is not feasible for our scenario.

Also added check during startup whether the service is already up and running, if it is already running we don't start it again.
@soenkeliebau soenkeliebau requested a review from a team February 18, 2021 13:30
@lfrancke lfrancke self-assigned this Feb 18, 2021
lfrancke
lfrancke previously approved these changes Feb 18, 2021
Copy link
Member

@lfrancke lfrancke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one real comment. I'll leave it up to you.

Cargo.toml Outdated
@@ -8,8 +8,8 @@ edition = "2018"
# We are currently referencing the Krustlet directly from the repository, because some features that we are using have
# (exponential backoff most prominently) have not yet been included in a release
# We will look to move this to officially released versions as soon as possible
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe update this comment?
To say why we reference a fork.

@@ -20,6 +20,28 @@ impl State<PodState> for Starting {
async fn next(self: Box<Self>, pod_state: &mut PodState, _: &Pod) -> Transition<PodState> {
if let Some(systemd_units) = &pod_state.service_units {
for unit in systemd_units {
match pod_state.systemd_manager.is_running(&unit.get_name()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate that this is basically a copy from below but I don't know a better way right now either...

@soenkeliebau soenkeliebau merged commit 44ef77f into main Feb 22, 2021
@soenkeliebau soenkeliebau deleted the pod_eviction branch February 22, 2021 09:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement graceful handling of agent restart
2 participants