Customize Kubenretes Ingress

Customizing Ingress rules for exchanges on Kubernetes

Once you run HollaEx CLI commands with --kube flag, HollaEx CLI would automatically generate Ingress rules for Kubernetes with default form. You can check these generated templates under templates/kubernetes/<EXCHANGE_NAME>-ingress.yaml> .
Default Ingress should be similar to the examples down below.
HollaEx CLI generates Ingress rules which compatible with kubernetes/nginx-ingress.If you are planning to use a different Ingress controller, please customize annotations and detailed values based on your own ones.
Nginx rate limit setups on nginx.ingress.kubernetes.io/configuration-snippet are following pre-defined rate limit zone setups on bitHolla's own Ingress controller.
    api : 4r/s
Please reference these values and add it on your own Ingress controller. For example, kubernetes/nginx-ingress support annotation called http-snippet to let user inject code snippets on Nginx.conf.
1
apiVersion: extensions/v1beta1
2
kind: Ingress
3
metadata:
4
name: hollaex-ingress-api
5
namespace: hollaex
6
annotations:
7
kubernetes.io/ingress.class: "nginx"
8
kubernetes.io/tls-acme: "true"
9
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
10
nginx.ingress.kubernetes.io/proxy-body-size: "2m"
11
nginx.ingress.kubernetes.io/configuration-snippet: |
12
limit_req zone=api burst=10 nodelay;
13
limit_req_log_level notice;
14
limit_req_status 429;
15
spec:
16
rules:
17
- host: api.demo.bitholla.com
18
http:
19
paths:
20
- path: /v1
21
backend:
22
serviceName: hollaex-server-api
23
servicePort: 10010
24
25
tls:
26
- secretName: hollaex-tls-cert
27
hosts:
28
- api.demo.bitholla.com
29
30
---
31
apiVersion: extensions/v1beta1
32
kind: Ingress
33
metadata:
34
name: hollaex-ingress-api-order
35
namespace: hollaex
36
annotations:
37
kubernetes.io/ingress.class: "nginx"
38
kubernetes.io/tls-acme: "true"
39
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
40
nginx.ingress.kubernetes.io/proxy-body-size: "2m"
41
nginx.ingress.kubernetes.io/configuration-snippet: |
42
limit_req zone=api burst=10 nodelay;
43
limit_req_log_level notice;
44
limit_req_status 429;
45
spec:
46
rules:
47
- host: api.demo.bitholla.com
48
http:
49
paths:
50
- path: /v1/order
51
backend:
52
serviceName: hollaex-server-api
53
servicePort: 10010
54
55
tls:
56
- secretName: hollaex-tls-cert
57
hosts:
58
- api.demo.bitholla.com
59
60
---
61
apiVersion: extensions/v1beta1
62
kind: Ingress
63
metadata:
64
name: hollaex-ingress-api-admin
65
namespace: hollaex
66
annotations:
67
kubernetes.io/ingress.class: "nginx"
68
kubernetes.io/tls-acme: "true"
69
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
70
nginx.ingress.kubernetes.io/proxy-body-size: "2m"
71
spec:
72
rules:
73
- host: api.demo.bitholla.com
74
http:
75
paths:
76
- path: /v1/admin
77
backend:
78
serviceName: hollaex-server-api
79
servicePort: 10010
80
81
tls:
82
- secretName: hollaex-tls-cert
83
hosts:
84
- api.demo.bitholla.com
85
86
---
87
apiVersion: extensions/v1beta1
88
kind: Ingress
89
metadata:
90
name: hollaex-ingress-stream
91
namespace: hollaex
92
annotations:
93
kubernetes.io/ingress.class: "nginx"
94
kubernetes.io/tls-acme: "true"
95
certmanager.k8s.io/cluster-issuer: letsencrypt-prod
96
nginx.ingress.kubernetes.io/proxy-body-size: "2m"
97
nginx.org/websocket-services: "hollaex-server-stream"
98
spec:
99
rules:
100
- host: api.demo.bitholla.com
101
http:
102
paths:
103
- path: /socket.io
104
backend:
105
serviceName: hollaex-server-stream
106
servicePort: 10080
107
108
tls:
109
- secretName: hollaex-tls-cert
110
hosts:
111
- api.demo.bitholla.com
112
Copied!
For example, if you are planning to use nginxinc/kubernetes-ingress, certain annotations should be modified as shown below.
If you are planning to use splitted Ingress rules like the example up above, Consider using nginx.org/mergeable-ingress-type.
    nginx.ingress.kubernetes.io/proxy-body-size-> nginx.org/client-max-body-size
    nginx.ingress.kubernetes.io/configuration-snippet -> nginx.org/location-snippets
Last modified 9mo ago
Copy link