Do not run multiple Git-GC jobs concurrently
The CronJob managing Git-GC was configured to start up GC-jobs, even if
the previous job was still running. This could lead to multiple Jobs
being active at the same time, if the job creation failed, e.g. if
a volume attachment failed. This produces additional load to the
API-server and to too many pods wanting to attach the same volume.
This change configures the Git-GC CronJob to forbid concurrency. If
a job is still running, when a new run is scheduled, the next job will
be skipped.
Change-Id: I6fe01d76c2be1ab6b32a8b13d38c93228a891016
diff --git a/helm-charts/gerrit-replica/templates/git-gc.cronjob.yaml b/helm-charts/gerrit-replica/templates/git-gc.cronjob.yaml
index 81f6f1f..c608f6c 100644
--- a/helm-charts/gerrit-replica/templates/git-gc.cronjob.yaml
+++ b/helm-charts/gerrit-replica/templates/git-gc.cronjob.yaml
@@ -9,6 +9,7 @@
release: {{ .Release.Name }}
spec:
schedule: {{ .Values.gitGC.schedule | quote }}
+ concurrencyPolicy: "Forbid"
jobTemplate:
spec:
template:
diff --git a/helm-charts/gerrit/templates/git-gc.cronjob.yaml b/helm-charts/gerrit/templates/git-gc.cronjob.yaml
index 687e619..403735d 100644
--- a/helm-charts/gerrit/templates/git-gc.cronjob.yaml
+++ b/helm-charts/gerrit/templates/git-gc.cronjob.yaml
@@ -9,6 +9,7 @@
release: {{ .Release.Name }}
spec:
schedule: {{ .Values.gitGC.schedule | quote }}
+ concurrencyPolicy: "Forbid"
jobTemplate:
spec:
template: