Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/minghsu0107/k8s-varnish-nginx
This repository domonstrates how to deploy Varnish, a high-performance caching HTTP reverse proxy, on Kubernetes.
https://github.com/minghsu0107/k8s-varnish-nginx
caching kubernetes varnish
Last synced: 5 days ago
JSON representation
This repository domonstrates how to deploy Varnish, a high-performance caching HTTP reverse proxy, on Kubernetes.
- Host: GitHub
- URL: https://github.com/minghsu0107/k8s-varnish-nginx
- Owner: minghsu0107
- Created: 2022-07-11T09:17:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-11T09:25:10.000Z (over 2 years ago)
- Last Synced: 2024-10-29T18:25:18.367Z (about 2 months ago)
- Topics: caching, kubernetes, varnish
- Language: VCL
- Homepage:
- Size: 7.81 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# k8s-varnish-nginx
This repository domonstrates how to deploy Varnish, a high-performance caching HTTP reverse proxy, on Kubernetes.
## Deployment
Apply manifests:
```bash
kustomize build manifests | kubectl apply -f -
```
## Testing
Open port-forward to varnish service:
```bash
kubectl -n demo port-forward svc/varnish 8008:80
```
Test whether caching works:
```bash
curl -v http://localhost:8008
```
Example of a successful response:
```
* Trying 127.0.0.1:8008...
* Connected to localhost (127.0.0.1) port 8008 (#0)
> GET / HTTP/1.1
> Host: localhost:8008
> User-Agent: curl/7.79.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Mon, 11 Jul 2022 09:03:33 GMT
< Content-Type: text/html
< Content-Length: 615
< Last-Modified: Mon, 23 May 2022 23:59:19 GMT
< ETag: "628c1fd7-267"
< Age: 21
< Accept-Ranges: bytes
< X-Cache-Hits: 3
< X-Cache: cached
< Connection: keep-alive
<Welcome to nginx!
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }Welcome to nginx!
If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.For online documentation and support please refer to
nginx.org.
Commercial support is available at
nginx.com.Thank you for using nginx.
* Connection #0 to host localhost left intact
```
We can see that Varnish has cached the Nginx welcome page for us, resulting in `X-Cache: cached` and `X-Cache-Hits: 3`.