Skip to content

Commit 74caaf9

Browse files
Add Drizzle Studio template (#508)
Signed-off-by: Carson Yang <[email protected]>
1 parent 2f1373b commit 74caaf9

File tree

2 files changed

+171
-2
lines changed

2 files changed

+171
-2
lines changed
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
apiVersion: app.sealos.io/v1
2+
kind: Template
3+
metadata:
4+
name: drizzle-studio
5+
spec:
6+
title: 'Drizzle Studio (Gateway)'
7+
url: 'https://gateway.drizzle.team/'
8+
gitRepo: 'https://github.com/drizzle-team/drizzle-orm'
9+
author: 'Sealos'
10+
description: 'Drizzle Studio (Gateway) is a self-hosted, browser-based interface for exploring and managing your database schema using the Drizzle ORM ecosystem. It acts as a gateway between your database and Drizzle Studio’s frontend, enabling secure connections, schema introspection, and query execution directly from your own infrastructure instead of relying on a public service.'
11+
readme: 'https://raw.githubusercontent.com/drizzle-team/drizzle-orm/refs/heads/main/README.md'
12+
icon: 'https://avatars.githubusercontent.com/u/108468352?s=48&v=4'
13+
templateType: inline
14+
locale: en
15+
i18n:
16+
zh:
17+
description: 'Drizzle Studio (Gateway) 是一款现代化的 TypeScript ORM,主打轻量与强类型体验。它兼容 PostgreSQL、MySQL、SQLite 等主流数据库,并对多种 Serverless/边缘数据库提供现成适配。'
18+
categories:
19+
- tool
20+
defaults:
21+
app_name:
22+
type: string
23+
value: drizzle-studio-${{ random(8) }}
24+
app_host:
25+
type: string
26+
value: drizzle-studio-${{ random(8) }}
27+
inputs:
28+
masterpass:
29+
description: 'Master password used by Drizzle Studio Gateway (optional)'
30+
type: string
31+
default: ''
32+
required: false
33+
34+
---
35+
apiVersion: apps/v1
36+
kind: StatefulSet
37+
metadata:
38+
name: ${{ defaults.app_name }}
39+
annotations:
40+
originImageName: ghcr.io/drizzle-team/gateway:latest
41+
deploy.cloud.sealos.io/minReplicas: '1'
42+
deploy.cloud.sealos.io/maxReplicas: '1'
43+
labels:
44+
cloud.sealos.io/app-deploy-manager: ${{ defaults.app_name }}
45+
app: ${{ defaults.app_name }}
46+
spec:
47+
serviceName: ${{ defaults.app_name }}
48+
replicas: 1
49+
revisionHistoryLimit: 1
50+
selector:
51+
matchLabels:
52+
app: ${{ defaults.app_name }}
53+
template:
54+
metadata:
55+
labels:
56+
app: ${{ defaults.app_name }}
57+
spec:
58+
automountServiceAccountToken: false
59+
containers:
60+
- name: ${{ defaults.app_name }}
61+
image: ghcr.io/drizzle-team/gateway:latest
62+
imagePullPolicy: IfNotPresent
63+
env:
64+
- name: PORT
65+
value: '4983'
66+
- name: STORE_PATH
67+
value: '/app'
68+
${{ if(inputs.masterpass !== '') }}
69+
- name: MASTERPASS
70+
value: ${{ inputs.masterpass }}
71+
${{ endif() }}
72+
ports:
73+
- containerPort: 4983
74+
name: http
75+
volumeMounts:
76+
- name: vn-app
77+
mountPath: /app
78+
resources:
79+
requests:
80+
cpu: 10m
81+
memory: 16Mi
82+
limits:
83+
cpu: 200m
84+
memory: 256Mi
85+
volumeClaimTemplates:
86+
- metadata:
87+
annotations:
88+
path: /app
89+
value: '1'
90+
name: vn-app
91+
spec:
92+
accessModes:
93+
- ReadWriteOnce
94+
resources:
95+
requests:
96+
storage: 1Gi
97+
98+
---
99+
apiVersion: v1
100+
kind: Service
101+
metadata:
102+
name: ${{ defaults.app_name }}
103+
labels:
104+
cloud.sealos.io/app-deploy-manager: ${{ defaults.app_name }}
105+
spec:
106+
type: ClusterIP
107+
ports:
108+
- port: 4983
109+
targetPort: 4983
110+
protocol: TCP
111+
selector:
112+
app: ${{ defaults.app_name }}
113+
114+
---
115+
apiVersion: networking.k8s.io/v1
116+
kind: Ingress
117+
metadata:
118+
name: ${{ defaults.app_name }}
119+
labels:
120+
cloud.sealos.io/app-deploy-manager: ${{ defaults.app_name }}
121+
cloud.sealos.io/app-deploy-manager-domain: ${{ defaults.app_host }}
122+
annotations:
123+
kubernetes.io/ingress.class: nginx
124+
nginx.ingress.kubernetes.io/proxy-body-size: 32m
125+
nginx.ingress.kubernetes.io/server-snippet: |
126+
client_header_buffer_size 64k;
127+
large_client_header_buffers 4 128k;
128+
nginx.ingress.kubernetes.io/ssl-redirect: 'true'
129+
nginx.ingress.kubernetes.io/backend-protocol: HTTP
130+
nginx.ingress.kubernetes.io/client-body-buffer-size: 64k
131+
nginx.ingress.kubernetes.io/proxy-buffer-size: 64k
132+
nginx.ingress.kubernetes.io/proxy-send-timeout: '300'
133+
nginx.ingress.kubernetes.io/proxy-read-timeout: '300'
134+
nginx.ingress.kubernetes.io/configuration-snippet: |
135+
if ($request_uri ~* \.(js|css|gif|jpe?g|png)) {
136+
expires 30d;
137+
add_header Cache-Control "public";
138+
}
139+
spec:
140+
rules:
141+
- host: ${{ defaults.app_host }}.${{ SEALOS_CLOUD_DOMAIN }}
142+
http:
143+
paths:
144+
- pathType: Prefix
145+
path: /
146+
backend:
147+
service:
148+
name: ${{ defaults.app_name }}
149+
port:
150+
number: 4983
151+
tls:
152+
- hosts:
153+
- ${{ defaults.app_host }}.${{ SEALOS_CLOUD_DOMAIN }}
154+
secretName: ${{ SEALOS_CERT_SECRET_NAME }}
155+
156+
---
157+
apiVersion: app.sealos.io/v1
158+
kind: App
159+
metadata:
160+
name: ${{ defaults.app_name }}
161+
labels:
162+
cloud.sealos.io/app-deploy-manager: ${{ defaults.app_name }}
163+
spec:
164+
data:
165+
url: https://${{ defaults.app_host }}.${{ SEALOS_CLOUD_DOMAIN }}
166+
displayType: normal
167+
icon: 'https://avatars.githubusercontent.com/u/108468352?s=48&v=4'
168+
name: ${{ defaults.app_name }}
169+
type: link
170+

template/pocketbase/index.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ spec:
1414
locale: en
1515
i18n:
1616
zh:
17-
title: 'PocketBase'
1817
description: '开源后端服务,包含嵌入式数据库(SQLite)、实时订阅、内置认证管理、便捷的仪表盘UI和简单的REST API'
1918
categories:
2019
- backend
@@ -136,7 +135,7 @@ spec:
136135
- ReadWriteOnce
137136
resources:
138137
requests:
139-
storage: 5Gi
138+
storage: 1Gi
140139

141140
---
142141
apiVersion: v1

0 commit comments

Comments
 (0)