Skip to content

Commit

Permalink
add pod annotation to registry cron jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
slamdev committed Apr 23, 2023
1 parent dafaff2 commit 1cf925f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/docker-registry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: docker-registry
description: |-
Helm chart to deploy [docker-registry](https://github.com/distribution/distribution).
type: application
version: 0.0.3
version: 0.0.4
appVersion: 2.8.1
home: https://github.com/slamdev/helm-charts/tree/master/charts/docker-registry
icon: https://docs.docker.com/favicons/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion charts/docker-registry/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# docker-registry

![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.1](https://img.shields.io/badge/AppVersion-2.8.1-informational?style=flat-square)
![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.1](https://img.shields.io/badge/AppVersion-2.8.1-informational?style=flat-square)

Helm chart to deploy [docker-registry](https://github.com/distribution/distribution).

Expand All @@ -25,6 +25,7 @@ Helm chart to deploy [docker-registry](https://github.com/distribution/distribut
| cleanregCronJob.image.repository | string | `"hcguersoy/cleanreg"` | image repository |
| cleanregCronJob.image.tag | string | `"v0.8.0"` | image tag (chart's appVersion value will be used if not set) |
| cleanregCronJob.imagePullSecrets | list | `[]` | image pull secret for private images |
| cleanregCronJob.podAnnotations | object | `{}` | pod annotations |
| cleanregCronJob.podSecurityContext | object | `{}` | specifies security settings for a pod |
| cleanregCronJob.resources | object | `{}` | custom resource configuration |
| cleanregCronJob.restartPolicy | string | `"Never"` | container restart policy |
Expand All @@ -41,6 +42,7 @@ Helm chart to deploy [docker-registry](https://github.com/distribution/distribut
| garbageCollectCronJob.deleteUntagged | bool | `true` | delete manifests that are not currently referenced via tag |
| garbageCollectCronJob.dryRun | bool | `false` | do everything except remove the blobs |
| garbageCollectCronJob.failedJobsHistoryLimit | int | `1` | the number of failed finished jobs to retain |
| garbageCollectCronJob.podAnnotations | object | `{}` | pod annotations |
| garbageCollectCronJob.resources | object | `{}` | custom resource configuration |
| garbageCollectCronJob.restartPolicy | string | `"Never"` | container restart policy |
| garbageCollectCronJob.schedule | string | `"@daily"` | the schedule in Cron format, see https://en.wikipedia.org/wiki/Cron |
Expand Down
4 changes: 4 additions & 0 deletions charts/docker-registry/templates/cronjob-cleanreg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
labels:
{{- include "docker-registry.labels" . | nindent 4 }}
app.kubernetes.io/component: cleanreg
annotations:
{{- toYaml .Values.cleanregCronJob.annotations | nindent 4 }}
spec:
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: {{ .Values.cleanregCronJob.successfulJobsHistoryLimit }}
Expand All @@ -22,6 +24,8 @@ spec:
labels:
{{- include "docker-registry.selectorLabels" . | nindent 12 }}
app.kubernetes.io/component: cleanreg
annotations:
{{- toYaml .Values.cleanregCronJob.podAnnotations | nindent 12 }}
spec:
restartPolicy: {{ .Values.cleanregCronJob.restartPolicy }}
{{- with .Values.cleanregCronJob.imagePullSecrets }}
Expand Down
4 changes: 4 additions & 0 deletions charts/docker-registry/templates/cronjob-gc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
labels:
{{- include "docker-registry.labels" . | nindent 4 }}
app.kubernetes.io/component: garbage-collect
annotations:
{{- toYaml .Values.garbageCollectCronJob.annotations | nindent 4 }}
spec:
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: {{ .Values.garbageCollectCronJob.successfulJobsHistoryLimit }}
Expand All @@ -22,6 +24,8 @@ spec:
labels:
{{- include "docker-registry.selectorLabels" . | nindent 12 }}
app.kubernetes.io/component: garbage-collect
annotations:
{{- toYaml .Values.garbageCollectCronJob.podAnnotations | nindent 12 }}
spec:
restartPolicy: {{ .Values.garbageCollectCronJob.restartPolicy }}
{{- with .Values.imagePullSecrets }}
Expand Down
5 changes: 5 additions & 0 deletions charts/docker-registry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ additionalResources: [ ]
# mykey: my-value

garbageCollectCronJob:
# garbageCollectCronJob.podAnnotations -- pod annotations
podAnnotations: { }
# garbageCollectCronJob.successfulJobsHistoryLimit -- the number of successful finished jobs to retain
successfulJobsHistoryLimit: 3
# garbageCollectCronJob.failedJobsHistoryLimit -- the number of failed finished jobs to retain
Expand All @@ -153,6 +155,9 @@ garbageCollectCronJob:

cleanregCronJob:

# cleanregCronJob.podAnnotations -- pod annotations
podAnnotations: {}

image:
# cleanregCronJob.image.repository -- image repository
repository: hcguersoy/cleanreg
Expand Down

0 comments on commit 1cf925f

Please sign in to comment.