Skip to content

Commit

Permalink
chore: support customize data directory (#18)
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <[email protected]>
  • Loading branch information
jim3ma authored Oct 13, 2021
1 parent a1af3bc commit 0505d31
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
7 changes: 4 additions & 3 deletions charts/dragonfly/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.11"
appVersion: "0.5.11"
version: "0.5.12"
appVersion: "0.5.12"
keywords:
- dragonfly
- d7y
Expand All @@ -18,7 +18,8 @@ sources:

annotations:
artifacthub.io/changes: |
- Drop injected hosts before stop daemonset
- Support customize data directory in dfdaemon
- Enable default disk GC Threshold
artifacthub.io/links: |
- name: Chart Source
url: https://github.com/dragonflyoss/helm-charts
Expand Down
5 changes: 4 additions & 1 deletion charts/dragonfly/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dragonfly Helm Chart

![Version: 0.5.11](https://img.shields.io/badge/Version-0.5.11-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.11](https://img.shields.io/badge/AppVersion-0.5.11-informational?style=flat-square)
![Version: 0.5.12](https://img.shields.io/badge/Version-0.5.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.12](https://img.shields.io/badge/AppVersion-0.5.12-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.

Expand Down Expand Up @@ -191,6 +191,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.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 |
| dfdaemon.config.download.peerGRPC.security | object | `{"insecure":true}` | Peer grpc security option |
Expand All @@ -209,6 +210,7 @@ helm delete dragonfly --namespace dragonfly-system
| dfdaemon.config.proxy.security | object | `{"insecure":true}` | Proxy security option |
| dfdaemon.config.proxy.tcpListen.listen | string | `"0.0.0.0"` | Listen address |
| dfdaemon.config.proxy.tcpListen.namespace | string | `"/run/dragonfly/net"` | Namespace stands the linux net namespace, like /proc/1/ns/net it's useful for running daemon in pod with ip allocated and listening the special port in host net namespace Linux only |
| dfdaemon.config.storage.diskGCThreshold | string | `"50Gi"` | Disk GC Threshold |
| dfdaemon.config.storage.multiplex | bool | `true` | Set to ture for reusing underlying storage for same task id |
| dfdaemon.config.storage.strategy | string | `"io.d7y.storage.v2.simple"` | Storage strategy when process task data io.d7y.storage.v2.simple : download file to data directory first, then copy to output path, this is default action the download file in date directory will be the peer data for uploading to other peers io.d7y.storage.v2.advance: download file directly to output path with postfix, hard link to final output, avoid copy to output path, fast than simple strategy, but: the output file with postfix will be the peer data for uploading to other peers when user delete or change this file, this peer data will be corrupted default is io.d7y.storage.v2.advance |
| dfdaemon.config.storage.taskExpireTime | string | `"3m0s"` | Task data expire time when there is no access to a task data, this task will be gc. |
Expand All @@ -225,6 +227,7 @@ helm delete dragonfly --namespace dragonfly-system
| dfdaemon.hostNetwork | bool | `false` | Using hostNetwork when pod with host network can communicate with normal pods with cni network |
| dfdaemon.hostPort | int | `65001` | When .hostNetwork == false, and .config.proxy.tcpListen.namespace is empty many network add-ons do not yet support hostPort https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm/#hostport-services-do-not-work by default, dfdaemon injects the 65001 port to host network by sharing host network namespace, if you want to use hostPort, please empty .config.proxy.tcpListen.namespace below, and keep .hostNetwork == false for performance, injecting the 65001 port to host network is better than hostPort |
| dfdaemon.image | string | `"dragonflyoss/dfdaemon"` | Image repository |
| dfdaemon.mountDataDirAsHostPath | bool | `false` | Mount data directory from host when enabled, mount host path to dfdaemon, or just emptyDir in dfdaemon |
| dfdaemon.name | string | `"dfdaemon"` | Dfdaemon name |
| dfdaemon.nameOverride | string | `""` | Override dfdaemon name |
| dfdaemon.nodeSelector | object | `{}` | Node labels for pod assignment |
Expand Down
2 changes: 2 additions & 0 deletions charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ 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 }}
verbose: {{ .Values.dfdaemon.config.verbose }}
{{- if .Values.dfdaemon.config.jaeger }}
jaeger: {{ .Values.dfdaemon.config.jaeger }}
Expand Down
10 changes: 10 additions & 0 deletions charts/dragonfly/templates/dfdaemon/dfdaemon-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ spec:
{{- if and (not .Values.dfdaemon.hostNetwork) .Values.dfdaemon.config.proxy.tcpListen.namespace }}
- name: run
mountPath: /run/dragonfly
- name: data
mountPath: {{ .Values.dfdaemon.config.dataDir }}
securityContext:
capabilities:
add:
Expand Down Expand Up @@ -489,4 +491,12 @@ spec:
hostPath:
path: /etc
{{- end }}
- name: data
{{- if .Values.dfdaemon.mountDataDirAsHostPath }}
hostPath:
path: {{ .Values.dfdaemon.config.dataDir }}
type: DirectoryOrCreate
{{- else }}
emptyDir: {}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/dragonfly/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ dfdaemon:
hostPort: 65001
# -- Using hostNetwork when pod with host network can communicate with normal pods with cni network
hostNetwork: false
# -- Mount data directory from host
# when enabled, mount host path to dfdaemon, or just emptyDir in dfdaemon
mountDataDirAsHostPath: false
config:
# -- Daemon alive time, when sets 0s, daemon will not auto exit, it is useful for longtime running
aliveTime: 0s
Expand All @@ -435,6 +438,8 @@ 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/
# -- When enable, pprof will be enabled
verbose: true
# -- Jaeger url, like: http://jaeger.dragonfly.svc:14268/api/traces
Expand Down Expand Up @@ -492,6 +497,8 @@ dfdaemon:
strategy: io.d7y.storage.v2.simple
# -- Set to ture for reusing underlying storage for same task id
multiplex: true
# -- Disk GC Threshold
diskGCThreshold: 50Gi
proxy:
# -- Filter for hash url
# when defaultFilter: "Expires&Signature", for example:
Expand Down

0 comments on commit 0505d31

Please sign in to comment.