Skip to content

Commit

Permalink
chore: add rate-limit, set rollingupdate, add resource req/limit
Browse files Browse the repository at this point in the history
  • Loading branch information
valosnah committed Sep 30, 2024
1 parent c035529 commit d06d9e5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
8 changes: 7 additions & 1 deletion deploy/base/deployment-ai-project-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
matchLabels:
app: ai-project-service
strategy:
type: Recreate
type: RollingUpdate
template:
metadata:
labels:
Expand All @@ -25,6 +25,12 @@ spec:
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
limits:
memory: 20Mi
requests:
cpu: 5m
memory: 20Mi
livenessProbe:
httpGet:
path: /ping
Expand Down
10 changes: 10 additions & 0 deletions deploy/demo/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ai-project-service
annotations:
nginx.ingress.kubernetes.io/limit-rpm: '6'
nginx.ingress.kubernetes.io/limit-burst-multiplier: '2'
nginx.ingress.kubernetes.io/limit-whitelist: '10.0.0.0/8'
nginx.ingress.kubernetes.io/server-snippet: |
server_tokens off;
location ~ ^/(ping|ready|prometheus) {
deny all;
return 404;
}
spec:
ingressClassName: nginx
rules:
Expand Down
10 changes: 10 additions & 0 deletions deploy/prod/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ai-project-service
annotations:
nginx.ingress.kubernetes.io/limit-rpm: '6'
nginx.ingress.kubernetes.io/limit-burst-multiplier: '2'
nginx.ingress.kubernetes.io/limit-whitelist: '10.0.0.0/8'
nginx.ingress.kubernetes.io/server-snippet: |
server_tokens off;
location ~ ^/(ping|ready|prometheus) {
deny all;
return 404;
}
spec:
ingressClassName: nginx
rules:
Expand Down
10 changes: 10 additions & 0 deletions deploy/staging/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ai-project-service
annotations:
nginx.ingress.kubernetes.io/limit-rpm: '6'
nginx.ingress.kubernetes.io/limit-burst-multiplier: '2'
nginx.ingress.kubernetes.io/limit-whitelist: '10.0.0.0/8'
nginx.ingress.kubernetes.io/server-snippet: |
server_tokens off;
location ~ ^/(ping|ready|prometheus) {
deny all;
return 404;
}
spec:
ingressClassName: nginx
rules:
Expand Down

0 comments on commit d06d9e5

Please sign in to comment.