From f492dd491b51ca614ffae7b0eab3caa81179f9ef Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Mon, 20 Oct 2025 08:49:53 +0200 Subject: [PATCH] feat: add mindsdb --- charts/apps/mindsdb/Chart.yaml | 3 ++ charts/apps/mindsdb/templates/database.yaml | 6 +++ charts/apps/mindsdb/templates/deployment.yaml | 51 +++++++++++++++++++ .../apps/mindsdb/templates/http-service.yaml | 11 ++++ charts/apps/mindsdb/templates/pvc.yaml | 11 ++++ charts/apps/mindsdb/templates/service.yaml | 32 ++++++++++++ charts/apps/mindsdb/values.yaml | 5 ++ helmfile.yaml | 5 ++ 8 files changed, 124 insertions(+) create mode 100644 charts/apps/mindsdb/Chart.yaml create mode 100644 charts/apps/mindsdb/templates/database.yaml create mode 100644 charts/apps/mindsdb/templates/deployment.yaml create mode 100644 charts/apps/mindsdb/templates/http-service.yaml create mode 100644 charts/apps/mindsdb/templates/pvc.yaml create mode 100644 charts/apps/mindsdb/templates/service.yaml create mode 100644 charts/apps/mindsdb/values.yaml diff --git a/charts/apps/mindsdb/Chart.yaml b/charts/apps/mindsdb/Chart.yaml new file mode 100644 index 0000000..19c4336 --- /dev/null +++ b/charts/apps/mindsdb/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +version: 1.0.0 +name: mindsdb diff --git a/charts/apps/mindsdb/templates/database.yaml b/charts/apps/mindsdb/templates/database.yaml new file mode 100644 index 0000000..6a30b53 --- /dev/null +++ b/charts/apps/mindsdb/templates/database.yaml @@ -0,0 +1,6 @@ +apiVersion: homelab.mortenolsen.pro/v1 +kind: PostgresDatabase +metadata: + name: '{{ .Release.Name }}' +spec: + environment: '{{ .Values.globals.environment }}' diff --git a/charts/apps/mindsdb/templates/deployment.yaml b/charts/apps/mindsdb/templates/deployment.yaml new file mode 100644 index 0000000..2e3c188 --- /dev/null +++ b/charts/apps/mindsdb/templates/deployment.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "{{ .Release.Name }}" +spec: + strategy: + type: Recreate + replicas: 1 + selector: + matchLabels: + app: "{{ .Release.Name }}" + template: + metadata: + labels: + app: "{{ .Release.Name }}" + spec: + containers: + - name: "{{ .Release.Name }}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: "{{ .Values.image.pullPolicy }}" + ports: + - name: http + containerPort: 47334 + protocol: TCP + - name: mysql + containerPort: 47335 + protocol: TCP + livenessProbe: + tcpSocket: + port: http + readinessProbe: + tcpSocket: + port: http + env: + - name: TZ + value: "{{ .Values.globals.timezone }}" + - name: MINDSDB_APIS + value: http,postgres + - name: MINDSDB_DB_CON + valueFrom: + secretKeyRef: + name: "{{ .Release.Name }}-pg-connection" + key: url + volumeMounts: + - mountPath: mdb_data:/root/mdb_storage mindsdb/mindsdb + name: data + + volumes: + - name: data + persistentVolumeClaim: + claimName: "{{ .Release.Name }}-data" diff --git a/charts/apps/mindsdb/templates/http-service.yaml b/charts/apps/mindsdb/templates/http-service.yaml new file mode 100644 index 0000000..454e263 --- /dev/null +++ b/charts/apps/mindsdb/templates/http-service.yaml @@ -0,0 +1,11 @@ +apiVersion: homelab.mortenolsen.pro/v1 +kind: HttpService +metadata: + name: "{{ .Release.Name }}-http" +spec: + environment: "{{ .Values.globals.environment }}" + subdomain: "{{ .Values.subdomain }}" + destination: + host: "{{ .Release.Name }}-http" + port: + number: 80 diff --git a/charts/apps/mindsdb/templates/pvc.yaml b/charts/apps/mindsdb/templates/pvc.yaml new file mode 100644 index 0000000..aeca898 --- /dev/null +++ b/charts/apps/mindsdb/templates/pvc.yaml @@ -0,0 +1,11 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: "{{ .Release.Name }}-data" +spec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "1Gi" + storageClassName: "{{ .Values.globals.environment }}" diff --git a/charts/apps/mindsdb/templates/service.yaml b/charts/apps/mindsdb/templates/service.yaml new file mode 100644 index 0000000..01bd5b6 --- /dev/null +++ b/charts/apps/mindsdb/templates/service.yaml @@ -0,0 +1,32 @@ +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Release.Name }}-http" + labels: + app: "{{ .Release.Name }}-http" +spec: + type: ClusterIP + ports: + - port: 80 + targetPort: 47334 + protocol: TCP + name: http + selector: + app: "{{ .Release.Name }}" + +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Release.Name }}-mysql" + labels: + app: "{{ .Release.Name }}-mysql" +spec: + type: ClusterIP + ports: + - port: 3306 + targetPort: 47335 + protocol: TCP + name: http + selector: + app: "{{ .Release.Name }}" diff --git a/charts/apps/mindsdb/values.yaml b/charts/apps/mindsdb/values.yaml new file mode 100644 index 0000000..e9d2d2d --- /dev/null +++ b/charts/apps/mindsdb/values.yaml @@ -0,0 +1,5 @@ +image: + repository: docker.io/mindsdb/mindsdb + tag: latest + pullPolicy: IfNotPresent +subdomain: mindsdb diff --git a/helmfile.yaml b/helmfile.yaml index 77bf3eb..782c0ab 100644 --- a/helmfile.yaml +++ b/helmfile.yaml @@ -147,3 +147,8 @@ releases: namespace: prod values: - values.yaml + - name: mindsdb + chart: charts/apps/mindsdb + namespace: prod + values: + - values.yaml