Skip to content

Commit

Permalink
feat: dynconfig (#27)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Nov 24, 2021
1 parent 3787bb4 commit 7245a3c
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 104 deletions.
15 changes: 8 additions & 7 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.20"
appVersion: "0.5.20"
version: "0.5.21"
appVersion: "0.5.21"
keywords:
- dragonfly
- d7y
Expand All @@ -18,21 +18,22 @@ sources:

annotations:
artifacthub.io/changes: |
- Update image version to v2.0.1-beta.4
- Update image version to v2.0.1-beta.5
- Dfdaemon get scheduler list from manager service
artifacthub.io/links: |
- name: Chart Source
url: https://github.com/dragonflyoss/helm-charts
- name: Source
url: https://github.com/dragonflyoss/Dragonfly2
artifacthub.io/images: |
- name: manager
image: dragonflyoss/manager:v2.0.1-beta.4
image: dragonflyoss/manager:v2.0.1-beta.5
- name: cdn
image: dragonflyoss/cdn:v2.0.1-beta.4
image: dragonflyoss/cdn:v2.0.1-beta.5
- name: dfdaemon
image: dragonflyoss/dfdaemon:v2.0.1-beta.4
image: dragonflyoss/dfdaemon:v2.0.1-beta.5
- name: scheduler
image: dragonflyoss/scheduler:v2.0.1-beta.4
image: dragonflyoss/scheduler:v2.0.1-beta.5
dependencies:
- name: mysql
Expand Down
25 changes: 14 additions & 11 deletions charts/dragonfly/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dragonfly Helm Chart

![Version: 0.5.20](https://img.shields.io/badge/Version-0.5.20-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.20](https://img.shields.io/badge/AppVersion-0.5.20-informational?style=flat-square)
![Version: 0.5.21](https://img.shields.io/badge/Version-0.5.21-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.21](https://img.shields.io/badge/AppVersion-0.5.21-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 @@ -173,7 +173,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-beta.4"` | Image tag |
| cdn.tag | string | `"v2.0.1-beta.5"` | 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 |
Expand Down Expand Up @@ -205,7 +205,11 @@ helm delete dragonfly --namespace dragonfly-system
| dfdaemon.config.download.totalRateLimit | string | `"200Mi"` | Total download limit per second |
| dfdaemon.config.gcInterval | string | `"1m0s"` | Daemon gc task running interval |
| dfdaemon.config.host.advertiseIP | string | `"0.0.0.0"` | Access ip for other peers when local ip is different with access ip, advertiseIP should be set |
| dfdaemon.config.host.idc | string | `""` | IDC deployed by daemon |
| dfdaemon.config.host.listenIP | string | `"0.0.0.0"` | TCP service listen address port should be set by other options |
| dfdaemon.config.host.location | string | `""` | Geographical location, separated by "|" characters |
| dfdaemon.config.host.netTopology | string | `""` | Network topology, separated by "|" characters |
| 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.pprofPort | int | `0` | |
Expand All @@ -217,8 +221,12 @@ 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.scheduler | object | `{"disableAutoBackSource":false}` | Scheduler config, netAddrs is auto-configured in templates/dfdaemon/dfdaemon-configmap.yaml |
| dfdaemon.config.scheduler | object | `{"disableAutoBackSource":false,"manager":{"addr":"","enable":true,"refreshInterval":"5m"},"scheduleTimeout":"30s"}` | Scheduler config, netAddrs is auto-configured in templates/dfdaemon/dfdaemon-configmap.yaml |
| dfdaemon.config.scheduler.disableAutoBackSource | bool | `false` | Disable auto back source in dfdaemon |
| dfdaemon.config.scheduler.manager.addr | string | `""` | Manager service address |
| dfdaemon.config.scheduler.manager.enable | bool | `true` | Get scheduler list dynamically from manager |
| dfdaemon.config.scheduler.manager.refreshInterval | string | `"5m"` | Scheduler list refresh interval |
| dfdaemon.config.scheduler.scheduleTimeout | string | `"30s"` | Schedule timeout |
| 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 |
Expand Down Expand Up @@ -247,7 +255,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-beta.4"` | Image tag |
| dfdaemon.tag | string | `"v2.0.1-beta.5"` | 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 |
Expand Down Expand Up @@ -305,7 +313,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-beta.4"` | Image tag |
| manager.tag | string | `"v2.0.1-beta.5"` | 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 |
Expand Down Expand Up @@ -360,13 +368,8 @@ helm delete dragonfly --namespace dragonfly-system
| scheduler.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
| 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.service | object | `{"annotations":{},"port":8002,"targetPort":8002,"type":"ClusterIP"}` | Service configuration |
| scheduler.service.annotations | object | `{}` | Service annotations |
| scheduler.service.port | int | `8002` | Service port |
| scheduler.service.targetPort | int | `8002` | Service targetPort |
| scheduler.service.type | string | `"ClusterIP"` | Service type |
| scheduler.statefulsetAnnotations | object | `{}` | Statefulset annotations |
| scheduler.tag | string | `"v2.0.1-beta.4"` | Image tag |
| scheduler.tag | string | `"v2.0.1-beta.5"` | Image tag |
| scheduler.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds |
| scheduler.tolerations | list | `[]` | List of node taints to tolerate |

Expand Down
24 changes: 7 additions & 17 deletions charts/dragonfly/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
1. [WIP] Get the scheduler URL by running these commands:
{{- if contains "NodePort" .Values.scheduler.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "dragonfly.scheduler.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.scheduler.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "dragonfly.scheduler.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "dragonfly.scheduler.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.scheduler.service.port }}
{{- else if contains "ClusterIP" .Values.scheduler.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "dragonfly.scheduler.fullname" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
1. Get the scheduler address by running these commands:
export SCHEDULER_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "dragonfly.fullname" . }},release={{ .Release.Name }},component=scheduler" -o jsonpath={.items[0].metadata.name})
export SCHEDULER_CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $SCHEDULER_POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
kubectl --namespace {{ .Release.Namespace }} port-forward $SCHEDULER_POD_NAME 8002:$SCHEDULER_CONTAINER_PORT
echo "Visit http://127.0.0.1:8002 to use your scheduler"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8002:$CONTAINER_PORT
{{- end }}

2. Get the dfdaemon port by running these commands:
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
You can use $CONTAINER_PORT as a proxy port in Node.
export DFDAEMON_POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ include "dragonfly.fullname" . }},release={{ .Release.Name }},component=dfdaemon" -o jsonpath={.items[0].metadata.name})
export DFDAEMON_CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $DFDAEMON_POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
You can use $DFDAEMON_CONTAINER_PORT as a proxy port in Node.

3. Configure runtime to use dragonfly:
https://github.com/dragonflyoss/Dragonfly2/blob/main/docs/en/user-guide/quick-start.md
Expand Down
18 changes: 11 additions & 7 deletions charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ data:
jaeger: http://jaeger-all-in-one-collector.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}:14268/api/traces
{{- end }}
scheduler:
netAddrs:
{{- $count := .Values.scheduler.replicas | int}}
{{- range $i, $x := until $count }}
- type: tcp
addr: {{template "dragonfly.scheduler.fullname" $ }}-{{$i}}.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}:{{ $.Values.scheduler.service.port }}
{{- end }}
scheduleTimeout: 5m
manager:
enable: {{ .Values.dfdaemon.config.scheduler.manager.enable }}
{{ if .Values.dfdaemon.config.scheduler.manager.addr }}
addr: {{ .Values.dfdaemon.config.scheduler.manager.addr }}
{{- else if .Values.manager.enable }}
addr: {{ template "dragonfly.manager.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.manager.grpcPort }}
{{- else }}
addr: {{ .Values.externalManager.host }}:{{ .Values.externalManager.grpcPort }}
{{- end }}
refreshInterval: {{ .Values.dfdaemon.config.scheduler.manager.refreshInterval }}
scheduleTimeout: {{ .Values.dfdaemon.config.scheduler.scheduleTimeout }}
disableAutoBackSource: {{ .Values.dfdaemon.config.scheduler.disableAutoBackSource }}
host:
{{ toYaml .Values.dfdaemon.config.host | indent 6 }}
Expand Down
48 changes: 0 additions & 48 deletions charts/dragonfly/templates/scheduler/scheduler-svc.yaml

This file was deleted.

35 changes: 21 additions & 14 deletions charts/dragonfly/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ scheduler:
# -- Image repository
image: dragonflyoss/scheduler
# -- Image tag
tag: v2.0.1-beta.4
tag: v2.0.1-beta.5
# -- Image pull policy
pullPolicy: IfNotPresent
# -- Host Aliases
Expand Down Expand Up @@ -168,16 +168,6 @@ scheduler:
tag: latest
# -- Container image pull policy
pullPolicy: IfNotPresent
# -- Service configuration
service:
# -- Service type
type: ClusterIP
# -- Service port
port: 8002
# -- Service targetPort
targetPort: 8002
# -- Service annotations
annotations: {}
config:
# -- Enable debug mode
debug: false
Expand Down Expand Up @@ -241,7 +231,7 @@ cdn:
# -- Image repository
image: dragonflyoss/cdn
# -- Image tag
tag: v2.0.1-beta.4
tag: v2.0.1-beta.5
# -- Image pull policy
pullPolicy: IfNotPresent
# -- Host Aliases
Expand Down Expand Up @@ -405,7 +395,7 @@ dfdaemon:
# -- Image repository
image: dragonflyoss/dfdaemon
# -- Image tag
tag: v2.0.1-beta.4
tag: v2.0.1-beta.5
# -- Image pull policy
pullPolicy: IfNotPresent
# -- Host Aliases
Expand Down Expand Up @@ -477,8 +467,25 @@ dfdaemon:
# -- Access ip for other peers
# when local ip is different with access ip, advertiseIP should be set
advertiseIP: 0.0.0.0
# -- Geographical location, separated by "|" characters
location: ""
# -- IDC deployed by daemon
idc: ""
# -- Security domain deployed by daemon, network isolation between different security domains
securityDomain: ""
# -- Network topology, separated by "|" characters
netTopology: ""
# -- Scheduler config, netAddrs is auto-configured in templates/dfdaemon/dfdaemon-configmap.yaml
scheduler:
manager:
# -- Get scheduler list dynamically from manager
enable: true
# -- Manager service address
addr: ""
# -- Scheduler list refresh interval
refreshInterval: 5m
# -- Schedule timeout
scheduleTimeout: 30s
# -- Disable auto back source in dfdaemon
disableAutoBackSource: false
download:
Expand Down Expand Up @@ -577,7 +584,7 @@ manager:
# -- Image repository
image: dragonflyoss/manager
# -- Image tag
tag: v2.0.1-beta.4
tag: v2.0.1-beta.5
# -- Image pull policy
pullPolicy: IfNotPresent
# -- Host Aliases
Expand Down

0 comments on commit 7245a3c

Please sign in to comment.