Hai probe, hai hành vi
Readiness trả lời “có nhận traffic không?”; fail readiness loại endpoint nhưng không tự restart container. Liveness trả lời “process có cần restart không?”; fail liên tiếp có thể restart. Probe phải kiểm tra contract nhẹ, local và ổn định; không nhồi dependency/DB nặng vào liveness.
Timing là design
Đặt initial delay/period/timeout/failure threshold theo startup và detection budget; ghi expected window. Sai path/port/status, app bind localhost hoặc endpoint có side effect tạo false fail. Sau test kiểm tra conditions, EndpointSlice, events, logs và restart count.
Bài tập
Dựng HTTP liveness/readiness khác nhau, mô phỏng path/port/status/slow failure, đo traffic/restart behavior, chỉnh timing và tạo variant. Restore valid probe, verify ổn định và cleanup.