Skip to content

Commit

Permalink
Merge pull request dragonflyoss#1 from dragonflyoss/feature/support-c…
Browse files Browse the repository at this point in the history
…luster-domain

Feature: support cluster domain
  • Loading branch information
gaius-qi authored Aug 20, 2021
2 parents 3623e15 + 46726f7 commit 7aa52a9
Show file tree
Hide file tree
Showing 20 changed files with 436 additions and 373 deletions.
14 changes: 8 additions & 6 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.1.0"
appVersion: "0.1.0"
version: "0.2.0"
appVersion: "0.2.0"
keywords:
- dragonfly
- d7y
Expand All @@ -20,20 +20,22 @@ annotations:
artifacthub.io/changes: |
- Upgrade to the latest template
- Support manager service
- Add manager ingress
- Support cluster domain
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: dragonflyoss/manager
image: dragonflyoss/manager:v0.1.0
image: dragonflyoss/manager:v0.2.0
- name: dragonflyoss/cdn
image: dragonflyoss/cdn:v0.1.0
image: dragonflyoss/cdn:v0.2.0
- name: dragonflyoss/dfdaemon
image: dragonflyoss/dfdaemon:v0.1.0
image: dragonflyoss/dfdaemon:v0.2.0
- name: dragonflyoss/scheduler
image: dragonflyoss/scheduler:v0.1.0
image: dragonflyoss/scheduler:v0.2.0
dependencies:
- name: mysql
Expand Down
21 changes: 14 additions & 7 deletions charts/dragonfly/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dragonfly Helm Chart

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.0](https://img.shields.io/badge/AppVersion-0.2.0-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 @@ -72,9 +72,10 @@ helm delete dragonfly
| 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 | `"v0.1.0"` | Image tag |
| cdn.tag | string | `"v0.2.0"` | 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 |
| dfdaemon.config.aliveTime | string | `"0s"` | Daemon alive time, when sets 0s, daemon will not auto exit, it is useful for longtime running |
| 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 |
Expand Down Expand Up @@ -117,21 +118,25 @@ helm delete dragonfly
| 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 | `"v0.1.0"` | Image tag |
| dfdaemon.tag | string | `"v0.2.0"` | Image tag |
| dfdaemon.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds |
| dfdaemon.tolerations | list | `[]` | List of node taints to tolerate |
| externalManager.enable | bool | `false` | Use external manager and disable internal manager |
| externalManager.grpcPort | int | `65003` | GRPC service port |
| externalManager.host | string | `""` | Manager hostname |
| externalManager.restPort | int | `8080` | REST service port |
| fullnameOverride | string | `""` | Override dragonfly fullname |
| installation.clusterDomain | string | `""` | Install application cluster domain |
| installation.jaeger | bool | `false` | Enable an all in one jaeger for tracing every downloading event should not use in production environment |
| jaeger.enable | bool | `false` | Enable an all in one jaeger for tracing every downloading event should not use in production environment |
| manager.deploymentAnnotations | object | `{}` | Deployment annotations |
| manager.enable | bool | `true` | Enable scheduler |
| manager.fullnameOverride | string | `""` | Override manager fullname |
| manager.grpcPort | int | `65003` | GRPC service port |
| manager.image | string | `"dragonflyoss/manager"` | Image repository |
| manager.ingress.annotations | object | `{}` | Ingress annotations |
| manager.ingress.enabled | bool | `false` | Enable ingress |
| manager.ingress.hosts | list | `[]` | Manager ingress hosts |
| manager.ingress.path | string | `"/"` | Ingress host path |
| manager.ingress.tls | list | `[]` | Ingress TLS configuration |
| manager.name | string | `"manager"` | Manager name |
| manager.nameOverride | string | `""` | Override manager name |
| manager.nodeSelector | object | `{}` | Node labels for pod assignment |
Expand All @@ -143,18 +148,20 @@ helm delete dragonfly
| manager.resources | object | `{"limits":{"cpu":"2","memory":"4Gi"},"requests":{"cpu":"0","memory":"0"}}` | Pod resource requests and limits |
| manager.restPort | int | `8080` | REST service port |
| manager.serviceAnnotations | object | `{}` | Service annotations |
| manager.tag | string | `"v0.1.0"` | Image tag |
| manager.tag | string | `"v0.2.0"` | 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 |
| mysql.auth.host | string | `""` | Mysql hostname |
| mysql.auth.password | string | `"dragonfly"` | Mysql password |
| mysql.auth.rootPassword | string | `"dragonfly-root"` | Mysql root password |
| mysql.auth.username | string | `"dragonfly"` | Mysql username |
| mysql.clusterDomain | string | `"cluster.local"` | Cluster domain |
| mysql.enable | bool | `true` | Enable mysql with docker container. if you want to use external mysql, please update enable to false |
| mysql.migrate | bool | `true` | Running GORM migration |
| mysql.primary.service.port | int | `3306` | Mysql port |
| nameOverride | string | `""` | Override dragonfly name |
| redis.clusterDomain | string | `"cluster.local"` | Cluster domain |
| redis.enable | bool | `true` | Enable redis cluster with docker container if you want to use external redis, please update enable to false |
| redis.host | string | `""` | Redis hostname |
| redis.password | string | `"dragonfly"` | Redis password |
Expand All @@ -181,7 +188,7 @@ helm delete dragonfly
| scheduler.service | object | `{"port":8002,"targetPort":8002,"type":"ClusterIP"}` | Service configuration |
| scheduler.serviceAnnotations | object | `{}` | Service annotations |
| scheduler.statefulsetAnnotations | object | `{}` | Statefulset annotations |
| scheduler.tag | string | `"v0.1.0"` | Image tag |
| scheduler.tag | string | `"v0.2.0"` | Image tag |
| scheduler.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds |
| scheduler.tolerations | list | `[]` | List of node taints to tolerate |

Expand Down
2 changes: 1 addition & 1 deletion charts/dragonfly/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

3. Configure runtime to use dragonfly:
https://github.com/dragonflyoss/Dragonfly2/blob/main/docs/en/user-guide/quick-start.md
{{ if .Values.installation.jaeger }}

{{ if .Values.jaeger.enable }}
4. Get Jaeger query URL by running these commands:
export JAEGER_QUERY_PORT=$(kubectl --namespace {{ .Release.Namespace }} get services jaeger-all-in-one-query -o jsonpath="{.spec.ports[0].port}")
export JAEGER_QUERY_POD=$(kubectl --namespace {{ .Release.Namespace }} get pod -l app.kubernetes.io/name=jaeger-all-in-one -o jsonpath='{range .items[*]}{.metadata.name}{end}' | head -n 1)
Expand Down
9 changes: 5 additions & 4 deletions charts/dragonfly/templates/cdn/cdn-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ metadata:
name: {{ template "dragonfly.cdn.fullname" . }}
labels:
app: {{ template "dragonfly.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ .Values.cdn.name }}
data:
cdn.yaml: |-
base:
Expand All @@ -28,7 +29,7 @@ data:
{{- if .Values.externalManager.enable }}
addr: {{ .Values.externalManager.host }}:{{ .Values.externalManager.grpcPort }}
{{- else }}
addr: {{ template "dragonfly.manager.fullname" . }}:{{ .Values.manager.grpcPort }}
addr: {{ template "dragonfly.manager.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.manager.grpcPort }}
{{- end }}
cdnClusterID: {{ .Values.cdn.config.base.manager.cdnClusterID }}
keepAlive:
Expand Down
16 changes: 8 additions & 8 deletions charts/dragonfly/templates/cdn/cdn-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: {{ template "dragonfly.cdn.fullname" . }}
app: {{ template "dragonfly.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: "{{ .Values.cdn.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ .Values.cdn.name }}
name: {{ template "dragonfly.cdn.fullname" . }}
{{- if .Values.cdn.statefulsetAnnotations }}
annotations:
Expand All @@ -17,15 +17,15 @@ spec:
replicas: {{ .Values.cdn.replicas }}
selector:
matchLabels:
app: {{ template "dragonfly.cdn.fullname" . }}
component: "{{ .Values.cdn.name }}"
app: {{ template "dragonfly.fullname" . }}
component: {{ .Values.cdn.name }}
release: {{ .Release.Name }}
serviceName: cdn
template:
metadata:
labels:
app: {{ template "dragonfly.cdn.fullname" . }}
component: "{{ .Values.cdn.name }}"
app: {{ template "dragonfly.fullname" . }}
component: {{ .Values.cdn.name }}
release: {{ .Release.Name }}
{{- if .Values.cdn.podLabels }}
{{ toYaml .Values.cdn.podLabels | indent 8 }}
Expand Down Expand Up @@ -59,7 +59,7 @@ spec:
{{- if .Values.externalManager.enable }}
command: ['sh', '-c', 'until nslookup {{ .Values.externalManager.host }} && nc -vz {{ .Values.externalManager.host }} {{ .Values.externalManager.restPort }}; do echo waiting for external manager; sleep 2; done;']
{{- else }}
command: ['sh', '-c', 'until nslookup {{ template "dragonfly.manager.fullname" . }} && nc -vz {{ template "dragonfly.manager.fullname" . }} {{ .Values.manager.restPort }}; do echo waiting for manager; sleep 2; done;']
command: ['sh', '-c', 'until nslookup {{ template "dragonfly.manager.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} && nc -vz {{ template "dragonfly.manager.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} {{ .Values.manager.restPort }}; do echo waiting for manager; sleep 2; done;']
{{- end }}
containers:
- name: cdn
Expand Down
13 changes: 7 additions & 6 deletions charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ metadata:
name: {{ template "dragonfly.dfdaemon.fullname" . }}
labels:
app: {{ template "dragonfly.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ .Values.dfdaemon.name }}
data:
dfget.yaml: |-
aliveTime: {{ .Values.dfdaemon.config.aliveTime }}
Expand All @@ -16,15 +17,15 @@ data:
verbose: {{ .Values.dfdaemon.config.verbose }}
{{- if .Values.dfdaemon.config.jaeger }}
jaeger: {{ .Values.dfdaemon.config.jaeger }}
{{- else if .Values.installation.jaeger }}
jaeger: http://jaeger-all-in-one-collector.{{ $.Release.Namespace }}.svc{{ $.Values.installation.clusterDomain }}:14268/api/traces
{{- else if .Values.jaeger.enable }}
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.installation.clusterDomain }}:{{ $.Values.scheduler.service.port }}
addr: {{template "dragonfly.scheduler.fullname" $ }}-{{$i}}.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}:{{ $.Values.scheduler.service.port }}
{{- end }}
scheduleTimeout: 5m
host:
Expand Down
10 changes: 5 additions & 5 deletions charts/dragonfly/templates/dfdaemon/dfdaemon-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ kind: DaemonSet
metadata:
name: {{ template "dragonfly.dfdaemon.fullname" . }}
labels:
app: {{ template "dragonfly.dfdaemon.fullname" . }}
app: {{ template "dragonfly.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: "{{ .Values.dfdaemon.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
component: {{ .Values.dfdaemon.name }}
{{- if .Values.dfdaemon.daemonsetAnnotations }}
annotations:
{{ toYaml .Values.dfdaemon.daemonsetAnnotations | indent 4 }}
{{- end }}
spec:
selector:
matchLabels:
app: {{ template "dragonfly.dfdaemon.fullname" . }}
app: {{ template "dragonfly.fullname" . }}
component: "{{ .Values.dfdaemon.name }}"
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "dragonfly.dfdaemon.fullname" . }}
app: {{ template "dragonfly.fullname" . }}
component: "{{ .Values.dfdaemon.name }}"
release: {{ .Release.Name }}
{{- if .Values.dfdaemon.podLabels }}
Expand Down
Loading

0 comments on commit 7aa52a9

Please sign in to comment.