Commit f0bea38c authored by Geoff Simmons's avatar Geoff Simmons

Add the chapter "Varnish as Ingress" to the front-page README.

parent acab22f8
......@@ -90,3 +90,47 @@ $ go get -d github.com/slimhazard/gogitversion
$ cd $GOPATH/src/github.com/slimhazard/gogitversion
$ make install
```
# Varnish as a Kubernetes Ingress
Since this project is currently in its early stages, the implementation of
Ingress definitions for a Varnish instance is subject to change as development
continues. Presently, an Ingress is realized by loading a
[VCL](https://varnish-cache.org/docs/trunk/reference/vcl.html) configuration
that:
* defines
[directors](https://varnish-cache.org/docs/trunk/users-guide/vcl-backends.html#directors)
that correspond to Services mentioned in the Ingress definition
* This is currently hard-wired as the round-robin director.
* defines
[backends](https://varnish-cache.org/docs/trunk/users-guide/vcl-backends.html)
corresponding to the Endpoints of the Services. These are assigned to the
director defined for the Service.
* Endpoint definitions for a Service are obtained from an API query
when the VCL configuration is generated, so that the assignments
of Endpoints is current at VCL generation time.
* The Varnish backend definitions currently only include the Endpoints'
IP addresses and ports. There is presently no means to define other
features of a backend, such as health checks and timeouts.
* generates VCL code to implement the routing of requests to backends
based on the Host header and/or URL path according to the IngressRules
given in the Ingress definition.
* Varnish may cache responses according to its default rules for
caching, and of course cache hits are delivered without routing the
requests further.
* In case of a non-cache-hit (miss or pass), the Host header and/or
URL path is evaluated according to the IngressRules, and matching
requests are assigned to the director corresponding to the matched
Service.
* The director in turn chooses a backend corresponding to an Endpoint
according to its load balancing algorithm (currently only round-robin).
* If the request does not match any Service according to the
IngressRules, then:
* If a default Backend (a Service) was defined in the IngressSpec,
then the request is assigned to the corresponding director.
* Otherwise, a synthetic 404 Not Found response is generated by
Varnish.
* If there is no valid Ingress definition (none has been defined
since the Varnish instance started, or the only valid definition
was deleted), then Varnish generates a synthetic 404 Not Found
response for every request.
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