add standalone mode support (#881)

* add standalone mode support

* update readme file

* change non-root from 1000 to 10001

* delete self sign crt content

* modify security content

* fix synatx error for readme file.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* update image repository and tag info.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix helm chart syntax issue.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix helm chart syntax issue.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: loverustfs <hello@rustfs.com>
This commit is contained in:
majinghe
2025-11-19 13:56:21 +08:00
committed by GitHub
parent a13ce08590
commit 44f3f3d070
10 changed files with 183 additions and 31 deletions
+96
View File
@@ -0,0 +1,96 @@
{{- if .Values.mode.standalone.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "rustfs.fullname" . }}
labels:
app: {{ include "rustfs.name" . }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ include "rustfs.name" . }}
template:
metadata:
labels:
app: {{ include "rustfs.name" . }}
spec:
{{- if .Values.podSecurityContext }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 12 }}
{{- end }}
initContainers:
- name: init-step
image: busybox
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
runAsUser: 0
runAsGroup: 0
command:
- sh
- -c
- |
mkdir -p /data /logs
chown -R 10001:10001 /data /logs
volumeMounts:
- name: data
mountPath: /data
- name: logs
mountPath: /logs
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
command: ["/usr/bin/rustfs"]
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.containerSecurityContext }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.service.ep_port }}
name: endpoint
- containerPort: {{ .Values.service.console_port }}
name: console
envFrom:
- configMapRef:
name: {{ include "rustfs.fullname" . }}-config
- secretRef:
name: {{ include "rustfs.fullname" . }}-secret
resources:
requests:
memory: {{ .Values.resources.requests.memory }}
cpu: {{ .Values.resources.requests.cpu }}
limits:
memory: {{ .Values.resources.limits.memory }}
cpu: {{ .Values.resources.limits.cpu }}
livenessProbe:
httpGet:
path: /health
port: 9000
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 9000
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 3
volumeMounts:
- name: logs
mountPath: /logs
- name: data
mountPath: /data
volumes:
- name: logs
persistentVolumeClaim:
claimName: {{ include "rustfs.fullname" . }}-logs
- name: data
persistentVolumeClaim:
claimName: {{ include "rustfs.fullname" . }}-data
{{- end }}