Skip to content

Commit

Permalink
Add flower celery web monitor app
Browse files Browse the repository at this point in the history
  • Loading branch information
BenGalewsky committed Nov 26, 2024
1 parent 70a6702 commit fd9f7da
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
12 changes: 11 additions & 1 deletion helm/servicex/templates/app/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ spec:
backend:
service:
name: {{ .Release.Name }}-servicex-app
port:
port:
number: 8000
{{- if .Values.flower.enabled }}
- path: /flower
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-flower
port:
number: 8000
{{- end }}

{{- end }}
42 changes: 42 additions & 0 deletions helm/servicex/templates/flower/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

{{- if .Values.flower.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $.Release.Name }}-flower
spec:
replicas: 1
selector:
matchLabels:
app: {{ $.Release.Name }}-flower
template:
metadata:
labels:
app: {{ $.Release.Name }}-flower
spec:
containers:
- name: {{ $.Release.Name }}-flower
image: {{ .Values.flower.image }}:{{ .Values.flower.tag }}
tty: true
stdin: true
imagePullPolicy: {{ .Values.flower.pullPolicy }}
env:
{{- if .Values.secrets }}
- name: RMQ_PASS
valueFrom:
secretKeyRef:
name: {{ .Values.secrets }}
key: rabbitmq-password
- name: BROKER_URL
value: amqp://user:$(RMQ_PASS)@{{ .Release.Name }}-rabbitmq:5672/?heartbeat=9000
{{- else }}
- name: BROKER_URL
value: amqp://user:{{ .Values.rabbitmq.auth.password }}@{{ .Release.Name }}-rabbitmq:5672/%2F
{{- end }}

command: [ "/bin/sh" ]
args: [ "-c", "celery --broker $BROKER_URL flower --purge_offline_workers=60" ]

ports:
- containerPort: 5555
{{- end }}
16 changes: 16 additions & 0 deletions helm/servicex/templates/flower/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
{{- if .Values.flower.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-flower
spec:
ports:
- port: 8000
targetPort: 5555
name: "tcp"
protocol: TCP
selector:
app: {{ .Release.Name }}-flower
type: ClusterIP
{{- end }}
8 changes: 8 additions & 0 deletions helm/servicex/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,11 @@ dataLifecycle:
# See https://www.geeksforgeeks.org/date-command-linux-examples/#4-how-to-display-past-dates
# for examples
retention: "7 days ago"

# Flower is a web based tool for monitoring and administrating Celery clusters.
# It can be used to inspect tasks, view graphs and logs, restart workers, and more.
flower:
enabled: true
image: mher/flower
tag: master
pullPolicy: Always

0 comments on commit fd9f7da

Please sign in to comment.