After three successful responses, the app crashes with an exception. This allows us to simulate a case where the app starts running correctly but after some time it starts failing. We’ve pushed this buggy image to Docker Hub by using the following commands:
xxxxxxxxxx
require "sinatra"
set :bind, "0.0.0.0"
$counter = 0
get "*" do
$counter += 1
if $counter > 3
raise "Whoops, something is wrong"
end
"[buggy] Hello, Kubernetes!\n"
end