aboutsummaryrefslogtreecommitdiff
path: root/k8s
diff options
context:
space:
mode:
authorDavide Calabrese <d.calabrese@dacalab.com>2024-10-23 22:27:38 +0200
committerGitHub <noreply@github.com>2024-10-23 13:27:38 -0700
commita3b97bfe0317f3c948c7a09c42f48dce2d5a4146 (patch)
tree587324cf8ea69ad8b0845cf1335d221f8ea67e0f /k8s
parent73921ce4f640a183c7e5addddf8a6e5de5c5dfda (diff)
downloadseaweedfs-a3b97bfe0317f3c948c7a09c42f48dce2d5a4146.tar.xz
seaweedfs-a3b97bfe0317f3c948c7a09c42f48dce2d5a4146.zip
[helm] Allow setting notification.toml config (#6159)
* [helm] Allow setting notification.toml config * [helm] Set notification config conditionally
Diffstat (limited to 'k8s')
-rw-r--r--k8s/charts/seaweedfs/templates/filer-statefulset.yaml11
-rw-r--r--k8s/charts/seaweedfs/templates/notification-configmap.yaml19
-rw-r--r--k8s/charts/seaweedfs/values.yaml13
3 files changed, 43 insertions, 0 deletions
diff --git a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml
index 0dfa0e84e..5ac84bdf7 100644
--- a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml
+++ b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml
@@ -234,6 +234,12 @@ spec:
- name: data-filer
mountPath: /data
{{- end }}
+ {{- if .Values.filer.notificationConfig }}
+ - name: notification-config
+ readOnly: true
+ mountPath: /etc/seaweedfs/notification.toml
+ subPath: notification.toml
+ {{- end }}
{{- if .Values.global.enableSecurity }}
- name: security-config
readOnly: true
@@ -349,6 +355,11 @@ spec:
secretName: seaweedfs-s3-secret
{{- end }}
{{- end }}
+ {{- if .Values.filer.notificationConfig }}
+ - name: notification-config
+ configMap:
+ name: {{ template "seaweedfs.name" . }}-notification-config
+ {{- end }}
{{- if .Values.global.enableSecurity }}
- name: security-config
configMap:
diff --git a/k8s/charts/seaweedfs/templates/notification-configmap.yaml b/k8s/charts/seaweedfs/templates/notification-configmap.yaml
new file mode 100644
index 000000000..c638c8771
--- /dev/null
+++ b/k8s/charts/seaweedfs/templates/notification-configmap.yaml
@@ -0,0 +1,19 @@
+{{- if and .Values.filer.enabled .Values.filer.notificationConfig }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ template "seaweedfs.name" . }}-notification-config
+ namespace: {{ .Release.Namespace }}
+ labels:
+ app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
+ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
+ app.kubernetes.io/instance: {{ .Release.Name }}
+{{- if .Values.filer.annotations }}
+ annotations:
+ {{- toYaml .Values.filer.annotations | nindent 4 }}
+{{- end }}
+data:
+ notification.toml: |-
+ {{ .Values.filer.notificationConfig | nindent 4 }}
+{{- end }}
diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml
index a0c010b89..2150ed724 100644
--- a/k8s/charts/seaweedfs/values.yaml
+++ b/k8s/charts/seaweedfs/values.yaml
@@ -546,6 +546,19 @@ filer:
# Disable http request, only gRpc operations are allowed
disableHttp: false
+ # Add a custom notification.toml to configure filer notifications
+ # Example:
+ # notificationConfig: |-
+ # [notification.kafka]
+ # enabled = false
+ # hosts = [
+ # "localhost:9092"
+ # ]
+ # topic = "seaweedfs_filer"
+ # offsetFile = "./last.offset"
+ # offsetSaveIntervalSeconds = 10
+ notificationConfig: ""
+
# DEPRECATE: enablePVC, storage, storageClass
# Consider replacing with filer.data section below instead.