From c4656a74b2a520302bb6bd427befcdb88b058208 Mon Sep 17 00:00:00 2001 From: kfox1111 Date: Wed, 10 May 2023 07:30:05 -0700 Subject: [PATCH] Replicas > 1 is not allowed with sqlite driver (#269) Co-authored-by: Faisal Memon Co-authored-by: Marco Franssen --- charts/spire/charts/spire-server/templates/hpa.yaml | 3 +++ charts/spire/charts/spire-server/templates/statefulset.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/charts/spire/charts/spire-server/templates/hpa.yaml b/charts/spire/charts/spire-server/templates/hpa.yaml index b68f878..921abf6 100644 --- a/charts/spire/charts/spire-server/templates/hpa.yaml +++ b/charts/spire/charts/spire-server/templates/hpa.yaml @@ -12,6 +12,9 @@ spec: kind: Deployment name: {{ include "spire-server.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} + {{- if and (eq .Values.dataStore.sql.databaseType "sqlite3") .Values.autoscaling.enabled (gt (int .Values.autoscaling.maxReplicas) 1) }} + {{- fail "When running with sqlite3 database, you can't scale up to more then one instance. 'autoscaling.maxReplicas' MUST be 1" }} + {{- end }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} diff --git a/charts/spire/charts/spire-server/templates/statefulset.yaml b/charts/spire/charts/spire-server/templates/statefulset.yaml index ab49400..c44a3d3 100644 --- a/charts/spire/charts/spire-server/templates/statefulset.yaml +++ b/charts/spire/charts/spire-server/templates/statefulset.yaml @@ -11,6 +11,9 @@ metadata: {{- include "spire-server.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} + {{- if and (eq .Values.dataStore.sql.databaseType "sqlite3") (gt (int .Values.replicaCount) 1) }} + {{- fail "When running with sqlite3 database, you can't scale up to more then one instance. 'replicaCount' MUST be 1" }} + {{- end }} replicas: {{ .Values.replicaCount }} {{- end }} serviceName: {{ include "spire-server.fullname" . }}