diff --git a/charts/fission-all/templates/storagesvc/deployment.yaml b/charts/fission-all/templates/storagesvc/deployment.yaml index d46f5e78..be9dcfee 100644 --- a/charts/fission-all/templates/storagesvc/deployment.yaml +++ b/charts/fission-all/templates/storagesvc/deployment.yaml @@ -36,8 +36,12 @@ spec: args: ["--storageServicePort", "8000", "--storageType", "local"] {{- end }} env: + - name: PRUNE_ENABLED + value: "{{.Values.storagesvc.archivePruner.enabled}}" + {{- if .Values.storagesvc.archivePruner.enabled }} - name: PRUNE_INTERVAL - value: "{{.Values.pruneInterval}}" + value: "{{.Values.storagesvc.archivePruner.interval}}" + {{- end }} - name: DEBUG_ENV value: {{ .Values.debugEnv | quote }} - name: PPROF_ENABLED diff --git a/charts/fission-all/values.yaml b/charts/fission-all/values.yaml index 0106384b..5d911069 100644 --- a/charts/fission-all/values.yaml +++ b/charts/fission-all/values.yaml @@ -365,6 +365,12 @@ storagesvc: ## resources: {} + ## Archive pruner removes archives from storage which are not referenced by any package. + archivePruner: + enabled: true + ## Run prune routine at interval (in minutes) + interval: 60 + ## Security Context ## It holds pod-level and container level security configuration. ## This is an experimental section, please verify before enabling in production. @@ -567,7 +573,6 @@ busyboxImage: busybox ## This interval configures the frequency at which it runs inside the storagesvc pod. ## The value is in minutes. ## -pruneInterval: 60 preUpgradeChecks: ## Run pre-install/pre-upgrade checks if true diff --git a/pkg/storagesvc/storagesvc.go b/pkg/storagesvc/storagesvc.go index 53e3db64..c74538a1 100644 --- a/pkg/storagesvc/storagesvc.go +++ b/pkg/storagesvc/storagesvc.go @@ -236,7 +236,11 @@ func (ss *StorageService) Start(ctx context.Context, port int, openTracingEnable // Start runs storage service func Start(ctx context.Context, logger *zap.Logger, storage Storage, port int, openTracingEnabled bool) error { - enablePruner := true + enablePruner, err := strconv.ParseBool(os.Getenv("PRUNE_ENABLED")) + if err != nil { + logger.Warn("PRUNE_ENABLED value not set. Enabling archive pruner by default.", zap.Error(err)) + enablePruner = true + } // create a storage client storageClient, err := MakeStowClient(logger, storage) if err != nil { diff --git a/skaffold.yaml b/skaffold.yaml index 4923706e..fb7f6ac5 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -45,7 +45,8 @@ deploy: pprof.enabled: false canaryDeployment.enabled: false influxdb.enabled: false - pruneInterval: "60" + storagesvc.archivePruner.enabled: true + storagesvc.archivePruner.interval: "60" repository: index.docker.io routerServiceType: LoadBalancer openTracing.enabled: false @@ -102,7 +103,7 @@ profiles: path: /deploy/helm/releases/0/setValues/repository value: "" - op: replace - path: /deploy/helm/releases/0/setValues/pruneInterval + path: /deploy/helm/releases/0/setValues/storagesvc.archivePruner.interval value: 1 - op: replace path: /deploy/helm/releases/0/setValues/routerServiceType