From 6050e0c3aa4f7e61d008160a5d1cf5a43c147ef5 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 25 Oct 2025 20:30:25 -0700 Subject: [PATCH] address comments --- k8s/charts/seaweedfs/README.md | 7 ++-- .../templates/admin/admin-ingress.yaml | 2 +- .../templates/admin/admin-servicemonitor.yaml | 2 +- .../templates/admin/admin-statefulset.yaml | 2 +- .../templates/worker/worker-deployment.yaml | 2 +- .../worker/worker-servicemonitor.yaml | 1 + k8s/charts/seaweedfs/values.yaml | 37 +++++++++++++++++++ 7 files changed, 46 insertions(+), 7 deletions(-) diff --git a/k8s/charts/seaweedfs/README.md b/k8s/charts/seaweedfs/README.md index 32f814ab8..273f82e80 100644 --- a/k8s/charts/seaweedfs/README.md +++ b/k8s/charts/seaweedfs/README.md @@ -221,10 +221,11 @@ worker: adminServer: "seaweedfs-admin.:33646" # Workers need storage for task execution - # Note: Workers use Deployment, so they can't use dynamically provisioned PVCs - # Use emptyDir, hostPath, or existingClaim with a pre-provisioned PVC + # Note: Workers use a Deployment, which does not support `volumeClaimTemplates` + # for dynamic PVC creation per pod. To use persistent storage, you must + # pre-provision a PersistentVolumeClaim and use `type: "existingClaim"`. data: - type: "emptyDir" # Or "hostPath" or "existingClaim" + type: "emptyDir" # Options: "emptyDir", "hostPath", or "existingClaim" hostPathPrefix: /storage # For hostPath # claimName: "worker-pvc" # For existingClaim with pre-provisioned PVC diff --git a/k8s/charts/seaweedfs/templates/admin/admin-ingress.yaml b/k8s/charts/seaweedfs/templates/admin/admin-ingress.yaml index 45450e90d..ad222c704 100644 --- a/k8s/charts/seaweedfs/templates/admin/admin-ingress.yaml +++ b/k8s/charts/seaweedfs/templates/admin/admin-ingress.yaml @@ -42,4 +42,4 @@ spec: serviceName: {{ template "seaweedfs.name" . }}-admin servicePort: {{ .Values.admin.port }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/k8s/charts/seaweedfs/templates/admin/admin-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/admin/admin-servicemonitor.yaml index 4c2c0b162..271197a3a 100644 --- a/k8s/charts/seaweedfs/templates/admin/admin-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/admin/admin-servicemonitor.yaml @@ -30,4 +30,4 @@ spec: app.kubernetes.io/component: admin {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/k8s/charts/seaweedfs/templates/admin/admin-statefulset.yaml b/k8s/charts/seaweedfs/templates/admin/admin-statefulset.yaml index 671f6a81b..5b6757439 100644 --- a/k8s/charts/seaweedfs/templates/admin/admin-statefulset.yaml +++ b/k8s/charts/seaweedfs/templates/admin/admin-statefulset.yaml @@ -316,4 +316,4 @@ spec: storage: {{ .Values.admin.logs.size }} {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/k8s/charts/seaweedfs/templates/worker/worker-deployment.yaml b/k8s/charts/seaweedfs/templates/worker/worker-deployment.yaml index d5fb1f164..f7222857a 100644 --- a/k8s/charts/seaweedfs/templates/worker/worker-deployment.yaml +++ b/k8s/charts/seaweedfs/templates/worker/worker-deployment.yaml @@ -244,4 +244,4 @@ spec: nodeSelector: {{ tpl .Values.worker.nodeSelector . | indent 8 | trim }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/k8s/charts/seaweedfs/templates/worker/worker-servicemonitor.yaml b/k8s/charts/seaweedfs/templates/worker/worker-servicemonitor.yaml index 681128ee4..63ac3ba7a 100644 --- a/k8s/charts/seaweedfs/templates/worker/worker-servicemonitor.yaml +++ b/k8s/charts/seaweedfs/templates/worker/worker-servicemonitor.yaml @@ -32,3 +32,4 @@ spec: {{- end }} {{- end }} + diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml index 17e6b7931..b70a6b94d 100644 --- a/k8s/charts/seaweedfs/values.yaml +++ b/k8s/charts/seaweedfs/values.yaml @@ -1144,6 +1144,24 @@ admin: ## Set podManagementPolicy podManagementPolicy: Parallel + # Affinity Settings + # Commenting out or setting as empty the affinity variable, will allow + # deployment to single node services such as Minikube + affinity: | + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: + app.kubernetes.io/name: {{ template "seaweedfs.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: admin + topologyKey: kubernetes.io/hostname + + # Topology Spread Constraints Settings + # This should map directly to the value of the topologySpreadConstraints + # for a PodSpec. By Default no constraints are set. + topologySpreadConstraints: "" + resources: {} tolerations: "" nodeSelector: "" @@ -1243,6 +1261,25 @@ worker: podLabels: {} podAnnotations: {} annotations: {} + + # Affinity Settings + # Commenting out or setting as empty the affinity variable, will allow + # deployment to single node services such as Minikube + affinity: | + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: + app.kubernetes.io/name: {{ template "seaweedfs.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: worker + topologyKey: kubernetes.io/hostname + + # Topology Spread Constraints Settings + # This should map directly to the value of the topologySpreadConstraints + # for a PodSpec. By Default no constraints are set. + topologySpreadConstraints: "" + resources: requests: cpu: "500m"