Skip to content

Instantly share code, notes, and snippets.

@cmltaWt0
Created May 14, 2024 17:34
Show Gist options
  • Save cmltaWt0/df9aab651350c4f2544d753e0f9213b6 to your computer and use it in GitHub Desktop.
Save cmltaWt0/df9aab651350c4f2544d753e0f9213b6 to your computer and use it in GitHub Desktop.
Open edx k8s helm
{{- $root := . -}}
{{- range $w := .Values.edxapp.celeryworkers.EDXAPP_CELERY_WORKERS }}
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: {{ include "edx-base.fullname" $root }}-{{ $w.service_variant }}-{{ $w.queue | replace "_" "-" }}-scaledobject
namespace: {{ $.Release.Namespace }}
spec:
pollingInterval: 5
cooldownPeriod: 300
{{- if $w.replicaCount }}
minReplicaCount: {{ $w.replicaCount }}
{{- else }}
minReplicaCount: {{ $root.Values.edxapp.celeryworkers.replicaCount }}
{{- end }}
{{- if $w.maxReplicaCount }}
maxReplicaCount: {{ $w.maxReplicaCount }}
{{- else }}
maxReplicaCount: {{ $root.Values.edxapp.celeryworkers.maxReplicaCount }}
{{- end }}
scaleTargetRef:
kind: Deployment
name: {{ include "edx-base.fullname" $root }}-{{ $w.service_variant }}-{{ $w.queue | replace "_" "-" }}
triggers:
- type: redis
metadata:
enableTLS: "false"
addressFromEnv: REDIS_HOST
listName: "edx.{{ $w.service_variant }}.core.{{ $w.queue }}"
{{- if $w.maxMessageRate }}
listLength: "{{ $w.maxMessageRate }}"
{{- else }}
listLength: "{{ $root.Values.edxapp.celeryworkers.maxMessageRate }}"
{{- end }}
{{- end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment