From 7aed1e6612f7c11438f65cc888a50a7810c7e859 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Wed, 2 Oct 2024 07:24:54 -0700 Subject: [PATCH] Allow switching between Deployment and StatefulSet controllers --- charts/datahub-executor-worker/Chart.yaml | 2 +- .../templates/{statefulset.yaml => workload.yaml} | 5 ++++- charts/datahub-executor-worker/values.yaml | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) rename charts/datahub-executor-worker/templates/{statefulset.yaml => workload.yaml} (97%) diff --git a/charts/datahub-executor-worker/Chart.yaml b/charts/datahub-executor-worker/Chart.yaml index 807a3d8..d77e678 100644 --- a/charts/datahub-executor-worker/Chart.yaml +++ b/charts/datahub-executor-worker/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: datahub-executor-worker description: A Helm chart for datahub-executor-worker type: application -version: 0.0.7 +version: 0.0.8 appVersion: 0.0.1 maintainers: - name: DataHub diff --git a/charts/datahub-executor-worker/templates/statefulset.yaml b/charts/datahub-executor-worker/templates/workload.yaml similarity index 97% rename from charts/datahub-executor-worker/templates/statefulset.yaml rename to charts/datahub-executor-worker/templates/workload.yaml index 712c73e..75864aa 100644 --- a/charts/datahub-executor-worker/templates/statefulset.yaml +++ b/charts/datahub-executor-worker/templates/workload.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: {{ .Values.workloadKind }} metadata: name: {{ include "datahub-executor-worker.fullname" . }} labels: @@ -13,6 +13,9 @@ spec: matchLabels: {{- include "datahub-executor-worker.selectorLabels" . | nindent 6 }} {{- if .Values.persistentVolume.enabled }} + {{- if ne .Values.workloadKind "StatefulSet" }} + {{- fail "workloadKind must be set to StatefulSet when persistent volume is enabled" }} + {{- end }} volumeClaimTemplates: - metadata: {{- with .Values.persistentVolume.annotations }} diff --git a/charts/datahub-executor-worker/values.yaml b/charts/datahub-executor-worker/values.yaml index 766d004..102a5ba 100644 --- a/charts/datahub-executor-worker/values.yaml +++ b/charts/datahub-executor-worker/values.yaml @@ -12,6 +12,8 @@ global: monitors: max_workers: 10 +workloadKind: Deployment + replicaCount: 1 revisionHistoryLimit: 1 @@ -93,6 +95,7 @@ readinessProbe: timeoutSeconds: 5 persistentVolume: + # Requires workloadKind: StatefulSet enabled: false accessModes: - ReadWriteOnce