Skip to content

Commit

Permalink
feat: add initcontainer (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Sep 30, 2021
1 parent 2ae32fe commit 83e81c6
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 9 deletions.
7 changes: 3 additions & 4 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.4"
appVersion: "0.5.4"
version: "0.5.5"
appVersion: "0.5.5"
keywords:
- dragonfly
- d7y
Expand All @@ -18,8 +18,7 @@ sources:

annotations:
artifacthub.io/changes: |
- Skip inject hosts in host network
- Support skip tls verify in dfdaemon for testing
- Custom configuration with wait-for initcontainer
artifacthub.io/links: |
- name: Chart Source
url: https://github.com/dragonflyoss/helm-charts
Expand Down
11 changes: 10 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.4](https://img.shields.io/badge/Version-0.5.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.4](https://img.shields.io/badge/AppVersion-0.5.4-informational?style=flat-square)
![Version: 0.5.5](https://img.shields.io/badge/Version-0.5.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.5](https://img.shields.io/badge/AppVersion-0.5.5-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 @@ -129,6 +129,9 @@ helm delete dragonfly --namespace dragonfly-system
| cdn.enable | bool | `true` | Enable cdn |
| cdn.fullnameOverride | string | `""` | Override scheduler fullname |
| cdn.image | string | `"dragonflyoss/cdn"` | Image repository |
| cdn.initContainer.image | string | `"busybox"` | Init container image repository |
| cdn.initContainer.pullPolicy | string | `"IfNotPresent"` | Container image pull policy |
| cdn.initContainer.tag | string | `"latest"` | Init container image tag |
| cdn.name | string | `"cdn"` | CDN name |
| cdn.nameOverride | string | `""` | Override scheduler name |
| cdn.nginxContiainerPort | int | `8001` | Nginx containerPort for downloading |
Expand Down Expand Up @@ -232,6 +235,9 @@ helm delete dragonfly --namespace dragonfly-system
| manager.ingress.hosts | list | `[]` | Manager ingress hosts |
| manager.ingress.path | string | `"/"` | Ingress host path |
| manager.ingress.tls | list | `[]` | Ingress TLS configuration |
| manager.initContainer.image | string | `"busybox"` | Init container image repository |
| manager.initContainer.pullPolicy | string | `"IfNotPresent"` | Container image pull policy |
| manager.initContainer.tag | string | `"latest"` | Init container image tag |
| manager.name | string | `"manager"` | Manager name |
| manager.nameOverride | string | `""` | Override manager name |
| manager.nodeSelector | object | `{}` | Node labels for pod assignment |
Expand Down Expand Up @@ -271,6 +277,9 @@ helm delete dragonfly --namespace dragonfly-system
| scheduler.enable | bool | `true` | Enable scheduler |
| scheduler.fullnameOverride | string | `""` | Override scheduler fullname |
| scheduler.image | string | `"dragonflyoss/scheduler"` | Image repository |
| scheduler.initContainer.image | string | `"busybox"` | Init container image repository |
| scheduler.initContainer.pullPolicy | string | `"IfNotPresent"` | Container image pull policy |
| scheduler.initContainer.tag | string | `"latest"` | Init container image tag |
| scheduler.name | string | `"scheduler"` | Scheduler name |
| scheduler.nameOverride | string | `""` | Override scheduler name |
| scheduler.nodeSelector | object | `{}` | Node labels for pod assignment |
Expand Down
3 changes: 2 additions & 1 deletion charts/dragonfly/templates/cdn/cdn-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ spec:
{{- end }}
initContainers:
- name: wait-for-manager
image: busybox:latest
image: {{ .Values.cdn.initContainer.image }}:{{ .Values.cdn.initContainer.tag }}
imagePullPolicy: {{ .Values.cdn.initContainer.pullPolicy }}
{{- if .Values.manager.enable }}
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;']
{{- else }}
Expand Down
6 changes: 4 additions & 2 deletions charts/dragonfly/templates/manager/manager-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ spec:
initContainers:
{{- if .Values.redis.enable }}
- name: wait-for-redis
image: busybox:latest
image: {{ .Values.manager.initContainer.image }}:{{ .Values.manager.initContainer.tag }}
imagePullPolicy: {{ .Values.manager.initContainer.pullPolicy }}
command: ['sh', '-c', 'until nslookup {{ .Release.Name }}-{{ default "redis" .Values.redis.fullname }}-master.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }} && nc -vz {{ .Release.Name }}-{{ default "redis" .Values.redis.fullname }}-master.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }} {{ .Values.redis.service.port }}; do echo waiting for redis; sleep 2; done;']
{{- end }}
{{- if .Values.mysql.enable }}
- name: wait-for-mysql
image: busybox:latest
image: {{ .Values.manager.initContainer.image }}:{{ .Values.manager.initContainer.tag }}
imagePullPolicy: {{ .Values.manager.initContainer.pullPolicy }}
command: ['sh', '-c', 'until nslookup {{ .Release.Name }}-{{ default "mysql" .Values.mysql.fullname }}.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }} && nc -vz {{ .Release.Name }}-{{ default "mysql" .Values.mysql.fullname }}.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }} {{ .Values.mysql.primary.service.port }}; do echo waiting for mysql; sleep 2; done;']
{{- end }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ spec:
{{- end }}
initContainers:
- name: wait-for-manager
image: busybox:latest
image: {{ .Values.scheduler.initContainer.image }}:{{ .Values.scheduler.initContainer.tag }}
imagePullPolicy: {{ .Values.scheduler.initContainer.pullPolicy }}
{{- if .Values.manager.enable }}
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;']
{{- else }}
Expand Down
21 changes: 21 additions & 0 deletions charts/dragonfly/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ scheduler:
statefulsetAnnotations: {}
# -- Pod containerPort
containerPort: 8002
initContainer:
# -- Init container image repository
image: busybox
# -- Init container image tag
tag: latest
# -- Container image pull policy
pullPolicy: IfNotPresent
# -- Service configuration
service:
type: ClusterIP
Expand Down Expand Up @@ -202,6 +209,13 @@ cdn:
containerPort: 8003
# -- Nginx containerPort for downloading
nginxContiainerPort: 8001
initContainer:
# -- Init container image repository
image: busybox
# -- Init container image tag
tag: latest
# -- Container image pull policy
pullPolicy: IfNotPresent
# -- Service configuration
service:
type: ClusterIP
Expand Down Expand Up @@ -464,6 +478,13 @@ manager:
restPort: 8080
# -- GRPC service port
grpcPort: 65003
initContainer:
# -- Init container image repository
image: busybox
# -- Init container image tag
tag: latest
# -- Container image pull policy
pullPolicy: IfNotPresent
ingress:
# -- Enable ingress
enabled: false
Expand Down

0 comments on commit 83e81c6

Please sign in to comment.