Skip to content

Commit

Permalink
Add labels for cronjob and queue (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Nov 10, 2024
1 parent 49a52a6 commit 9f2f0b2
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 9 deletions.
8 changes: 3 additions & 5 deletions charts/monica/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: monica
description: A Helm chart for Kubernetes to install Monica
type: application
version: 1.0.13
version: 1.0.14
appVersion: "5.0.0"
icon: https://raw.githubusercontent.com/monicahq/monica/aa98c09/public/img/favicon.svg
maintainers:
Expand Down Expand Up @@ -64,7 +64,5 @@ annotations:
- name: Source Code
url: https://github.com/monicahq/monica
artifacthub.io/changes: |
- kind: changes
description: Activate redis storage by default
- kind: fix
description: Fix annotations
- kind: changed
description: Add labels for cronjob and queue
8 changes: 6 additions & 2 deletions charts/monica/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# monica

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

A Helm chart for Kubernetes to install Monica

Expand Down Expand Up @@ -106,7 +106,9 @@ Kubernetes: `>=1.16.0-0`
| memcached.containerSecurityContext | object | `{}` | |
| memcached.enabled | bool | `false` | Enable Memcached. Use with a `CACHE_STORE=memcached` variable (can also be used for `SESSION_DRIVER`). |
| monica.containerPort | int | `80` | Customize container port |
| monica.cronjob.annotations | object | `{}` | Cronjob annotations |
| monica.cronjob.enabled | bool | `false` | Enable cronjob to execute monica scheduled tasks |
| monica.cronjob.labels | object | `{}` | Cronjob labels |
| monica.cronjob.resources | object | `{}` | cronjob resources definition (limits, requests) |
| monica.existingSecret.enabled | bool | `false` | Use an existing secret. If enabled, you need to set: `secretName`, `appKey`, `mailUsernameKey`, `mailPasswordKey` |
| monica.extraEnv | list | `[]` | Extra environment variables |
Expand All @@ -124,9 +126,11 @@ Kubernetes: `>=1.16.0-0`
| monica.mail.smtp.port | int | `465` | SMTP port |
| monica.mail.smtp.username | string | `"user"` | SMTP username |
| monica.phpConfigs | object | `{}` | PHP Configuration files. Will be injected in /usr/local/etc/php/conf.d for apache image and in /usr/local/etc/php-fpm.d when nginx.enabled: true |
| monica.queue.annotations | object | `{}` | Queue job annotations |
| monica.queue.enabled | bool | `false` | Enable queue job to execute monica background tasks. Use in addition to a `QUEUE_CONNECTION` variable. |
| monica.queue.labels | object | `{}` | Queue job labels |
| monica.queue.lifecycle | object | `{}` | Allow configuration of lifecycle hooks. ref: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/ |
| monica.queue.resources | object | `{}` | queue job resources definition (limits, requests) |
| monica.queue.resources | object | `{}` | Queue job resources definition (limits, requests) |
| monica.storagedir | string | `"/var/www/html/storage"` | Monica storage directory |
| monica.strategy | object | `{"type":"Recreate"}` | Strategy used to replace old pods. IMPORTANT: use with care, it is suggested to leave as that for upgrade purposes. ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy |
| nameOverride | string | `""` | Add a suffix to the name of the chart |
Expand Down
6 changes: 6 additions & 0 deletions charts/monica/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ metadata:
labels:
{{- include "monica.labels" . | nindent 4 }}
app.kubernetes.io/component: cronjob
{{- with .Values.monica.cronjob.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
helm.sh/hook: post-install,post-upgrade,post-rollback
helm.sh/hook-weight: "15"
{{- with .Values.monica.cronjob.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
schedule: "*/1 * * * *"
concurrencyPolicy: Forbid
Expand Down
6 changes: 6 additions & 0 deletions charts/monica/templates/queue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ metadata:
labels:
{{- include "monica.labels" . | nindent 4 }}
app.kubernetes.io/component: queue
{{- with .Values.monica.queue.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
helm.sh/hook: post-install,post-upgrade,post-rollback
helm.sh/hook-weight: "10"
{{- with .Values.monica.queue.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
16 changes: 16 additions & 0 deletions charts/monica/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,17 @@
},
"cronjob": {
"properties": {
"annotations": {
"properties": {},
"type": "object"
},
"enabled": {
"type": "boolean"
},
"labels": {
"properties": {},
"type": "object"
},
"resources": {
"properties": {},
"type": "object"
Expand Down Expand Up @@ -354,9 +362,17 @@
},
"queue": {
"properties": {
"annotations": {
"properties": {},
"type": "object"
},
"enabled": {
"type": "boolean"
},
"labels": {
"properties": {},
"type": "object"
},
"lifecycle": {
"properties": {},
"type": "object"
Expand Down
11 changes: 9 additions & 2 deletions charts/monica/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ monica:
cronjob:
# -- Enable cronjob to execute monica scheduled tasks
enabled: false

# -- Cronjob labels
labels: {}
# -- Cronjob annotations
annotations: {}
# -- cronjob resources definition (limits, requests)
resources: {}

Expand All @@ -182,7 +185,11 @@ monica:
# postStartCommand: []
# preStopCommand: []

# -- queue job resources definition (limits, requests)
# -- Queue job labels
labels: {}
# -- Queue job annotations
annotations: {}
# -- Queue job resources definition (limits, requests)
resources: {}

# @ignored
Expand Down

0 comments on commit 9f2f0b2

Please # to comment.