It might be good to put RestartPolicy structure to CreateContainerRequest / UpdateContainerRequest:
message RestartPolicy {
RestartCondition condition = 1; // "none", "on-failure", (and "any" if needed)
Duration Delay = 2;
int64 MaxAttempts = 3;
}
I guess this is useful for linuxkit, cc linuxkit maintainers @ijc25 @justincormack @riyazdf @rneugeba
@AkihiroSuda Don't think we should do this in containerd. This could be done by the higher level system.
Not sure if we would use it in LinuxKit - either containers can define their own restarts, or possibly we might add external restart support. But generally I find restart fairly useless, as things that fail normally fail again, and restart rarely helps.
-1 restart policy seems like a job of a higher level component.
Consider a cluster orchestrator that will just reschedule the container.
No, this is part of the fundamental design of containerd that it does not handle things like this and provides events and other primitives for higher levels to implement restarts or rescheduling logic.
If you have any questions about overall design and where we positioned containerd in the stack please send me and email or on slack and I'll help you understand better.
Most helpful comment
-1 restart policy seems like a job of a higher level component.
Consider a cluster orchestrator that will just reschedule the container.