Skip to content

Commit

Permalink
Merge pull request #211 from softonic/main
Browse files Browse the repository at this point in the history
Allow to define securityContext, labels and annotations for runCleaner pod(s)
  • Loading branch information
fbritoferreira authored May 10, 2023
2 parents 13aeaaf + 4af95c9 commit 774165b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion charts/sorry-cypress/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sorry-cypress
description: A Helm chart for Sorry Cypress
type: application
version: 1.12.0
version: 1.13.1
appVersion: 2.5.2
home: https://sorry-cypress.dev/
sources:
Expand Down
23 changes: 13 additions & 10 deletions charts/sorry-cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,16 @@ To use Azure Blob Storage you should use `"../screenshots/azure-blob-storage.dri
If you wish to have older runs regularly removed from the database, you can enable this.
For more information, refer to https://github.com/sendible-labs/sorry-cypress-run-cleaner

| Parameter | Description | Default |
|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `runCleaner.enabled` | If enabled, it will deploy the sorry-cypress run cleaner cronjob | `false` |
| `runCleaner.image.repository` | The image repository to be used for the `sorry-cypress-run-cleaner` cronjob | `"ghcr.io/sendible-labs/sorry-cypress-run-cleaner"` |
| `runCleaner.image.tag` | The image tag to be used for the `sorry-cypress-run-cleaner` cronjob | `"stable"` |
| `runCleaner.daysToKeep` | How many days worth of run data to keep in the database. Anything older is deleted. If omitted and `runCleaner.enabled` is true, it will default to 100d. | `200` |
| `runCleaner.schedule` | The cron schedule to run the runCleaner task | `'0 1 * * *'` |
| `runCleaner.clusterDomain` | Cluster domain, necessary to resolve api host | `'cluster.local'` |
| `runCleaner.priorityClassName`| Name of the existing priority class to be used by runCleaner pod(s) | `""` |
| `runCleaner.resources` | Resources to initialize the container | `{}` |
| Parameter | Description | Default |
|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `runCleaner.enabled` | If enabled, it will deploy the sorry-cypress run cleaner cronjob | `false` |
| `runCleaner.image.repository` | The image repository to be used for the `sorry-cypress-run-cleaner` cronjob | `"ghcr.io/sendible-labs/sorry-cypress-run-cleaner"` |
| `runCleaner.image.tag` | The image tag to be used for the `sorry-cypress-run-cleaner` cronjob | `"stable"` |
| `runCleaner.daysToKeep` | How many days worth of run data to keep in the database. Anything older is deleted. If omitted and `runCleaner.enabled` is true, it will default to 100d. | `200` |
| `runCleaner.schedule` | The cron schedule to run the runCleaner task | `'0 1 * * *'` |
| `runCleaner.clusterDomain` | Cluster domain, necessary to resolve api host | `'cluster.local'` |
| `runCleaner.podAnnotations` | Set annotations for runCleaner pod(s) | `{}` |
| `runCleaner.securityContext` | Privilege and access control for the runCleaner pod(s) | `{}` |
| `runCleaner.priorityClassName` | Name of the existing priority class to be used by runCleaner pod(s) | `""` |
| `runCleaner.podLabels` | Set additional labels for the runCleaner pod(s) | `{}` |
| `runCleaner.resources` | Resources to initialize the container | `{}` |
5 changes: 5 additions & 0 deletions charts/sorry-cypress/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 1.13.1
- Add option to add annotations and labels to the runCleaner cronjob pods
- Allow to specify the container security context to the runCleaner cronjob pods

# 1.13.0
- Update sorry-cypress version to 2.5.2

# 1.12.0
- Add option to provide director record keys through a custom Kubernetes secret.

Expand Down
10 changes: 10 additions & 0 deletions charts/sorry-cypress/templates/cronjob-run-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ spec:
metadata:
labels:
app: sorry-cypress-run-cleaner
{{- with .Values.runCleaner.podLabels }}
{{- toYaml . | nindent 12 }}
{{- end}}
{{- with .Values.runCleaner.podAnnotations }}
annotations:
{{- toYaml . | nindent 12 }}
{{- end }}
spec:
{{- if .Values.runCleaner.priorityClassName }}
priorityClassName: {{ .Values.runCleaner.priorityClassName }}
Expand All @@ -31,6 +38,9 @@ spec:
value: "http://{{ include "sorry-cypress-helm.fullname" . }}-api.{{ .Release.Namespace }}.svc.{{ .Values.runCleaner.clusterDomain }}:4000"
resources:
{{- toYaml .Values.runCleaner.resources | nindent 16 }}
securityContext:
{{- toYaml .Values.runCleaner.securityContext | nindent 16 }}

restartPolicy: Never
suspend: false
schedule: {{ .Values.runCleaner.schedule }}
Expand Down
6 changes: 6 additions & 0 deletions charts/sorry-cypress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,12 @@ runCleaner:
# cpu: 100m
# memory: 128Mi

podAnnotations: {}

podLabels: {}

securityContext: {}

imagePullSecrets: []
# An optional array of imagePullSecrets that are used to download images from a private registry
# https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
Expand Down

0 comments on commit 774165b

Please sign in to comment.