Skip to content

Commit 4abc68d

Browse files
committed
feat(draw.io): added base/overlay for deploying draw.io
1 parent cb239e4 commit 4abc68d

8 files changed

Lines changed: 129 additions & 0 deletions

File tree

apps/base/drawio/deployment.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: drawio
5+
namespace: drawio
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: drawio
11+
template:
12+
metadata:
13+
labels:
14+
app: drawio
15+
app.kubernetes.io/name: drawio
16+
spec:
17+
securityContext:
18+
fsGroup: 1000
19+
containers:
20+
- name: drawio
21+
image: jgraph/drawio:14.6.13-alpine
22+
ports:
23+
- containerPort: 8080
24+
resources:
25+
requests:
26+
cpu: "10m"
27+
memory: "64Mi"
28+
limits:
29+
memory: "128Mi"
30+
securityContext:
31+
readOnlyRootFilesystem: false
32+
runAsNonRoot: true
33+
runAsUser: 1000
34+
seccompProfile:
35+
type: RuntimeDefault
36+
volumeMounts:
37+
- name: tmp-volume
38+
mountPath: /tmp
39+
volumes:
40+
- name: tmp-volume
41+
emptyDir: {}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- namespace.yaml
5+
- service.yaml
6+
- deployment.yaml

apps/base/drawio/namespace.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: drawio

apps/base/drawio/service.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: drawio
5+
namespace: drawio
6+
spec:
7+
selector:
8+
app: drawio
9+
ports:
10+
- port: 8080
11+
targetPort: 8080
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: drawio
5+
namespace: drawio
6+
spec:
7+
template:
8+
spec:
9+
nodeSelector:
10+
node-role.kubernetes.io/cpu-worker: "true"
11+
containers:
12+
- name: drawio
13+
image: jgraph/drawio:latest
14+
volumeMounts:
15+
# Mounting to /opt/drawio/data is a safe standard
16+
- name: drawio-storage
17+
mountPath: /opt/drawio/data
18+
volumes:
19+
- name: drawio-storage
20+
persistentVolumeClaim:
21+
claimName: drawio-data
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: drawio-ingress
5+
namespace: drawio
6+
annotations:
7+
traefik.ingress.kubernetes.io/router.entrypoints: websecure
8+
traefik.ingress.kubernetes.io/router.tls: "true"
9+
cert-manager.io/cluster-issuer: letsencrypt # CHANGE to your cert-manager cluster-issuer
10+
spec:
11+
ingressClassName: traefik
12+
rules:
13+
- host: draw.example.com # CHANGE to your draw.io URL
14+
http:
15+
paths:
16+
- path: /
17+
pathType: Prefix
18+
backend:
19+
service:
20+
name: drawio
21+
port:
22+
number: 8080
23+
tls:
24+
- hosts:
25+
- draw.example.com # CHANGE to your draw.io URL
26+
secretName: drawio-tls
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- ../../base/drawio
5+
- pvc.yaml
6+
- ingress.yaml
7+
8+
patches:
9+
- path: drawio-patch.yaml
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: drawio-data
5+
namespace: drawio
6+
spec:
7+
accessModes:
8+
- ReadWriteOnce
9+
resources:
10+
requests:
11+
storage: 1Gi

0 commit comments

Comments
 (0)