-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathkong.yaml
52 lines (40 loc) · 1018 Bytes
/
kong.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Install Kong
$ kubectl apply -f https://bit.ly/k4k8s
# Add Label to NS
$ kubectl annotate ns kong kuma.io/sidecar-injection=enabled
# Trigger sidecar
$ kubectl delete pod --all -n kong
# Add Ingress Rule
echo "apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: demo-ingress
namespace: kuma-demo
annotations:
kubernetes.io/ingress.class: kong
konghq.com/strip-path: 'true'
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: demo-app
servicePort: 5000" | kubectl apply -f -
# Find Ingress Address
minikube service -n kong kong-proxy --url | head -1
# And consume!
# You can also apply some plugins, like rate-limiting
# (applied globally in this example)
echo "apiVersion: configuration.konghq.com/v1
kind: KongClusterPlugin
metadata:
name: global-rate-limiting
annotations:
kubernetes.io/ingress.class: kong
labels:
global: \"true\"
config:
minute: 5
policy: local
plugin: rate-limiting" | kubectl apply -f -