helm install stable/kong --name kong --namespace kong --values https://bit.ly/2RgSRio --version 0.9.0
To check status: watch -n 1 kubectl get pod -n kong
kubectl --namespace kong port-forward $(kubectl get pods --namespace kong -l "app=kong" -o jsonpath="{.items[1].metadata.name}") 8000 &
kubectl apply -f https://gist.githubusercontent.com/hbagdi/2d8ef66fe22cb99e1514f410f992268d/raw/a03d789b70c46ccd0b99d9f1ed838dc21419fc33/multiple-services.yaml
echo "apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: strip-path
route:
strip_path: true
" | kubectl apply -f -
and
echo "apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
configuration.konghq.com: strip-path
name: sample-ingresses
spec:
rules:
- http:
paths:
- path: /billing
backend:
serviceName: billing
servicePort: 80
- path: /comments
backend:
serviceName: comments
servicePort: 80
- path: /invoice
backend:
serviceName: invoice
servicePort: 80" | kubectl apply -f -
curl -i http://localhost:8000/billing/status/200
and some fake traffic
while true;
do
curl http://localhost:8000/billing/status/200
curl http://localhost:8000/billing/status/501
curl http://localhost:8000/billing/status/501
curl http://localhost:8000/invoice/status/201
curl http://localhost:8000/invoice/status/404
curl http://localhost:8000/comments/status/200
sleep 0.01
done
helm install --name prometheus stable/prometheus --namespace monitoring --values https://bit.ly/2RgzDtg --version 8.4.1
helm install stable/grafana --name grafana --namespace monitoring --values http://bit.ly/2FuFVfV --version 1.22.1
kubectl --namespace monitoring port-forward $(kubectl get pods --namespace monitoring -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}") 9090 &
and expose Grafana:
kubectl --namespace monitoring port-forward $(kubectl get pods --namespace monitoring -l "app=grafana" -o jsonpath="{.items[0].metadata.name}") 3000 &
kubectl get secret --namespace monitoring grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
echo "apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
labels:
global: \"true\"
name: prometheus
plugin: prometheus
" | kubectl apply -f -
And let's check the charts! We have to manually re-import the Kong grafana dashboard
kubectl create -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/all-in-one/jaeger-all-in-one-template.yml --namespace monitoring
minikube service jaeger-query -n monitoring
echo "apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
labels:
global: \"true\"
name: zipkin
plugin: zipkin
config:
sample_ratio: 1.0
http_endpoint: http://zipkin.monitoring.svc.cluster.local:9411/api/v2/spans
" | kubectl apply -f -