Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/hos/setup rate limiting #84

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM eclipse-temurin:17-jre-alpine

ARG USER=default
ENV HOME /home/$USER
ENV HOME=/home/$USER

ENV TZ=Europe/Oslo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
Expand All @@ -16,4 +16,4 @@ USER $USER
WORKDIR $HOME

COPY --chown=app:app /target/app.jar app.jar
CMD java -jar -XX:+UseZGC $JAVA_OPTS app.jar
CMD ["sh", "-c", "java -jar -XX:+UseZGC $JAVA_OPTS app.jar"]
15 changes: 15 additions & 0 deletions deploy/demo/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: catalog-view-api
annotations:
nginx.ingress.kubernetes.io/proxy-buffering: 'on'
nginx.ingress.kubernetes.io/limit-rate-after: '15729'
nginx.ingress.kubernetes.io/limit-rate: '128'
nginx.ingress.kubernetes.io/limit-rpm: '10'
nginx.ingress.kubernetes.io/limit-burst-multiplier: '2'
nginx.ingress.kubernetes.io/proxy-read-timeout: '60'
nginx.ingress.kubernetes.io/proxy-send-timeout: '60'
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
15 changes: 15 additions & 0 deletions deploy/prod/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: catalog-view-api
annotations:
nginx.ingress.kubernetes.io/proxy-buffering: 'on'
nginx.ingress.kubernetes.io/limit-rate-after: '15729'
nginx.ingress.kubernetes.io/limit-rate: '128'
nginx.ingress.kubernetes.io/limit-rpm: '10'
nginx.ingress.kubernetes.io/limit-burst-multiplier: '2'
nginx.ingress.kubernetes.io/proxy-read-timeout: '60'
nginx.ingress.kubernetes.io/proxy-send-timeout: '60'
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
15 changes: 15 additions & 0 deletions deploy/staging/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: catalog-view-api
annotations:
nginx.ingress.kubernetes.io/proxy-buffering: 'on'
nginx.ingress.kubernetes.io/limit-rate-after: '15729'
nginx.ingress.kubernetes.io/limit-rate: '128'
nginx.ingress.kubernetes.io/limit-rpm: '10'
nginx.ingress.kubernetes.io/limit-burst-multiplier: '2'
nginx.ingress.kubernetes.io/proxy-read-timeout: '60'
nginx.ingress.kubernetes.io/proxy-send-timeout: '60'
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
Loading