mirror of
https://github.com/bitnami/charts.git
synced 2026-04-01 06:47:23 +08:00
bitnami/seaweedfs external postgres database support (#29216)
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.9 (2024-08-19)
|
||||
## 1.1.0 (2024-09-09)
|
||||
|
||||
* [bitnami/seaweedfs] Release 1.0.9 ([#28920](https://github.com/bitnami/charts/pull/28920))
|
||||
* bitnami/seaweedfs external postgres database support ([#29216](https://github.com/bitnami/charts/pull/29216))
|
||||
|
||||
## <small>1.0.9 (2024-08-19)</small>
|
||||
|
||||
* [bitnami/seaweedfs] Release 1.0.9 (#28920) ([28916ca](https://github.com/bitnami/charts/commit/28916ca487e16f1626580f21c2ae8acb443a2e39)), closes [#28920](https://github.com/bitnami/charts/issues/28920)
|
||||
|
||||
## <small>1.0.8 (2024-08-07)</small>
|
||||
|
||||
|
||||
@@ -40,4 +40,4 @@ name: seaweedfs
|
||||
sources:
|
||||
- https://github.com/bitnami/charts/tree/main/bitnami/seawwedfs
|
||||
- https://github.com/bitnami/containers/tree/main/bitnami/seaweedfs
|
||||
version: 1.0.9
|
||||
version: 1.1.0
|
||||
|
||||
@@ -65,6 +65,8 @@ You may want to have SeaweedFS Filer Server connect to an external database rath
|
||||
|
||||
```console
|
||||
mariadb.enabled=false
|
||||
externalDatabase.enabled=true
|
||||
externalDatabase.store=mariadb
|
||||
externalDatabase.host=myexternalhost
|
||||
externalDatabase.user=myuser
|
||||
externalDatabase.password=mypassword
|
||||
@@ -72,6 +74,34 @@ externalDatabase.database=mydatabase
|
||||
externalDatabase.port=3306
|
||||
```
|
||||
|
||||
In addition, the tables must be created in the external database before starting seaweedfs.
|
||||
|
||||
For mariadb, the following should be performed (substituting mydatabase as necessary):
|
||||
|
||||
```console
|
||||
USE mydatabase;
|
||||
CREATE TABLE IF NOT EXISTS `filemeta` (
|
||||
`dirhash` BIGINT NOT NULL COMMENT 'first 64 bits of MD5 hash value of directory field',
|
||||
`name` VARCHAR(766) NOT NULL COMMENT 'directory or file name',
|
||||
`directory` TEXT NOT NULL COMMENT 'full path to parent directory',
|
||||
`meta` LONGBLOB,
|
||||
PRIMARY KEY (`dirhash`, `name`)
|
||||
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
|
||||
```
|
||||
|
||||
For postgresql, the following should be performed (substituting mydatabase as necessary):
|
||||
|
||||
```console
|
||||
\c mydatabase;
|
||||
CREATE TABLE IF NOT EXISTS filemeta (
|
||||
dirhash BIGINT,
|
||||
name VARCHAR(65535),
|
||||
directory VARCHAR(65535),
|
||||
meta bytea,
|
||||
PRIMARY KEY (dirhash, name)
|
||||
);
|
||||
```
|
||||
|
||||
### Ingress
|
||||
|
||||
This chart provides support for Ingress resources. If you have an ingress controller installed on your cluster, such as [nginx-ingress-controller](https://github.com/bitnami/charts/tree/main/bitnami/nginx-ingress-controller) or [contour](https://github.com/bitnami/charts/tree/main/bitnami/contour) you can utilize the ingress controller to serve your application.
|
||||
@@ -1043,7 +1073,8 @@ enabled = false
|
||||
| `mariadb.primary.persistence.size` | Persistent Volume size | `8Gi` |
|
||||
| `mariadb.primary.resourcesPreset` | Set container resources according to one common preset (allowed values: none, nano, small, medium, large, xlarge, 2xlarge). This is ignored if primary.resources is set (primary.resources is recommended for production). | `micro` |
|
||||
| `mariadb.primary.resources` | Set container requests and limits for different resources like CPU or memory (essential for production workloads) | `{}` |
|
||||
| `externalDatabase.enabled` | Enable secret with external mariadb database credentials | `false` |
|
||||
| `externalDatabase.enabled` | Enable external database support | `false` |
|
||||
| `externalDatabase.store` | Database store (mariadb, postgresql) | `mariadb` |
|
||||
| `externalDatabase.host` | External Database server host | `localhost` |
|
||||
| `externalDatabase.port` | External Database server port | `3306` |
|
||||
| `externalDatabase.user` | External Database username | `bn_seaweedfs` |
|
||||
|
||||
@@ -283,6 +283,19 @@ Return the database secret name
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the database secret key name
|
||||
*/}}
|
||||
{{- define "seaweedfs.database.keyName" -}}
|
||||
{{- if .Values.mariadb.enabled }}
|
||||
{{- print "mariadb-password" -}}
|
||||
{{- else if .Values.externalDatabase.existingSecret -}}
|
||||
{{- printf "%s-password" .Values.externalDatabase.store -}}
|
||||
{{- else -}}
|
||||
{{- print "password" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns an init-container that waits for the database to be ready
|
||||
*/}}
|
||||
@@ -336,7 +349,7 @@ Returns an init-container that waits for the database to be ready
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "seaweedfs.database.secretName" . }}
|
||||
key: mariadb-password
|
||||
key: {{ include "seaweedfs.database.keyName" . }}
|
||||
volumeMounts:
|
||||
- name: empty-dir
|
||||
mountPath: /tmp
|
||||
|
||||
@@ -15,5 +15,5 @@ metadata:
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
mariadb-password: {{ .Values.externalDatabase.password | b64enc | quote }}
|
||||
password: {{ .Values.externalDatabase.password | b64enc | quote }}
|
||||
{{- end }}
|
||||
|
||||
@@ -85,7 +85,7 @@ spec:
|
||||
terminationGracePeriodSeconds: {{ .Values.filer.terminationGracePeriodSeconds }}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
{{- if .Values.mariadb.enabled }}
|
||||
{{- if or .Values.mariadb.enabled (and .Values.externalDatabase.enabled (eq .Values.externalDatabase.store "mariadb") ) }}
|
||||
{{- include "seaweedfs.filer.waitForDBInitContainer" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.filer.initContainers }}
|
||||
@@ -137,7 +137,7 @@ spec:
|
||||
fieldPath: metadata.namespace
|
||||
- name: WEED_CLUSTER_DEFAULT
|
||||
value: {{ .Values.clusterDefault | quote }}
|
||||
{{- if .Values.mariadb.enabled }}
|
||||
{{- if or .Values.mariadb.enabled (and .Values.externalDatabase.enabled (eq .Values.externalDatabase.store "mariadb") ) }}
|
||||
- name: WEED_MYSQL_ENABLED
|
||||
value: "true"
|
||||
- name: WEED_MYSQL_HOSTNAME
|
||||
@@ -152,7 +152,7 @@ spec:
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "seaweedfs.database.secretName" . }}
|
||||
key: mariadb-password
|
||||
key: {{ include "seaweedfs.database.keyName" . }}
|
||||
- name: WEED_MYSQL_CONNECTION_MAX_IDLE
|
||||
value: "5"
|
||||
- name: WEED_MYSQL_CONNECTION_MAX_OPEN
|
||||
@@ -162,6 +162,25 @@ spec:
|
||||
- name: WEED_MYSQL_INTERPOLATEPARAMS
|
||||
value: "true"
|
||||
{{- end }}
|
||||
{{- if and .Values.externalDatabase.enabled (eq .Values.externalDatabase.store "postgres") }}
|
||||
- name: WEED_POSTGRES_ENABLED
|
||||
value: "true"
|
||||
- name: WEED_POSTGRES_HOSTNAME
|
||||
value: {{ include "seaweedfs.database.host" . | quote }}
|
||||
- name: WEED_POSTGRES_PORT
|
||||
value: {{ include "seaweedfs.database.port" . | quote }}
|
||||
- name: WEED_POSTGRES_DATABASE
|
||||
value: {{ include "seaweedfs.database.name" . | quote }}
|
||||
- name: WEED_POSTGRES_USERNAME
|
||||
value: {{ include "seaweedfs.database.user" . | quote }}
|
||||
- name: WEED_POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "seaweedfs.database.secretName" . }}
|
||||
key: {{ include "seaweedfs.database.keyName" . }}
|
||||
- name: WEED_POSTGRES_SSLMODE
|
||||
value: "disable"
|
||||
{{- end }}
|
||||
{{- if .Values.filer.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.filer.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -3356,12 +3356,15 @@ mariadb:
|
||||
##
|
||||
resources: {}
|
||||
## External Database Configuration
|
||||
## All of these values are only used if `mariadb.enabled=false`
|
||||
## All of these values are only used if `mariadb.enabled=false` and `externalDatabase.enabled=true`.
|
||||
##
|
||||
externalDatabase:
|
||||
## @param externalDatabase.enabled Enable secret with external mariadb database credentials
|
||||
## @param externalDatabase.enabled Enable external database support
|
||||
##
|
||||
enabled: false
|
||||
## @param externalDatabase.store Database store (mariadb, postgresql)
|
||||
##
|
||||
store: mariadb
|
||||
## @param externalDatabase.host External Database server host
|
||||
##
|
||||
host: localhost
|
||||
@@ -3378,7 +3381,7 @@ externalDatabase:
|
||||
##
|
||||
database: bitnami_seaweedfs
|
||||
## @param externalDatabase.existingSecret The name of an existing secret with database credentials. Evaluated as a template
|
||||
## NOTE: Must contain key `mariadb-password`
|
||||
## NOTE: Must contain key `mariadb-password` for mariadb or 'postgres-password' for postgres
|
||||
## NOTE: When it's set, the `externalDatabase.password` parameter is ignored
|
||||
##
|
||||
existingSecret: ""
|
||||
|
||||
Reference in New Issue
Block a user