@Extension public class Reaper extends ComputerListener implements io.fabric8.kubernetes.client.Watcher<io.fabric8.kubernetes.api.model.Pod>
KubernetesSlave
and ensures the node is removed from Jenkins too.
If the pod has been deleted, all of the associated state (running user processes, workspace, etc.) must also be gone;
so there is no point in retaining this agent definition any further.
(KubernetesSlave
is not an EphemeralNode
: it does support running across Jenkins restarts.)
Note that pod retention policies other than the default Never
may disable this system,
unless some external process or garbage collection policy results in pod deletion.
io.fabric8.kubernetes.client.Watcher.Action
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
Reaper() |
Modifier and Type | Method and Description |
---|---|
void |
eventReceived(io.fabric8.kubernetes.client.Watcher.Action action,
io.fabric8.kubernetes.api.model.Pod pod) |
void |
onClose(io.fabric8.kubernetes.client.KubernetesClientException cause) |
void |
onOnline(Computer c,
TaskListener listener) |
all, onConfigurationChange, onLaunchFailure, onOffline, onOffline, onOnline, onTemporarilyOffline, onTemporarilyOnline, preLaunch, preOnline, register, unregister
public void onOnline(Computer c, TaskListener listener) throws IOException, InterruptedException
onOnline
in class ComputerListener
IOException
InterruptedException
public void eventReceived(io.fabric8.kubernetes.client.Watcher.Action action, io.fabric8.kubernetes.api.model.Pod pod)
eventReceived
in interface io.fabric8.kubernetes.client.Watcher<io.fabric8.kubernetes.api.model.Pod>
public void onClose(io.fabric8.kubernetes.client.KubernetesClientException cause)
onClose
in interface io.fabric8.kubernetes.client.Watcher<io.fabric8.kubernetes.api.model.Pod>
Copyright © 2016–2019. All rights reserved.