Skip to content

Commit

Permalink
Add svc ang ingress rules for tldraw
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejpass committed Nov 6, 2023
1 parent bcd3cbe commit dc970fc
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-tldraw-deployment
name: tldraw-deployment
namespace: {{ NAMESPACE }}
labels:
app: api-tldraw
app: tldraw
spec:
replicas: {{ TLDRAW_EDITOR_REPLICAS|default("1", true) }}
strategy:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ NAMESPACE }}-tldraw-ingress
namespace: {{ NAMESPACE }}
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "{{ TLS_ENABELD|default("false") }}"
nginx.ingress.kubernetes.io/proxy-body-size: "{{ INGRESS_MAX_BODY_SIZE|default("2560") }}m"
nginx.org/client-max-body-size: "{{ INGRESS_MAX_BODY_SIZE|default("2560") }}m"
# The following properties added with BC-3606.
# The header size of the request is too big. For e.g. state and the permanent growing jwt.
# Nginx throws away the Location header, resulting in the 502 Bad Gateway.
nginx.ingress.kubernetes.io/client-header-buffer-size: 100k
nginx.ingress.kubernetes.io/http2-max-header-size: 96k
nginx.ingress.kubernetes.io/large-client-header-buffers: 4 100k
nginx.ingress.kubernetes.io/proxy-buffer-size: 96k
{% if CLUSTER_ISSUER is defined %}
cert-manager.io/cluster-issuer: {{ CLUSTER_ISSUER }}
{% endif %}

spec:
ingressClassName: nginx
{% if CLUSTER_ISSUER is defined or (TLS_ENABELD is defined and TLS_ENABELD|bool) %}
tls:
- hosts:
- {{ DOMAIN }}
{% if CLUSTER_ISSUER is defined %}
secretName: {{ DOMAIN }}-tls
{% endif %}
{% endif %}
rules:
- host: {{ DOMAIN }}
http:
paths:
- path: /tldraw-server
backend:
service:
name: tldraw-svc
port:
number: {{ PORT_TLDRAW }}
pathType: Prefix
- path: /tldraw-management
backend:
service:
name: tldraw-svc
port:
number: {{ PORT_TLDRAW_MANAGEMENT }}
pathType: Prefix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: api-tldraw-svc
name: tldraw-svc
namespace: {{ NAMESPACE }}
labels:
app: tldraw
Expand Down

0 comments on commit dc970fc

Please sign in to comment.