From d450e581a6c4c96cefe5fb61ce3a874a6f2da9ff Mon Sep 17 00:00:00 2001 From: Gaius Date: Fri, 19 Jan 2024 11:48:46 +0800 Subject: [PATCH] feat: add updateStrategy to client, manager, scheduler, seed-client and seed-peer (#230) Signed-off-by: Gaius --- charts/dragonfly/Chart.yaml | 4 ++-- charts/dragonfly/README.md | 8 +++++++- .../templates/client/client-daemonset.yaml | 4 ++++ .../templates/manager/manager-deployment.yaml | 3 +++ .../scheduler/scheduler-statefulset.yaml | 4 ++++ .../seed-client/seed-client-statefulset.yaml | 4 ++++ .../seed-peer/seed-peer-statefulset.yaml | 4 ++++ .../templates/trainer/trainer-deployment.yaml | 3 +++ charts/dragonfly/values.yaml | 16 +++++++++++++++- 9 files changed, 46 insertions(+), 4 deletions(-) diff --git a/charts/dragonfly/Chart.yaml b/charts/dragonfly/Chart.yaml index 969dd2c6..63436639 100644 --- a/charts/dragonfly/Chart.yaml +++ b/charts/dragonfly/Chart.yaml @@ -3,7 +3,7 @@ name: dragonfly description: Dragonfly is an intelligent P2P based image and file distribution system icon: https://raw.githubusercontent.com/dragonflyoss/Dragonfly2/main/docs/images/logo/dragonfly.svg type: application -version: 1.1.26 +version: 1.1.27 appVersion: 2.1.30 keywords: - dragonfly @@ -26,7 +26,7 @@ sources: annotations: artifacthub.io/changes: | - - add updateStrategy support for dfdaemon + - Add updateStrategy to client, manager, scheduler, seed-client and seed-peer. artifacthub.io/links: | - name: Chart Source diff --git a/charts/dragonfly/README.md b/charts/dragonfly/README.md index cd678dcc..23e3e57c 100644 --- a/charts/dragonfly/README.md +++ b/charts/dragonfly/README.md @@ -187,6 +187,7 @@ helm delete dragonfly --namespace dragonfly-system | client.tag | string | `"v0.1.13"` | Image tag. | | client.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds. | | client.tolerations | list | `[]` | List of node taints to tolerate. | +| client.updateStrategy | object | `{}` | Update strategy for replicas. | | clusterDomain | string | `"cluster.local"` | Install application cluster domain. | | containerRuntime | object | `{"containerd":{"configFileName":"","configPathDir":"/etc/containerd","enable":false,"injectConfigPath":false,"injectRegistryCredencials":{"auth":"","enable":false,"identitytoken":"","password":"","username":""},"registries":["https://ghcr.io","https://quay.io","https://harbor.example.com:8443"]},"crio":{"enable":false,"registries":["https://ghcr.io","https://quay.io","https://harbor.example.com:8443"]},"docker":{"caCert":{"commonName":"Dragonfly Authority CA","countryName":"CN","localityName":"Hangzhou","organizationName":"Dragonfly","stateOrProvinceName":"Hangzhou"},"enable":false,"injectHosts":true,"insecure":false,"registryDomains":["ghcr.io","quay.io"],"registryPorts":[443],"restart":false,"skipHosts":["127.0.0.1","docker.io"]},"extraInitContainers":[],"initContainerImage":"dragonflyoss/openssl"}` | [Experimental] Container runtime support. Choose special container runtime in Kubernetes. Support: Containerd, Docker, CRI-O. | | containerRuntime.containerd | object | `{"configFileName":"","configPathDir":"/etc/containerd","enable":false,"injectConfigPath":false,"injectRegistryCredencials":{"auth":"","enable":false,"identitytoken":"","password":"","username":""},"registries":["https://ghcr.io","https://quay.io","https://harbor.example.com:8443"]}` | [Experimental] Containerd support. | @@ -309,7 +310,7 @@ helm delete dragonfly --namespace dragonfly-system | dfdaemon.tag | string | `"v2.1.30"` | Image tag. | | dfdaemon.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds. | | dfdaemon.tolerations | list | `[]` | List of node taints to tolerate. | -| dfdaemon.updateStrategy | object | `{}` | updateStrategy config for dfdaemon. | +| dfdaemon.updateStrategy | object | `{}` | Update strategy for replicas. | | externalManager.grpcPort | int | `65003` | External GRPC service port. | | externalManager.host | string | `nil` | External manager hostname. | | externalManager.restPort | int | `8080` | External REST service port. | @@ -420,6 +421,7 @@ helm delete dragonfly --namespace dragonfly-system | manager.tag | string | `"v2.1.30"` | Image tag. | | manager.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds. | | manager.tolerations | list | `[]` | List of node taints to tolerate. | +| manager.updateStrategy | object | `{"type":"RollingUpdate"}` | Update strategy for replicas. | | mysql.auth.database | string | `"manager"` | Mysql database name. | | mysql.auth.host | string | `""` | Mysql hostname. | | mysql.auth.password | string | `"dragonfly"` | Mysql password. | @@ -524,6 +526,7 @@ helm delete dragonfly --namespace dragonfly-system | scheduler.tag | string | `"v2.1.30"` | Image tag. | | scheduler.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds. | | scheduler.tolerations | list | `[]` | List of node taints to tolerate. | +| scheduler.updateStrategy | object | `{}` | Update strategy for replicas. | | seedClient.config.download.concurrentPieceCount | int | `10` | concurrentPieceCount is the number of concurrent pieces to download. | | seedClient.config.download.pieceTimeout | string | `"30s"` | pieceTimeout is the timeout for downloading a piece from source. | | seedClient.config.download.server.socketPath | string | `"/var/run/dragonfly/dfdaemon.sock"` | socketPath is the unix socket path for dfdaemon GRPC service. | @@ -590,6 +593,7 @@ helm delete dragonfly --namespace dragonfly-system | seedClient.tag | string | `"v0.1.13"` | Image tag. | | seedClient.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds. | | seedClient.tolerations | list | `[]` | List of node taints to tolerate. | +| seedClient.updateStrategy | object | `{}` | Update strategy for replicas. | | seedPeer.config.aliveTime | string | `"0s"` | Daemon alive time, when sets 0s, daemon will not auto exit, it is useful for longtime running. | | seedPeer.config.announcer.schedulerInterval | string | `"30s"` | schedulerInterval is the interval of announcing scheduler. Announcer will provide the scheduler with peer information for scheduling. Peer information includes cpu, memory, etc. | | seedPeer.config.cacheDir | string | `""` | Dynconfig cache directory. | @@ -692,6 +696,7 @@ helm delete dragonfly --namespace dragonfly-system | seedPeer.tag | string | `"v2.1.30"` | Image tag. | | seedPeer.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds. | | seedPeer.tolerations | list | `[]` | List of node taints to tolerate. | +| seedPeer.updateStrategy | object | `{}` | Update strategy for replicas. | | trainer.config.console | bool | `false` | Console shows log on console. | | trainer.config.jaeger | string | `""` | | | trainer.config.manager.Addr | string | `"127.0.0.1:65003"` | Manager Service Address. | @@ -751,6 +756,7 @@ helm delete dragonfly --namespace dragonfly-system | trainer.tag | string | `"v2.1.30"` | Image tag. | | trainer.terminationGracePeriodSeconds | string | `nil` | Pod terminationGracePeriodSeconds. | | trainer.tolerations | list | `[]` | List of node taints to tolerate. | +| trainer.updateStrategy | object | `{"type":"RollingUpdate"}` | Update strategy for replicas. | | triton.aws | object | `{"accessKeyID":"","region":"","secretAccessKey":""}` | Credentials information. | | triton.enable | bool | `false` | Enable triton. | | triton.fullnameOverride | string | `""` | Override triton fullname. | diff --git a/charts/dragonfly/templates/client/client-daemonset.yaml b/charts/dragonfly/templates/client/client-daemonset.yaml index 8f2618b4..86c29f6b 100644 --- a/charts/dragonfly/templates/client/client-daemonset.yaml +++ b/charts/dragonfly/templates/client/client-daemonset.yaml @@ -15,6 +15,10 @@ metadata: {{ toYaml .Values.client.daemonsetAnnotations | indent 4 }} {{- end }} spec: + {{- if .Values.client.updateStrategy }} + updateStrategy: +{{ toYaml .Values.client.updateStrategy | indent 4 }} + {{- end }} selector: matchLabels: app: {{ template "dragonfly.fullname" . }} diff --git a/charts/dragonfly/templates/manager/manager-deployment.yaml b/charts/dragonfly/templates/manager/manager-deployment.yaml index aed21f7a..31678f93 100644 --- a/charts/dragonfly/templates/manager/manager-deployment.yaml +++ b/charts/dragonfly/templates/manager/manager-deployment.yaml @@ -15,6 +15,9 @@ metadata: {{ toYaml .Values.manager.deploymentAnnotations | indent 4 }} {{- end }} spec: + {{- if .Values.manager.updateStrategy }} + strategy: {{- toYaml .Values.manager.updateStrategy | nindent 4 }} + {{- end }} replicas: {{ .Values.manager.replicas }} selector: matchLabels: diff --git a/charts/dragonfly/templates/scheduler/scheduler-statefulset.yaml b/charts/dragonfly/templates/scheduler/scheduler-statefulset.yaml index ffd33ad2..71b8251b 100644 --- a/charts/dragonfly/templates/scheduler/scheduler-statefulset.yaml +++ b/charts/dragonfly/templates/scheduler/scheduler-statefulset.yaml @@ -15,6 +15,10 @@ metadata: {{ toYaml .Values.scheduler.statefulsetAnnotations | indent 4 }} {{- end }} spec: + {{- if .Values.scheduler.updateStrategy }} + updateStrategy: +{{ toYaml .Values.scheduler.updateStrategy | indent 4 }} + {{- end }} replicas: {{ .Values.scheduler.replicas }} selector: matchLabels: diff --git a/charts/dragonfly/templates/seed-client/seed-client-statefulset.yaml b/charts/dragonfly/templates/seed-client/seed-client-statefulset.yaml index 971c212c..25a60198 100644 --- a/charts/dragonfly/templates/seed-client/seed-client-statefulset.yaml +++ b/charts/dragonfly/templates/seed-client/seed-client-statefulset.yaml @@ -15,6 +15,10 @@ metadata: {{ toYaml .Values.seedClient.statefulsetAnnotations | indent 4 }} {{- end }} spec: + {{- if .Values.seedClient.updateStrategy }} + updateStrategy: +{{ toYaml .Values.seedClient.updateStrategy | indent 4 }} + {{- end }} replicas: {{ .Values.seedClient.replicas }} selector: matchLabels: diff --git a/charts/dragonfly/templates/seed-peer/seed-peer-statefulset.yaml b/charts/dragonfly/templates/seed-peer/seed-peer-statefulset.yaml index 1eeb72a5..927df921 100644 --- a/charts/dragonfly/templates/seed-peer/seed-peer-statefulset.yaml +++ b/charts/dragonfly/templates/seed-peer/seed-peer-statefulset.yaml @@ -15,6 +15,10 @@ metadata: {{ toYaml .Values.seedPeer.statefulsetAnnotations | indent 4 }} {{- end }} spec: + {{- if .Values.seedPeer.updateStrategy }} + updateStrategy: +{{ toYaml .Values.seedPeer.updateStrategy | indent 4 }} + {{- end }} replicas: {{ .Values.seedPeer.replicas }} selector: matchLabels: diff --git a/charts/dragonfly/templates/trainer/trainer-deployment.yaml b/charts/dragonfly/templates/trainer/trainer-deployment.yaml index 5ce598ea..b499402c 100644 --- a/charts/dragonfly/templates/trainer/trainer-deployment.yaml +++ b/charts/dragonfly/templates/trainer/trainer-deployment.yaml @@ -15,6 +15,9 @@ metadata: {{ toYaml .Values.trainer.deploymentAnnotations | indent 4 }} {{- end }} spec: + {{- if .Values.trainer.updateStrategy }} + strategy: {{- toYaml .Values.trainer.updateStrategy | nindent 4 }} + {{- end }} replicas: {{ .Values.trainer.replicas }} selector: matchLabels: diff --git a/charts/dragonfly/values.yaml b/charts/dragonfly/values.yaml index a3f5312a..a7dbd837 100644 --- a/charts/dragonfly/values.yaml +++ b/charts/dragonfly/values.yaml @@ -173,6 +173,9 @@ manager: podAnnotations: {} # -- Pod labels. podLabels: {} + # -- Update strategy for replicas. + updateStrategy: + type: RollingUpdate # -- Deployment annotations. deploymentAnnotations: {} # -- Extra volumes for manager. @@ -453,6 +456,8 @@ scheduler: podAnnotations: {} # -- Pod labels. podLabels: {} + # -- Update strategy for replicas. + updateStrategy: {} # -- Statefulset annotations. statefulsetAnnotations: {} # -- Pod containerPort. @@ -819,6 +824,8 @@ seedClient: podAnnotations: {} # -- Pod labels. podLabels: {} + # -- Update strategy for replicas. + updateStrategy: {} # -- Statefulset annotations. statefulsetAnnotations: {} initContainer: @@ -1021,6 +1028,8 @@ client: podAnnotations: {} # -- Pod labels. podLabels: {} + # -- Update strategy for replicas. + updateStrategy: {} # -- Statefulset annotations. statefulsetAnnotations: {} initContainer: @@ -1196,6 +1205,8 @@ seedPeer: podAnnotations: {} # -- Pod labels. podLabels: {} + # -- Update strategy for replicas. + updateStrategy: {} # -- Statefulset annotations. statefulsetAnnotations: {} initContainer: @@ -1542,7 +1553,7 @@ dfdaemon: podAnnotations: {} # -- Pod labels. podLabels: {} - # -- updateStrategy config for dfdaemon. + # -- Update strategy for replicas. updateStrategy: {} # -- Daemonset annotations. daemonsetAnnotations: {} @@ -1985,6 +1996,9 @@ trainer: podAnnotations: {} # -- Pod labels. podLabels: {} + # -- Update strategy for replicas. + updateStrategy: + type: RollingUpdate # -- Deployment annotations. deploymentAnnotations: {} # -- Pod containerPort.