From 5d49bdd4262843d6db753a1724b254277b9dfa16 Mon Sep 17 00:00:00 2001 From: Gaius Date: Thu, 9 Dec 2021 17:07:38 +0800 Subject: [PATCH] feat: support custom directory configuration (#32) Signed-off-by: Gaius --- charts/dragonfly/Chart.yaml | 15 ++++++------ charts/dragonfly/README.md | 17 +++++++++----- .../templates/cdn/cdn-configmap.yaml | 1 + .../dfdaemon/dfdaemon-configmap.yaml | 5 ++-- .../dfdaemon/dfdaemon-daemonset.yaml | 4 ++-- .../scheduler/scheduler-configmap.yaml | 2 ++ charts/dragonfly/values.yaml | 23 ++++++++++++++----- 7 files changed, 44 insertions(+), 23 deletions(-) diff --git a/charts/dragonfly/Chart.yaml b/charts/dragonfly/Chart.yaml index 447b6710..26fa8583 100644 --- a/charts/dragonfly/Chart.yaml +++ b/charts/dragonfly/Chart.yaml @@ -3,8 +3,8 @@ name: dragonfly description: Dragonfly is an intelligent P2P based image and file distribution system icon: https://raw.githubusercontent.com/dragonflyoss/Dragonfly2/main/docs/en/images/logo/dragonfly.svg type: application -version: "0.5.24" -appVersion: "0.5.24" +version: "0.5.25" +appVersion: "0.5.25" keywords: - dragonfly - d7y @@ -18,7 +18,8 @@ sources: annotations: artifacthub.io/changes: | - - Update image version to v2.0.1 + - Update image version to v2.0.2-alpha.2 + - Support custom directory configuration artifacthub.io/links: | - name: Chart Source url: https://github.com/dragonflyoss/helm-charts @@ -26,13 +27,13 @@ annotations: url: https://github.com/dragonflyoss/Dragonfly2 artifacthub.io/images: | - name: manager - image: dragonflyoss/manager:v2.0.1 + image: dragonflyoss/manager:v2.0.2-alpha.2 - name: cdn - image: dragonflyoss/cdn:v2.0.1 + image: dragonflyoss/cdn:v2.0.2-alpha.2 - name: dfdaemon - image: dragonflyoss/dfdaemon:v2.0.1 + image: dragonflyoss/dfdaemon:v2.0.2-alpha.2 - name: scheduler - image: dragonflyoss/scheduler:v2.0.1 + image: dragonflyoss/scheduler:v2.0.2-alpha.2 dependencies: - name: mysql diff --git a/charts/dragonfly/README.md b/charts/dragonfly/README.md index 6c4d2948..a318a750 100644 --- a/charts/dragonfly/README.md +++ b/charts/dragonfly/README.md @@ -1,6 +1,6 @@ # Dragonfly Helm Chart -![Version: 0.5.24](https://img.shields.io/badge/Version-0.5.24-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.24](https://img.shields.io/badge/AppVersion-0.5.24-informational?style=flat-square) +![Version: 0.5.25](https://img.shields.io/badge/Version-0.5.25-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.25](https://img.shields.io/badge/AppVersion-0.5.25-informational?style=flat-square) Provide efficient, stable, secure, low-cost file and image distribution services to be the best practice and standard solution in the related Cloud-Native area. @@ -127,6 +127,7 @@ helm delete dragonfly --namespace dragonfly-system | cdn.config.base.gcInitialDelay | string | `"6s"` | Delay time from the start to the first GC execution | | cdn.config.base.gcMetaInterval | string | `"2m"` | Interval time to execute GC meta | | cdn.config.base.gcStorageInterval | string | `"15s"` | Interval time to execute GC storage | +| cdn.config.base.logDir | string | `""` | Log storage directory | | cdn.config.base.manager.cdnClusterID | int | `1` | Associated cdn cluster id | | cdn.config.base.manager.keepAlive.interval | string | `"5s"` | Manager keepalive interval | | cdn.config.base.maxBandwidth | string | `"200M"` | Network bandwidth that cdn can use | @@ -173,7 +174,7 @@ helm delete dragonfly --namespace dragonfly-system | cdn.resources | object | `{"limits":{"cpu":"4","memory":"8Gi"},"requests":{"cpu":"0","memory":"0"}}` | Pod resource requests and limits | | cdn.service | object | `{"extraPorts":[{"name":"http-nginx","port":8001,"targetPort":8001}],"port":8003,"targetPort":8003,"type":"ClusterIP"}` | Service configuration | | cdn.statefulsetAnnotations | object | `{}` | Statefulset annotations | -| cdn.tag | string | `"v2.0.1"` | Image tag | +| cdn.tag | string | `"v2.0.2-alpha.2"` | Image tag | | cdn.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds | | cdn.tolerations | list | `[]` | List of node taints to tolerate | | clusterDomain | string | `"cluster.local"` | Install application cluster domain | @@ -194,7 +195,7 @@ helm delete dragonfly --namespace dragonfly-system | containerRuntime.docker.skipHosts | list | `["127.0.0.1","docker.io"]` | Skip hosts Some traffic did not redirect to dragonfly, like 127.0.0.1, and the image registries of dragonfly itself. The format likes NO_PROXY in golang, refer: https://github.com/golang/net/blob/release-branch.go1.15/http/httpproxy/proxy.go#L39. Caution: Some registries use s3 or oss for backend storage, when add registries to skipHosts, don't forget add the corresponding backend storage. | | containerRuntime.initContainerImage | string | `"dragonflyoss/openssl"` | The image name of init container, need include openssl for ca generating | | dfdaemon.config.aliveTime | string | `"0s"` | Daemon alive time, when sets 0s, daemon will not auto exit, it is useful for longtime running | -| dfdaemon.config.dataDir | string | `"/root/.dragonfly/dfget-daemon/"` | Data directory | +| dfdaemon.config.cacheDir | string | `""` | Dynconfig cache storage directory | | dfdaemon.config.download.calculateDigest | bool | `true` | Calculate digest, when only pull images, can be false to save cpu and memory | | dfdaemon.config.download.downloadGRPC.security | object | `{"insecure":true}` | Download grpc security option | | dfdaemon.config.download.downloadGRPC.unixListen | object | `{"socket":"/tmp/dfdamon.sock"}` | Download service listen address current, only support unix domain socket | @@ -212,6 +213,7 @@ helm delete dragonfly --namespace dragonfly-system | dfdaemon.config.host.securityDomain | string | `""` | Security domain deployed by daemon, network isolation between different security domains | | dfdaemon.config.jaeger | string | `""` | Jaeger url, like: http://jaeger.dragonfly.svc:14268/api/traces | | dfdaemon.config.keepStorage | bool | `false` | When daemon exit, keep peer task data or not it is usefully when upgrade daemon service, all local cache will be saved default is false | +| dfdaemon.config.logDir | string | `""` | Log storage directory | | dfdaemon.config.pprofPort | int | `0` | | | dfdaemon.config.proxy.defaultFilter | string | `"Expires&Signature"` | Filter for hash url when defaultFilter: "Expires&Signature", for example: http://localhost/xyz?Expires=111&Signature=222 and http://localhost/xyz?Expires=333&Signature=999 is same task | | dfdaemon.config.proxy.proxies[0] | object | `{"regx":"blobs/sha256.*"}` | Proxy all http image layer download requests with dfget | @@ -236,6 +238,7 @@ helm delete dragonfly --namespace dragonfly-system | dfdaemon.config.upload.tcpListen.listen | string | `"0.0.0.0"` | Listen address | | dfdaemon.config.upload.tcpListen.port | int | `65002` | Listen port | | dfdaemon.config.verbose | bool | `true` | When enable, pprof will be enabled | +| dfdaemon.config.workHome | string | `"/usr/local/dragonfly"` | Daemon work directory | | dfdaemon.containerPort | int | `65001` | Pod containerPort | | dfdaemon.daemonsetAnnotations | object | `{}` | Daemonset annotations | | dfdaemon.enable | bool | `true` | Enable dfdaemon | @@ -255,7 +258,7 @@ helm delete dragonfly --namespace dragonfly-system | dfdaemon.priorityClassName | string | `""` | Pod priorityClassName | | dfdaemon.pullPolicy | string | `"IfNotPresent"` | Image pull policy | | dfdaemon.resources | object | `{"limits":{"cpu":"2","memory":"2Gi"},"requests":{"cpu":"0","memory":"0"}}` | Pod resource requests and limits | -| dfdaemon.tag | string | `"v2.0.1"` | Image tag | +| dfdaemon.tag | string | `"v2.0.2-alpha.2"` | Image tag | | dfdaemon.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds | | dfdaemon.tolerations | list | `[]` | List of node taints to tolerate | | externalManager.grpcPort | int | `65003` | External GRPC service port | @@ -313,7 +316,7 @@ helm delete dragonfly --namespace dragonfly-system | manager.service.annotations | object | `{}` | Service annotations | | manager.service.labels | object | `{}` | Service labels | | manager.service.type | string | `"ClusterIP"` | Service type | -| manager.tag | string | `"v2.0.1"` | Image tag | +| manager.tag | string | `"v2.0.2-alpha.2"` | Image tag | | manager.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds | | manager.tolerations | list | `[]` | List of node taints to tolerate | | mysql.auth.database | string | `"manager"` | Mysql database name | @@ -337,6 +340,8 @@ helm delete dragonfly --namespace dragonfly-system | scheduler.config.jaeger | string | `""` | Jaeger url, like: http://jaeger.dragonfly.svc:14268/api/traces | | scheduler.config.manager.keepAlive.interval | string | `"5s"` | Manager keepalive interval | | scheduler.config.manager.schedulerClusterID | int | `1` | Associated scheduler cluster id | +| scheduler.config.server.cacheDir | string | `""` | Dynconfig cache storage directory | +| scheduler.config.server.logDir | string | `""` | Log storage directory | | scheduler.config.worker | object | `{"senderJobPoolSize":10000,"senderNum":10,"workerJobPoolSize":10000,"workerNum":4}` | Scheduling queue configuration | | scheduler.containerPort | int | `8002` | Pod containerPort | | scheduler.enable | bool | `true` | Enable scheduler | @@ -369,7 +374,7 @@ helm delete dragonfly --namespace dragonfly-system | scheduler.replicas | int | `3` | Number of Pods to launch | | scheduler.resources | object | `{"limits":{"cpu":"4","memory":"8Gi"},"requests":{"cpu":"0","memory":"0"}}` | Pod resource requests and limits | | scheduler.statefulsetAnnotations | object | `{}` | Statefulset annotations | -| scheduler.tag | string | `"v2.0.1"` | Image tag | +| scheduler.tag | string | `"v2.0.2-alpha.2"` | Image tag | | scheduler.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds | | scheduler.tolerations | list | `[]` | List of node taints to tolerate | diff --git a/charts/dragonfly/templates/cdn/cdn-configmap.yaml b/charts/dragonfly/templates/cdn/cdn-configmap.yaml index a9e00e71..0ffe0de7 100644 --- a/charts/dragonfly/templates/cdn/cdn-configmap.yaml +++ b/charts/dragonfly/templates/cdn/cdn-configmap.yaml @@ -23,6 +23,7 @@ data: gcStorageInterval: {{ .Values.cdn.config.base.gcStorageInterval }} taskExpireTime: {{ .Values.cdn.config.base.taskExpireTime }} storagePattern: {{ .Values.cdn.config.base.storagePattern }} + logDir: {{ .Values.cdn.config.base.logDir }} nodeSelector: {{ toYaml .Values.cdn.nodeSelector | indent 8 }} manager: diff --git a/charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml b/charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml index c5acf6f8..90a83489 100644 --- a/charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml +++ b/charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml @@ -14,8 +14,9 @@ data: aliveTime: {{ .Values.dfdaemon.config.aliveTime }} gcInterval: {{ .Values.dfdaemon.config.gcInterval }} keepStorage: {{ .Values.dfdaemon.config.keepStorage }} - dataDir: {{ .Values.dfdaemon.config.dataDir }} - workDir: {{ .Values.dfdaemon.config.dataDir }} + workHome: {{ .Values.dfdaemon.config.workHome }} + cacheDir: {{ .Values.dfdaemon.config.cacheDir }} + logDir: {{ .Values.dfdaemon.config.logDir }} verbose: {{ .Values.dfdaemon.config.verbose }} {{- if .Values.dfdaemon.config.verbose }} pprof-port: {{ .Values.dfdaemon.config.pprofPort }} diff --git a/charts/dragonfly/templates/dfdaemon/dfdaemon-daemonset.yaml b/charts/dragonfly/templates/dfdaemon/dfdaemon-daemonset.yaml index b5f8cc5d..e923ee40 100644 --- a/charts/dragonfly/templates/dfdaemon/dfdaemon-daemonset.yaml +++ b/charts/dragonfly/templates/dfdaemon/dfdaemon-daemonset.yaml @@ -130,7 +130,7 @@ spec: - name: run mountPath: /run/dragonfly - name: data - mountPath: {{ .Values.dfdaemon.config.dataDir }} + mountPath: {{ .Values.dfdaemon.config.workHome }} securityContext: capabilities: add: @@ -501,7 +501,7 @@ spec: - name: data {{- if .Values.dfdaemon.mountDataDirAsHostPath }} hostPath: - path: {{ .Values.dfdaemon.config.dataDir }} + path: {{ .Values.dfdaemon.config.workHome }} type: DirectoryOrCreate {{- else }} emptyDir: {} diff --git a/charts/dragonfly/templates/scheduler/scheduler-configmap.yaml b/charts/dragonfly/templates/scheduler/scheduler-configmap.yaml index 2b5db752..08be068c 100644 --- a/charts/dragonfly/templates/scheduler/scheduler-configmap.yaml +++ b/charts/dragonfly/templates/scheduler/scheduler-configmap.yaml @@ -14,6 +14,8 @@ data: deubug: {{ .Values.scheduler.config.debug }} server: port: {{ .Values.scheduler.containerPort }} + cacheDir: {{ .Values.scheduler.config.cacheDir }} + logDir: {{ .Values.scheduler.config.logDir }} worker: {{ toYaml .Values.scheduler.config.worker | indent 6 }} dynconfig: diff --git a/charts/dragonfly/values.yaml b/charts/dragonfly/values.yaml index 86764252..83816b75 100644 --- a/charts/dragonfly/values.yaml +++ b/charts/dragonfly/values.yaml @@ -124,7 +124,7 @@ scheduler: # -- Image repository image: dragonflyoss/scheduler # -- Image tag - tag: v2.0.1 + tag: v2.0.2-alpha.2 # -- Image pull policy pullPolicy: IfNotPresent # -- Host Aliases @@ -171,6 +171,11 @@ scheduler: config: # -- Enable debug mode debug: false + server: + # -- Dynconfig cache storage directory + cacheDir: "" + # -- Log storage directory + logDir: "" # -- Scheduling queue configuration worker: workerNum: 4 @@ -231,7 +236,7 @@ cdn: # -- Image repository image: dragonflyoss/cdn # -- Image tag - tag: v2.0.1 + tag: v2.0.2-alpha.2 # -- Image pull policy pullPolicy: IfNotPresent # -- Host Aliases @@ -324,6 +329,8 @@ cdn: taskExpireTime: 3m # -- Pattern of storage policy storagePattern: disk + # -- Log storage directory + logDir: "" manager: # -- Associated cdn cluster id cdnClusterID: 1 @@ -395,7 +402,7 @@ dfdaemon: # -- Image repository image: dragonflyoss/dfdaemon # -- Image tag - tag: v2.0.1 + tag: v2.0.2-alpha.2 # -- Image pull policy pullPolicy: IfNotPresent # -- Host Aliases @@ -453,8 +460,12 @@ dfdaemon: # it is usefully when upgrade daemon service, all local cache will be saved # default is false keepStorage: false - # -- Data directory - dataDir: /root/.dragonfly/dfget-daemon/ + # -- Daemon work directory + workHome: "/usr/local/dragonfly" + # -- Dynconfig cache storage directory + cacheDir: "" + # -- Log storage directory + logDir: "" # -- When enable, pprof will be enabled verbose: true pprofPort: 0 @@ -584,7 +595,7 @@ manager: # -- Image repository image: dragonflyoss/manager # -- Image tag - tag: v2.0.1 + tag: v2.0.2-alpha.2 # -- Image pull policy pullPolicy: IfNotPresent # -- Host Aliases