def on_container_die(exit_code: )
      cancel_restart_timers
      return unless @service_pod.running?

      # backoff restarts
      backoff = @restarts ** 2
      backoff = max_restart_backoff if backoff > max_restart_backoff
      info "#{@service_pod} exited with code #{exit_code}, restarting (delay: #{backoff}s)"

      log_service_pod_event("service:instance_crash",
        "service #{@service_pod} instance exited with code #{exit_code}, restarting (delay: #{backoff}s)",
        Logger::WARN
      )

      ts = Time.now.utc
      @restarts += 1
      @restart_backoff_timer = after(backoff) {
        debug "restart triggered (from #{ts})"
        apply
      }
    end
def on_container_die(exit_code: )
      cancel_restart_timers
      return unless @service_pod.running?

      # backoff restarts
      backoff = @restarts ** 2
      backoff = max_restart_backoff if backoff > max_restart_backoff
      info "#{@service_pod} exited with code #{exit_code}, restarting (delay: #{backoff}s)"

      log_service_pod_event("service:instance_crash",
        "service #{@service_pod} instance exited with code #{exit_code}, restarting (delay: #{backoff}s)",
        Logger::WARN
      )

      ts = Time.now.utc
      @restarts += 1
      @restart_backoff_timer = after(backoff) {
        debug "restart triggered (from #{ts})"
        apply
      }
    end
Handles events when container has died