From 9b00782e104cfcfef3c7a37eb90de560010e061f Mon Sep 17 00:00:00 2001 From: Arlan Lloyd Date: Sun, 22 Dec 2024 10:17:38 +0000 Subject: [PATCH 1/3] Allow specifying strategy for deployments --- chart/templates/autosync/deployment.yaml | 3 +++ chart/templates/back/deployment.yaml | 3 +++ chart/templates/front/deployment.yaml | 3 +++ chart/templates/matcher/deployment.yaml | 3 +++ chart/templates/scanner/deployment.yaml | 3 +++ chart/templates/transcoder/deployment.yaml | 3 +++ chart/values.yaml | 8 ++++++++ 7 files changed, 26 insertions(+) diff --git a/chart/templates/autosync/deployment.yaml b/chart/templates/autosync/deployment.yaml index 1b05144f..e37fefca 100644 --- a/chart/templates/autosync/deployment.yaml +++ b/chart/templates/autosync/deployment.yaml @@ -12,6 +12,9 @@ metadata: {{- include "kyoo.labels" (dict "context" . "component" .Values.autosync.name "name" .Values.autosync.name) | nindent 4 }} spec: replicas: {{ .Values.autosync.replicaCount }} + {{- with .Values.autosync.updateStrategy }} + strategy: {{ . }} + {{- end }} selector: matchLabels: {{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.autosync.name) | nindent 6 }} diff --git a/chart/templates/back/deployment.yaml b/chart/templates/back/deployment.yaml index 5eb0593f..72257ee7 100644 --- a/chart/templates/back/deployment.yaml +++ b/chart/templates/back/deployment.yaml @@ -12,6 +12,9 @@ metadata: {{- include "kyoo.labels" (dict "context" . "component" .Values.back.name "name" .Values.back.name) | nindent 4 }} spec: replicas: {{ .Values.back.replicaCount }} + {{- with .Values.back.updateStrategy }} + strategy: {{ . }} + {{- end }} selector: matchLabels: {{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.back.name) | nindent 6 }} diff --git a/chart/templates/front/deployment.yaml b/chart/templates/front/deployment.yaml index c3945736..c278c5f0 100644 --- a/chart/templates/front/deployment.yaml +++ b/chart/templates/front/deployment.yaml @@ -12,6 +12,9 @@ metadata: {{- include "kyoo.labels" (dict "context" . "component" .Values.front.name "name" .Values.front.name) | nindent 4 }} spec: replicas: {{ .Values.front.replicaCount }} + {{- with .Values.front.updateStrategy }} + strategy: {{ . }} + {{- end }} selector: matchLabels: {{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.front.name) | nindent 6 }} diff --git a/chart/templates/matcher/deployment.yaml b/chart/templates/matcher/deployment.yaml index 32d0906a..a5d21302 100644 --- a/chart/templates/matcher/deployment.yaml +++ b/chart/templates/matcher/deployment.yaml @@ -12,6 +12,9 @@ metadata: {{- include "kyoo.labels" (dict "context" . "component" .Values.matcher.name "name" .Values.matcher.name) | nindent 4 }} spec: replicas: {{ .Values.matcher.replicaCount }} + {{- with .Values.matcher.updateStrategy }} + strategy: {{ . }} + {{- end }} selector: matchLabels: {{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.matcher.name) | nindent 6 }} diff --git a/chart/templates/scanner/deployment.yaml b/chart/templates/scanner/deployment.yaml index 893a6983..f8fa13dd 100644 --- a/chart/templates/scanner/deployment.yaml +++ b/chart/templates/scanner/deployment.yaml @@ -12,6 +12,9 @@ metadata: {{- include "kyoo.labels" (dict "context" . "component" .Values.scanner.name "name" .Values.scanner.name) | nindent 4 }} spec: replicas: {{ .Values.scanner.replicaCount }} + {{- with .Values.scanner.updateStrategy }} + strategy: {{ . }} + {{- end }} selector: matchLabels: {{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.scanner.name) | nindent 6 }} diff --git a/chart/templates/transcoder/deployment.yaml b/chart/templates/transcoder/deployment.yaml index f7d2d0f6..495a1cbb 100644 --- a/chart/templates/transcoder/deployment.yaml +++ b/chart/templates/transcoder/deployment.yaml @@ -12,6 +12,9 @@ metadata: {{- include "kyoo.labels" (dict "context" . "component" .Values.transcoder.name "name" .Values.transcoder.name) | nindent 4 }} spec: replicas: {{ .Values.transcoder.replicaCount }} + {{- with .Values.transcoder.updateStrategy }} + strategy: {{ . }} + {{- end }} selector: matchLabels: {{- include "kyoo.selectorLabels" (dict "context" . "name" .Values.transcoder.name) | nindent 6 }} diff --git a/chart/values.yaml b/chart/values.yaml index 6e07bbd7..4c054954 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -179,6 +179,7 @@ autosync: repository: ~ tag: ~ replicaCount: 1 + updateStrategy: ~ podLabels: {} deploymentAnnotations: {} podAnnotations: {} @@ -227,6 +228,8 @@ back: persistentVolumeClaim: claimName: back-storage replicaCount: 1 + # default to recreate for better user experience with ReadWriteOnce volumes + updateStrategy: Recreate podLabels: {} deploymentAnnotations: {} podAnnotations: {} @@ -260,6 +263,7 @@ front: repository: ~ tag: ~ replicaCount: 1 + updateStrategy: ~ podLabels: {} deploymentAnnotations: {} podAnnotations: {} @@ -298,6 +302,7 @@ matcher: tag: ~ # matcher does not support multiple replicas replicaCount: 1 + updateStrategy: ~ podLabels: {} deploymentAnnotations: {} podAnnotations: {} @@ -328,6 +333,7 @@ scanner: tag: ~ # scanner does not support multiple replicas replicaCount: 1 + updateStrategy: ~ podLabels: {} deploymentAnnotations: {} podAnnotations: {} @@ -368,6 +374,8 @@ transcoder: - name: cache emptyDir: {} replicaCount: 1 + # default to recreate for better user experience with ReadWriteOnce volumes + updateStrategy: Recreate podLabels: {} deploymentAnnotations: {} podAnnotations: {} From fbb0d7b581c4fab10959ad78456a9855642ce04c Mon Sep 17 00:00:00 2001 From: Arlan Lloyd Date: Sun, 22 Dec 2024 22:02:31 +0000 Subject: [PATCH 2/3] fix strategy spec --- chart/templates/transcoder/deployment.yaml | 3 ++- chart/values.yaml | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/chart/templates/transcoder/deployment.yaml b/chart/templates/transcoder/deployment.yaml index 495a1cbb..be58b1d6 100644 --- a/chart/templates/transcoder/deployment.yaml +++ b/chart/templates/transcoder/deployment.yaml @@ -13,7 +13,8 @@ metadata: spec: replicas: {{ .Values.transcoder.replicaCount }} {{- with .Values.transcoder.updateStrategy }} - strategy: {{ . }} + strategy: + {{- toYaml . | nindent 4 }} {{- end }} selector: matchLabels: diff --git a/chart/values.yaml b/chart/values.yaml index 4c054954..6f99c4f3 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -229,7 +229,8 @@ back: claimName: back-storage replicaCount: 1 # default to recreate for better user experience with ReadWriteOnce volumes - updateStrategy: Recreate + updateStrategy: + type: Recreate podLabels: {} deploymentAnnotations: {} podAnnotations: {} @@ -375,7 +376,8 @@ transcoder: emptyDir: {} replicaCount: 1 # default to recreate for better user experience with ReadWriteOnce volumes - updateStrategy: Recreate + updateStrategy: + type: Recreate podLabels: {} deploymentAnnotations: {} podAnnotations: {} From 1a2b922c162010ca0c05855537375520a2190235 Mon Sep 17 00:00:00 2001 From: Arlan Lloyd Date: Sun, 22 Dec 2024 22:06:23 +0000 Subject: [PATCH 3/3] applying fix to other deployments --- chart/templates/autosync/deployment.yaml | 3 ++- chart/templates/back/deployment.yaml | 3 ++- chart/templates/front/deployment.yaml | 3 ++- chart/templates/matcher/deployment.yaml | 3 ++- chart/templates/scanner/deployment.yaml | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/chart/templates/autosync/deployment.yaml b/chart/templates/autosync/deployment.yaml index e37fefca..d2151e4a 100644 --- a/chart/templates/autosync/deployment.yaml +++ b/chart/templates/autosync/deployment.yaml @@ -13,7 +13,8 @@ metadata: spec: replicas: {{ .Values.autosync.replicaCount }} {{- with .Values.autosync.updateStrategy }} - strategy: {{ . }} + strategy: + {{- toYaml . | nindent 4 }} {{- end }} selector: matchLabels: diff --git a/chart/templates/back/deployment.yaml b/chart/templates/back/deployment.yaml index 72257ee7..bd8b88a0 100644 --- a/chart/templates/back/deployment.yaml +++ b/chart/templates/back/deployment.yaml @@ -13,7 +13,8 @@ metadata: spec: replicas: {{ .Values.back.replicaCount }} {{- with .Values.back.updateStrategy }} - strategy: {{ . }} + strategy: + {{- toYaml . | nindent 4 }} {{- end }} selector: matchLabels: diff --git a/chart/templates/front/deployment.yaml b/chart/templates/front/deployment.yaml index c278c5f0..fbbf597b 100644 --- a/chart/templates/front/deployment.yaml +++ b/chart/templates/front/deployment.yaml @@ -13,7 +13,8 @@ metadata: spec: replicas: {{ .Values.front.replicaCount }} {{- with .Values.front.updateStrategy }} - strategy: {{ . }} + strategy: + {{- toYaml . | nindent 4 }} {{- end }} selector: matchLabels: diff --git a/chart/templates/matcher/deployment.yaml b/chart/templates/matcher/deployment.yaml index a5d21302..bb569ed9 100644 --- a/chart/templates/matcher/deployment.yaml +++ b/chart/templates/matcher/deployment.yaml @@ -13,7 +13,8 @@ metadata: spec: replicas: {{ .Values.matcher.replicaCount }} {{- with .Values.matcher.updateStrategy }} - strategy: {{ . }} + strategy: + {{- toYaml . | nindent 4 }} {{- end }} selector: matchLabels: diff --git a/chart/templates/scanner/deployment.yaml b/chart/templates/scanner/deployment.yaml index f8fa13dd..080845fa 100644 --- a/chart/templates/scanner/deployment.yaml +++ b/chart/templates/scanner/deployment.yaml @@ -13,7 +13,8 @@ metadata: spec: replicas: {{ .Values.scanner.replicaCount }} {{- with .Values.scanner.updateStrategy }} - strategy: {{ . }} + strategy: + {{- toYaml . | nindent 4 }} {{- end }} selector: matchLabels: