This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.kubernetes.yaml
116 lines (108 loc) · 1.93 KB
/
example.kubernetes.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
selector:
matchLabels:
run: nginx
template:
metadata:
labels:
run: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- name: http
containerPort: 80
protocol: TCP
- name: nginx-proxy
image: ghcr.io/airfocusio/rate-limit-proxy:latest
imagePullPolicy: Always
args: [
"--config", "/rate-limit/config.yaml",
"--listen", "0.0.0.0:81",
"--target", "http://127.0.0.1:80"
]
ports:
- name: http-public
containerPort: 81
protocol: TCP
volumeMounts:
- name: rate-limit-config
mountPath: /rate-limit
volumes:
- name: rate-limit-config
configMap:
name: rate-limit-config
---
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
run: nginx
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
- name: http-public
port: 81
protocol: TCP
targetPort: http-public
selector:
run: nginx
---
apiVersion: v1
kind: ConfigMap
metadata:
name: rate-limit-config
data:
config.yaml: |
redis:
address: redis:6379
limits:
interval: 10
anonymous: 10
identified: 60
other:
system: 0
identifiers:
- jwtBearerHeader:
algorithm: HS256
verifier: EyllPgDqUmu9T+ununAWNL02fKXjQfo+QWQNpqDU6TA=
claim: sub
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
spec:
selector:
matchLabels:
run: redis
replicas: 1
template:
metadata:
labels:
run: redis
spec:
containers:
- name: redis
image: redis:5
---
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
selector:
run: redis
ports:
- protocol: TCP
port: 6379
targetPort: 6379