Skip to content

Conversation

@simonswine
Copy link
Contributor

This is a lot more flexible than forcing the replica count to be either
4 or 16.

I have verified there are no other breaking changes:

$ helm template rustfs helm/rustfs > before.txt
$ helm template rustfs helm/rustfs > after.txt
$ diff -u before.txt after.txt
--- before.txt  2025-12-10 18:24:05
+++ after.txt   2025-12-10 18:24:11
@@ -128,17 +128,15 @@
             - sh
             - -c
             - |
-              if [ "$REPLICA_COUNT" -eq 4 ]; then
-                for i in $(seq 0 $(($REPLICA_COUNT - 1))); do
-                  mkdir -p /data/rustfs$i
-                done;
-              elif [ "$REPLICA_COUNT" -eq 16 ]; then
-                mkdir -p /data
-              fi
-
+              mkdir -p /data/rustfs0
+              mkdir -p /data/rustfs1
+              mkdir -p /data/rustfs2
+              mkdir -p /data/rustfs3
               chown -R 10001:10001 /data
               chown -R 10001:10001 /logs
           volumeMounts:
+            - name: logs
+              mountPath: /logs
             - name: data-rustfs-0
               mountPath: /data/rustfs0
             - name: data-rustfs-1
@@ -147,8 +145,6 @@
               mountPath: /data/rustfs2
             - name: data-rustfs-3
               mountPath: /data/rustfs3
-            - name: logs
-              mountPath: /logs
       containers:
         - name: rustfs
           image: "rustfs/rustfs:latest"
@@ -165,9 +161,6 @@
               name: endpoint
             - containerPort: 9001
               name: console
-          env:
-            - name: REPLICA_COUNT
-              value: "4"
           envFrom:
             - configMapRef:
                 name: rustfs-config

This is a lot more flexible than forcing the replica count to be either
4 or 16.

I have verified there are no other breaking changes:

```
$ helm template rustfs helm/rustfs > before.txt
$ helm template rustfs helm/rustfs > after.txt
$ diff -u before.txt after.txt
--- before.txt  2025-12-10 18:24:05
+++ after.txt   2025-12-10 18:24:11
@@ -128,17 +128,15 @@
             - sh
             - -c
             - |
-              if [ "$REPLICA_COUNT" -eq 4 ]; then
-                for i in $(seq 0 $(($REPLICA_COUNT - 1))); do
-                  mkdir -p /data/rustfs$i
-                done;
-              elif [ "$REPLICA_COUNT" -eq 16 ]; then
-                mkdir -p /data
-              fi
-
+              mkdir -p /data/rustfs0
+              mkdir -p /data/rustfs1
+              mkdir -p /data/rustfs2
+              mkdir -p /data/rustfs3
               chown -R 10001:10001 /data
               chown -R 10001:10001 /logs
           volumeMounts:
+            - name: logs
+              mountPath: /logs
             - name: data-rustfs-0
               mountPath: /data/rustfs0
             - name: data-rustfs-1
@@ -147,8 +145,6 @@
               mountPath: /data/rustfs2
             - name: data-rustfs-3
               mountPath: /data/rustfs3
-            - name: logs
-              mountPath: /logs
       containers:
         - name: rustfs
           image: "rustfs/rustfs:latest"
@@ -165,9 +161,6 @@
               name: endpoint
             - containerPort: 9001
               name: console
-          env:
-            - name: REPLICA_COUNT
-              value: "4"
           envFrom:
             - configMapRef:
                 name: rustfs-config
```
@CLAassistant
Copy link

CLAassistant commented Dec 10, 2025

CLA assistant check
All committers have signed the CLA.

@majinghe
Copy link
Contributor

majinghe commented Dec 11, 2025

@simonswine I reviewed the change which has different with our Rust Mode Setting. For helm installation, RustFS provides two mode

  • Standalone mode: one pod with one pvc, namely SNSD(single node single disk mode)

  • Distributed mode: MNMD(multiple node and multiple disk)

    • 4 pods with each pod has 4 pvc, totally 16 pvc
    • 16 pod with each pod has only 1 pvc, totally 16 pvc, so the below code
            {{- if gt (int .Values.volumesPerReplica) 1 }}
           {{- range $i := until (int .Values.volumesPerReplica) }}
           - name: data-rustfs-{{ $i }}
             mountPath: /data/rustfs{{ $i }}
           {{- end }}
           {{- else }}
           - name: data
             mountPath: /data
           {{- end }}
    

    means if the replicas is 16 and the pvc will also be 16, and totally pvc will be 16*16=256, that's not our exception.

@houseme houseme requested a review from majinghe December 11, 2025 07:21
@simonswine
Copy link
Contributor Author

I see what you are saying, I can fix this with a bit more defaulting, but what I am confused with is, what if I wanna run 8 replicas with two volumes (or any other number than is not 1-1, 4-4, 16-4 [replica-volumes]), is that be bad for performance or just right out broken?

@majinghe
Copy link
Contributor

majinghe commented Dec 11, 2025

@simonswine Good question, actually, 8 replicas are also fine, even other replicas( for example, 32 64) are also fine. As you know, MNMD mode has several node and disk combination, but helm chart can not cover all the combinations, so we just support two main combinations( 4 replicas and 16 replicas) which is used frequently. If the current helm chart can not satisfy the user's requirements, user should modify the helm chart locally, but we will not accept the change.

@majinghe majinghe mentioned this pull request Dec 12, 2025
2 tasks
@majinghe
Copy link
Contributor

@simonswine Hi, could y please fix the conflict?

@majinghe
Copy link
Contributor

@simonswine Could y pls help to handle the conflict?

@houseme
Copy link
Contributor

houseme commented Jan 2, 2026

@majinghe

@majinghe
Copy link
Contributor

majinghe commented Jan 2, 2026

@simonswine Good question, actually, 8 replicas are also fine, even other replicas( for example, 32 64) are also fine. As you know, MNMD mode has several node and disk combination, but helm chart can not cover all the combinations, so we just support two main combinations( 4 replicas and 16 replicas) which is used frequently. If the current helm chart can not satisfy the user's requirements, user should modify the helm chart locally, but we will not accept the change.

@simonswine Could y pls change the code according to this logic?

@houseme is our administration, he fix the conflicts, but i think the change code don't satisfy our requirement. If there is no any update, we will close PR due to it hangs on a long time. Thx.

@majinghe
Copy link
Contributor

majinghe commented Jan 4, 2026

@simonswine Due to the PR, there hasn't been any update for more than 3 weeks. We will close this PR. If you want to continue contributing with this PR, you can reopen it or create a new one. Thx again for you contributio.

@majinghe majinghe closed this Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants