1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2025-09-08 12:22:46 +02:00

Compare commits

...

5 commits
3.97 ... master

Author SHA1 Message Date
David Jansen
63f4bc64a3
fix: helm chart with COSI deployment enabled breaks on helm upgrade (#7201)
the `helm.sh/chart` line with the changing version number breaks helm upgrades to due to `matchLabels` being immutable.

drop the offending line as it does not belong into the `matchLabels`
2025-09-05 10:16:22 -07:00
Dmitriy Pavlov
0ac3c65480
revert changes collectStatForOneVolume (#7199) 2025-09-05 06:37:05 -07:00
Benjamin Reed
b3b1316b54
fix missing support for .Values.global.repository (#7195)
* fix missing support for .Values.global.repository

* rework based on gemini feedback to handle repository+imageName more cleanly

* use base rather than last + splitList
2025-09-04 22:28:21 -07:00
Dmitriy Pavlov
cd78e653e1
add disable volume_growth flag (#7196) 2025-09-04 05:39:56 -07:00
Cristian Chiru
e030530aab
Fix volume annotations in volume-servicemonitor.yaml (#7193)
* Update volume annotations in servicemonitor.yaml

* Idiomatic annotations handling in volume-servicemonitor.yaml
2025-09-03 00:34:39 -07:00
10 changed files with 33 additions and 9 deletions

View file

@ -15,7 +15,6 @@ spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: objectstorage-provisioner
template:

View file

@ -96,13 +96,16 @@ Inject extra environment vars in the format key:value, if populated
{{/* Computes the container image name for all components (if they are not overridden) */}}
{{- define "common.image" -}}
{{- $registryName := default .Values.image.registry .Values.global.registry | toString -}}
{{- $repositoryName := .Values.image.repository | toString -}}
{{- $repositoryName := default .Values.image.repository .Values.global.repository | toString -}}
{{- $name := .Values.global.imageName | toString -}}
{{- $tag := default .Chart.AppVersion .Values.image.tag | toString -}}
{{- if $repositoryName -}}
{{- $name = printf "%s/%s" (trimSuffix "/" $repositoryName) (base $name) -}}
{{- end -}}
{{- if $registryName -}}
{{- printf "%s/%s%s:%s" $registryName $repositoryName $name $tag -}}
{{- printf "%s/%s:%s" $registryName $name $tag -}}
{{- else -}}
{{- printf "%s%s:%s" $repositoryName $name $tag -}}
{{- printf "%s:%s" $name $tag -}}
{{- end -}}
{{- end -}}

View file

@ -21,9 +21,9 @@ metadata:
{{- with $.Values.global.monitoring.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.volume.annotations }}
{{- with $volume.annotations }}
annotations:
{{- toYaml .Values.volume.annotations | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:

View file

@ -3,6 +3,7 @@
global:
createClusterRole: true
registry: ""
# if repository is set, it overrides the namespace part of imageName
repository: ""
imageName: chrislusf/seaweedfs
imagePullPolicy: IfNotPresent

View file

@ -50,6 +50,7 @@ copy_2 = 6 # create 2 x 6 = 12 actual volumes
copy_3 = 3 # create 3 x 3 = 9 actual volumes
copy_other = 1 # create n x 1 = n actual volumes
threshold = 0.9 # create threshold
disable = false # disables volume growth if true
# configuration flags for replication
[master.replication]

View file

@ -89,7 +89,7 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequest
for time.Now().Sub(startTime) < maxTimeout {
fid, count, dnList, shouldGrow, err := ms.Topo.PickForWrite(req.Count, option, vl)
if shouldGrow && !vl.HasGrowRequest() {
if shouldGrow && !vl.HasGrowRequest() && !ms.option.VolumeGrowthDisabled {
if err != nil && ms.Topo.AvailableSpaceFor(option) <= 0 {
err = fmt.Errorf("%s and no free volumes left for %s", err.Error(), option.String())
}

View file

@ -28,6 +28,10 @@ const (
)
func (ms *MasterServer) DoAutomaticVolumeGrow(req *topology.VolumeGrowRequest) {
if ms.option.VolumeGrowthDisabled {
glog.V(1).Infof("automatic volume grow disabled")
return
}
glog.V(1).Infoln("starting automatic volume grow")
start := time.Now()
newVidLocations, err := ms.vg.AutomaticGrowByType(req.Option, ms.grpcDialOption, ms.Topo, req.Count)

View file

@ -57,6 +57,7 @@ type MasterOption struct {
IsFollower bool
TelemetryUrl string
TelemetryEnabled bool
VolumeGrowthDisabled bool
}
type MasterServer struct {
@ -105,6 +106,9 @@ func NewMasterServer(r *mux.Router, option *MasterOption, peers map[string]pb.Se
v.SetDefault("master.volume_growth.copy_3", topology.VolumeGrowStrategy.Copy3Count)
v.SetDefault("master.volume_growth.copy_other", topology.VolumeGrowStrategy.CopyOtherCount)
v.SetDefault("master.volume_growth.threshold", topology.VolumeGrowStrategy.Threshold)
v.SetDefault("master.volume_growth.disable", false)
option.VolumeGrowthDisabled = v.GetBool("master.volume_growth.disable")
topology.VolumeGrowStrategy.Copy1Count = v.GetUint32("master.volume_growth.copy_1")
topology.VolumeGrowStrategy.Copy2Count = v.GetUint32("master.volume_growth.copy_2")
topology.VolumeGrowStrategy.Copy3Count = v.GetUint32("master.volume_growth.copy_3")

View file

@ -142,7 +142,7 @@ func (ms *MasterServer) dirAssignHandler(w http.ResponseWriter, r *http.Request)
for time.Since(startTime) < maxTimeout {
fid, count, dnList, shouldGrow, err := ms.Topo.PickForWrite(requestedCount, option, vl)
if shouldGrow && !vl.HasGrowRequest() {
if shouldGrow && !vl.HasGrowRequest() && !ms.option.VolumeGrowthDisabled {
glog.V(0).Infof("dirAssign volume growth %v from %v", option.String(), r.RemoteAddr)
if err != nil && ms.Topo.AvailableSpaceFor(option) <= 0 {
err = fmt.Errorf("%s and no free volumes left for %s", err.Error(), option.String())

View file

@ -250,7 +250,19 @@ func collectStatForOneVolume(vid needle.VolumeId, v *Volume) (s *VolumeInfo) {
DiskId: v.diskId,
}
s.RemoteStorageName, s.RemoteStorageKey = v.RemoteStorageNameKey()
s.Size, _, _ = v.FileStat()
v.dataFileAccessLock.RLock()
defer v.dataFileAccessLock.RUnlock()
if v.nm == nil {
return
}
s.FileCount = v.nm.FileCount()
s.DeleteCount = v.nm.DeletedCount()
s.DeletedByteCount = v.nm.DeletedSize()
s.Size = v.nm.ContentSize()
return
}