Skip to content

Commit

Permalink
✨ [#165] Support different queues/worker names
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Jan 22, 2025
1 parent a5035a2 commit 3d64776
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 10 deletions.
7 changes: 5 additions & 2 deletions charts/openarchiefbeheer/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ dependencies:
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 17.3.14
digest: sha256:9a575d102b6aa617223725968198a70072cee90595377df08ae62cef7c32cf4a
generated: "2023-02-28T13:57:35.331737607+01:00"
- name: maykin-utils-lib
repository: file://../maykin-utils-lib
version: 0.1.0
digest: sha256:c26bca8f348cdfff797880a55bb2017c613ff7aebad2e4b549a214a417a03c6f
generated: "2025-01-22T11:36:47.641468714+01:00"
7 changes: 5 additions & 2 deletions charts/openarchiefbeheer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ name: openarchiefbeheer
description: Opstellen, beheren en uitvoeren van vernietigingslijsten, voor gebruik met Zaakgericht werken

type: application
version: 1.1.1-beta.0
version: 1.2.1
appVersion: latest

dependencies:
- name: redis
version: 17.3.14
repository: https://charts.bitnami.com/bitnami
tags:
- redis
- redis
- name: maykin-utils-lib
version: 0.1.0
repository: file://../maykin-utils-lib
9 changes: 6 additions & 3 deletions charts/openarchiefbeheer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Opstellen, beheren en uitvoeren van vernietigingslijsten, voor gebruik met Zaakg

| Repository | Name | Version |
|------------|------|---------|
| file://../maykin-utils-lib | maykin-utils-lib | 0.1.0 |
| https://charts.bitnami.com/bitnami | redis | 17.3.14 |

## Values
Expand Down Expand Up @@ -100,6 +101,7 @@ Opstellen, beheren en uitvoeren van vernietigingslijsten, voor gebruik met Zaakg
| podAnnotations | object | `{}` | |
| podLabels | object | `{}` | |
| podSecurityContext.fsGroup | int | `1000` | |
| pythonAppName | string | `"openarchiefbeheer"` | |
| readinessProbe.failureThreshold | int | `6` | |
| readinessProbe.initialDelaySeconds | int | `30` | |
| readinessProbe.periodSeconds | int | `10` | |
Expand Down Expand Up @@ -179,16 +181,17 @@ Opstellen, beheren en uitvoeren van vernietigingslijsten, voor gebruik met Zaakg
| worker.autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| worker.autoscaling.targetMemoryUtilizationPercentage | int | `80` | |
| worker.concurrency | int | `4` | |
| worker.label | string | `"1"` | |
| worker.livenessProbe.enabled | bool | `false` | |
| worker.livenessProbe.exec.command[0] | string | `"/bin/sh"` | |
| worker.livenessProbe.exec.command[1] | string | `"-c"` | |
| worker.livenessProbe.exec.command[2] | string | `"celery --workdir src --app openarchiefbeheer.celery inspect --destination celery@${HOSTNAME} active"` | |
| worker.livenessProbe.exec.command[0] | string | `"/app/liveness/liveness-probe.sh"` | |
| worker.livenessProbe.failureThreshold | int | `3` | |
| worker.livenessProbe.initialDelaySeconds | int | `60` | |
| worker.livenessProbe.periodSeconds | int | `30` | |
| worker.livenessProbe.successThreshold | int | `1` | |
| worker.livenessProbe.timeoutSeconds | int | `10` | |
| worker.name | string | `""` | |
| worker.podLabels | object | `{}` | |
| worker.queueName | string | `""` | |
| worker.replicaCount | int | `1` | |
| worker.resources | object | `{}` | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- if .Values.worker.livenessProbe.enabled }}
{{- include "maykinhelmlib.celeryLivenessConfigmap" . -}}
{{- end }}
1 change: 1 addition & 0 deletions charts/openarchiefbeheer/templates/configmap-celery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{- include "maykinhelmlib.celeryEnvConfigmap" . -}}
13 changes: 13 additions & 0 deletions charts/openarchiefbeheer/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ spec:
name: {{ .Values.existingSecret | default (include "openarchiefbeheer.fullname" .) }}
- configMapRef:
name: {{ include "openarchiefbeheer.fullname" . }}
- configMapRef:
name: {{ include "project.fullname" . }}-worker-{{ .Values.worker.label | default "celery" }}
env:
{{- if .Values.extraEnvVars }}
{{- include "openarchiefbeheer.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
Expand Down Expand Up @@ -300,6 +302,11 @@ spec:
{{- if .Values.extraVolumeMounts }}
{{- include "openarchiefbeheer.tplvalues.render" ( dict "value" .Values.extraVolumeMounts "context" $ ) | nindent 12 }}
{{- end }}
{{- if .Values.worker.livenessProbe.enabled }}
- name: liveness
mountPath: /app/liveness/
readOnly: true
{{- end }}
volumes:
- name: media
persistentVolumeClaim:
Expand All @@ -311,6 +318,12 @@ spec:
{{- if .Values.extraVolumes }}
{{- include "openarchiefbeheer.tplvalues.render" ( dict "value" .Values.extraVolumes "context" $ ) | nindent 8 }}
{{- end }}
{{- if .Values.worker.livenessProbe.enabled }}
- name: liveness
configMap:
name: {{ include "project.fullname" . }}-celery-liveness
defaultMode: 0555
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
8 changes: 5 additions & 3 deletions charts/openarchiefbeheer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ extraEnvVars: []
extraVolumes: []
extraVolumeMounts: []

pythonAppName: openarchiefbeheer
settings:
allowedHosts: ""
djangoSettingsModule: openarchiefbeheer.conf.docker
Expand Down Expand Up @@ -251,6 +252,9 @@ settings:
frontendUrl: ""

worker:
label: "1"
name: ""
queueName: ""
replicaCount: 1
concurrency: 4
podLabels: {}
Expand All @@ -259,9 +263,7 @@ worker:
enabled: false
exec:
command:
- /bin/sh
- -c
- celery --workdir src --app openarchiefbeheer.celery inspect --destination celery@${HOSTNAME} active
- /app/liveness/liveness-probe.sh
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
Expand Down

0 comments on commit 3d64776

Please sign in to comment.