Skip to content

Commit

Permalink
fix(gitlab): allow specifying custom compute resources for cron jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaliske committed Jan 17, 2024
1 parent d7809f4 commit 8dac412
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions charts/gitlab/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v2
type: application
name: gitlab
description: A Helm chart for GitLab Omnibus
version: 3.1.0
version: 3.1.1
# renovate: image=gitlab/gitlab-ce
appVersion: "16.7.3-ce.0"

Expand All @@ -25,5 +25,5 @@ dependencies:

annotations:
artifacthub.io/changes: |
- kind: added
description: 'Automate registry garbage collection via cron job.'
- kind: fixed
description: 'Allow specifying custom compute resources for cron jobs.'
4 changes: 3 additions & 1 deletion charts/gitlab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> A Helm chart for GitLab Omnibus
[![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ](https://charts.pascaliske.dev/charts/gitlab/)[![Version: 3.1.0](https://img.shields.io/badge/Version-3.1.0-informational?style=flat-square) ](https://charts.pascaliske.dev/charts/gitlab/)[![AppVersion: 16.7.3-ce.0](https://img.shields.io/badge/AppVersion-16.7.3--ce.0-informational?style=flat-square) ](https://charts.pascaliske.dev/charts/gitlab/)
[![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ](https://charts.pascaliske.dev/charts/gitlab/)[![Version: 3.1.1](https://img.shields.io/badge/Version-3.1.1-informational?style=flat-square) ](https://charts.pascaliske.dev/charts/gitlab/)[![AppVersion: 16.7.3-ce.0](https://img.shields.io/badge/AppVersion-16.7.3--ce.0-informational?style=flat-square) ](https://charts.pascaliske.dev/charts/gitlab/)

* <https://github.com/pascaliske/helm-charts>
* <https://docs.gitlab.com>
Expand Down Expand Up @@ -44,6 +44,7 @@ The following values can be used to adjust the helm chart.
| backups.cronJob.enabled | bool | `false` | Create a `CronJob` object for automated backups. |
| backups.cronJob.failedJobsHistoryLimit | int | `1` | The number of failed finished jobs to retain. |
| backups.cronJob.labels | object | `{}` | Additional labels for the cronjob object. |
| backups.cronJob.resources | object | `{}` | Compute resources used by the container inside the cronjob. More info [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). |
| backups.cronJob.schedule | string | `"0 3 * * 1"` | Schedule for automated backups. |
| backups.cronJob.successfulJobsHistoryLimit | int | `3` | The number of successful finished jobs to retain. |
| backups.cronJob.suspend | bool | `false` | Enable/disable the cron job schedule quickly. |
Expand Down Expand Up @@ -116,6 +117,7 @@ The following values can be used to adjust the helm chart.
| registryGarbageCollection.cronJob.failedJobsHistoryLimit | int | `1` | The number of failed finished jobs to retain. |
| registryGarbageCollection.cronJob.labels | object | `{}` | Additional labels for the cronjob object. |
| registryGarbageCollection.cronJob.removeUntaggedManifests | bool | `false` | Include untagged manifests and unreferenced layers if set to true. |
| registryGarbageCollection.cronJob.resources | object | `{}` | Compute resources used by the container inside the cronjob. More info [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). |
| registryGarbageCollection.cronJob.schedule | string | `"0 3 * * 1"` | Schedule for automated garbage collections. |
| registryGarbageCollection.cronJob.successfulJobsHistoryLimit | int | `3` | The number of successful finished jobs to retain. |
| registryGarbageCollection.cronJob.suspend | bool | `false` | Enable/disable the cron job schedule quickly. |
Expand Down
6 changes: 3 additions & 3 deletions charts/gitlab/templates/cronjob-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ spec:
imagePullPolicy: Always
command: ["/bin/sh"]
args: ["-c", "{{ include "gitlab.backup.command" . }}"]
resources: {{ if not .Values.resources -}}{}{{- end }}
{{- if .Values.resources }}
{{- toYaml .Values.resources | nindent 16 }}
resources: {{ if not .Values.backups.cronJob.resources -}}{}{{- end }}
{{- if .Values.backups.cronJob.resources }}
{{- toYaml .Values.backups.cronJob.resources | nindent 16 }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/gitlab/templates/cronjob-garbage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ spec:
imagePullPolicy: Always
command: ["/bin/sh"]
args: ["-c", "{{ include "gitlab.registryGarbageCollection.command" . }}"]
resources: {{ if not .Values.resources -}}{}{{- end }}
{{- if .Values.resources }}
{{- toYaml .Values.resources | nindent 16 }}
resources: {{ if not .Values.registryGarbageCollection.cronJob.resources -}}{}{{- end }}
{{- if .Values.registryGarbageCollection.cronJob.resources }}
{{- toYaml .Values.registryGarbageCollection.cronJob.resources | nindent 16 }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/gitlab/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ backups:
successfulJobsHistoryLimit: 3
# -- The number of failed finished jobs to retain.
failedJobsHistoryLimit: 1
# -- Compute resources used by the container inside the cronjob. More info [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/).
resources: {}
# -- Additional annotations for the cronjob object.
annotations: {}
# -- Additional labels for the cronjob object.
Expand All @@ -189,6 +191,8 @@ registryGarbageCollection:
successfulJobsHistoryLimit: 3
# -- The number of failed finished jobs to retain.
failedJobsHistoryLimit: 1
# -- Compute resources used by the container inside the cronjob. More info [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/).
resources: {}
# -- Additional annotations for the cronjob object.
annotations: {}
# -- Additional labels for the cronjob object.
Expand Down

0 comments on commit 8dac412

Please sign in to comment.