I am trying to use proxy-cache plugin with kong ingress controller.
I have installed kong ingress controller using:
kubectl apply -f https://bit.ly/kong-ingress-dbless
as stated int the docs. I’m using my minikube (minikube version: v1.0.1)
I have installed the plugin like this:
echo "
apiVersion: configuration.konghq.com/v1
config:
request_method: GET
cache_ttl: 300
cache_control: false
strategy: memory
content_type: text/plain; charset=UTF-8
kind: KongPlugin
metadata:
name: proxy-cache
namespace: default
plugin: proxy-cache
" | kubectl apply -f -
I have created a sample deployment:
kubectl apply -f https://bit.ly/echo-service
service/echo created
deployment.apps/echo created
and setup an ingress with proper annotation:
echo "
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
plugins.konghq.com: proxy-cache
name: demo
spec:
rules:
- http:
paths:
- path: /foo
backend:
serviceName: httpbin
servicePort: 80
- path: /bar
backend:
serviceName: echo
servicePort: 80
" | kubectl apply -f -
When I call I always get X-Cache-Status: Bypass
curl -i $PROXY_IP/foo
…
HTTP/1.1 200 OK
Content-Type: text/plain; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Cache-Key: b233ea72899e5d984d2d01d92874cb0d
X-Cache-Status: Bypass
Date: Thu, 20 Feb 2020 16:41:51 GMT
Server: echoserver
X-Kong-Upstream-Latency: 1
X-Kong-Proxy-Latency: 0
Via: kong/1.4.3
…
Any help appreciated