Commit 159f919a authored by Geoff Simmons's avatar Geoff Simmons

Empty response bodies for readiness and configured checks.

Update comments and fix up whitespace while we're here.
parent ba45234c
...@@ -5,12 +5,18 @@ include "bogo_backend.vcl"; ...@@ -5,12 +5,18 @@ include "bogo_backend.vcl";
sub vcl_recv { sub vcl_recv {
if (local.socket == "k8s") { if (local.socket == "k8s") {
if (req.url == "/ready") { if (req.url == "/ready") {
return (synth(200)); return (synth(65200));
} }
return (synth(404)); return (synth(65404));
} }
if (local.socket == "vk8s_cfg") { if (local.socket == "vk8s_cfg") {
return (vcl(vk8s_readiness)); return (vcl(vk8s_readiness));
} }
return (vcl(vk8s_regular)); return (vcl(vk8s_regular));
} }
sub vcl_synth {
if (resp.status == 65200 || resp.status == 65404) {
return (deliver);
}
}
...@@ -3,7 +3,13 @@ vcl 4.1; ...@@ -3,7 +3,13 @@ vcl 4.1;
include "bogo_backend.vcl"; include "bogo_backend.vcl";
# Send a synthetic response with status 503 to every request. # Send a synthetic response with status 503 to every request.
# Used for the readiness check and regular traffic when Varnish is not ready. # Used for the configured check and regular traffic when Varnish is
# not configured to implement an Ingress.
sub vcl_recv { sub vcl_recv {
return(synth(503)); return(synth(503));
}
# Empty response body.
sub vcl_synth {
return (deliver);
} }
...@@ -3,7 +3,13 @@ vcl 4.1; ...@@ -3,7 +3,13 @@ vcl 4.1;
include "bogo_backend.vcl"; include "bogo_backend.vcl";
# Send a synthetic response with status 200 to every request. # Send a synthetic response with status 200 to every request.
# Used for the readiness check when Varnish is ready. # Used for the configured check when Varnish is configured to implement
# an Ingress.
sub vcl_recv { sub vcl_recv {
return(synth(200)); return(synth(200));
}
# Empty response body.
sub vcl_synth {
return (deliver);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment