Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: create Helm chart for Bytebase (#170)

satorud00e953db87d
diff --git a/helm-charts/bytebase/.helmignore b/helm-charts/bytebase/.helmignore
new file mode 100644
index 0000000000..0e8a0eb36f
--- /dev/null
+++ b/helm-charts/bytebase/.helmignore
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/helm-charts/bytebase/Chart.yaml b/helm-charts/bytebase/Chart.yaml
new file mode 100644
index 0000000000..7fbe6bb9a4
--- /dev/null
+++ b/helm-charts/bytebase/Chart.yaml
@@ -0,0 +1,10 @@
+apiVersion: v2
+name: bytebase
+description: Web-based, zero-config, dependency-free database schema change and version control tool for teams.
+type: application
+version: 0.0.1
+appVersion: "0.9.0"
+home: https://bytebase.com/
+icon: https://bytebase.com/_nuxt/img/logo-icon.ca8220c.svg
+sources:
+ - https://github.com/bytebase/bytebase
diff --git a/helm-charts/bytebase/README.md b/helm-charts/bytebase/README.md
new file mode 100644
index 0000000000..2a5aae44e5
--- /dev/null
+++ b/helm-charts/bytebase/README.md
@@ -0,0 +1,15 @@
+# Bytebase Helm Chart
+
+Install the web-based schema change and version control tool [Bytebase](https://bytebase.com/).
+
+## Installing
+
+`helm -n <YOUR_NAMESPACE> install <RELEASE_NAME> helm-charts/bytebase`
+
+## Uninstalling
+
+`helm delete <RELEASE_NAME>`
+
+## TODO
+- [ ] Add support for [Litestream](https://litestream.io/guides/kubernetes/).
+- [ ] Create GitHub Pages for [Helm chart repo](https://medium.com/@mattiaperi/create-a-public-helm-chart-repository-with-github-pages-49b180dbb417).
\ No newline at end of file
diff --git a/helm-charts/bytebase/templates/_helpers.tpl b/helm-charts/bytebase/templates/_helpers.tpl
new file mode 100644
index 0000000000..cc52f46bcf
--- /dev/null
+++ b/helm-charts/bytebase/templates/_helpers.tpl
@@ -0,0 +1,10 @@
+{{/*
+Allow the release namespace to be overridden for multi-namespace deployments in combined charts
+*/}}
+{{- define "bytebase.namespace" -}}
+ {{- if .Values.namespaceOverride -}}
+ {{- .Values.namespaceOverride -}}
+ {{- else -}}
+ {{- .Release.Namespace -}}
+ {{- end -}}
+{{- end -}}
\ No newline at end of file
diff --git a/helm-charts/bytebase/templates/service.yaml b/helm-charts/bytebase/templates/service.yaml
new file mode 100644
index 0000000000..0b7e1d1ae9
--- /dev/null
+++ b/helm-charts/bytebase/templates/service.yaml
@@ -0,0 +1,14 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: bytebase
+ namespace: {{ template "bytebase.namespace" . }}
+ labels:
+ app: bytebase
+spec:
+ ports:
+ - port: 80
+ name: web
+ clusterIP: None
+ selector:
+ app: bytebase
\ No newline at end of file
diff --git a/helm-charts/bytebase/templates/statefulset.yaml b/helm-charts/bytebase/templates/statefulset.yaml
new file mode 100644
index 0000000000..bed2504e89
--- /dev/null
+++ b/helm-charts/bytebase/templates/statefulset.yaml
@@ -0,0 +1,40 @@
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: bytebase
+ namespace: {{ template "bytebase.namespace" . }}
+spec:
+ selector:
+ matchLabels:
+ app: bytebase
+ serviceName: "bytebase"
+ replicas: 1
+ template:
+ metadata:
+ labels:
+ app: bytebase
+ spec:
+ containers:
+ - name: bytebase
+ image: "bytebase/bytebase:{{ .Chart.AppVersion }}"
+ ports:
+ - containerPort: 80
+ name: web
+ volumeMounts:
+ - mountPath: /var/opt/bytebase
+ name: sqlite
+ readinessProbe:
+ httpGet:
+ path: /api/actuator/info
+ port: web
+ initialDelaySeconds: 2
+ periodSeconds: 2
+ volumeClaimTemplates:
+ - metadata:
+ name: sqlite
+ spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: "{{ .Values.bytebase.storage }}"
diff --git a/helm-charts/bytebase/values.yaml b/helm-charts/bytebase/values.yaml
new file mode 100644
index 0000000000..cb70baf59f
--- /dev/null
+++ b/helm-charts/bytebase/values.yaml
@@ -0,0 +1,6 @@
+# Default values for bytebase.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+bytebase:
+ storage: 256Mi
\ No newline at end of file