Bladeren bron

HUE-8744 [k8s] Add cron jobs for running the email stats command

Romain 6 jaren geleden
bovenliggende
commit
ce7362e32e

+ 35 - 0
tools/kubernetes/helm/hue/templates/cron-email-stats.yaml

@@ -0,0 +1,35 @@
+{{- if .Values.cron.emailStats -}}
+apiVersion: batch/v1beta1
+kind: CronJob
+metadata:
+  name: email-stats
+spec:
+  schedule: {{ .Values.cron.emailStats }}
+  jobTemplate:
+    spec:
+      template:
+        spec:
+          containers:
+          - name: email-stats
+            image: {{ .Values.image.registry }}/hue:{{ .Values.image.tag }}
+            imagePullPolicy: {{ .Values.image.pullPolicy }}
+            args:
+            - /bin/bash
+            - -c
+            - ./build/env/bin/hue send_query_stats
+            volumeMounts:
+            - name: config-volume
+              mountPath: /usr/share/hue/desktop/conf/z-hue.ini
+              subPath: hue-ini
+            - name: config-volume-extra
+              mountPath: /usr/share/hue/desktop/conf/zz-hue.ini
+              subPath: hue-ini
+          restartPolicy: OnFailure
+          volumes:
+            - name: config-volume
+              configMap:
+                name: hue-config
+            - name: config-volume-extra
+              configMap:
+                name: hue-config-extra
+{{- end -}}

+ 2 - 0
tools/kubernetes/helm/hue/values.yaml

@@ -58,6 +58,8 @@ workers:
   replicas: 1
 scheduler:
   enabled: false
+cron:
+  emailStats: "0 13 * * WED,SUN"
 aws:
   accessKeyId: ""
   secretAccessKey: ""

+ 33 - 0
tools/kubernetes/yaml/hue/cron-email-stats.yaml

@@ -0,0 +1,33 @@
+apiVersion: batch/v1beta1
+kind: CronJob
+metadata:
+  name: email-stats
+spec:
+  schedule: "0 13 * * WED,SUN"
+  jobTemplate:
+    spec:
+      template:
+        spec:
+          containers:
+          - name: email-stats
+            image: gethue/hue:latest
+            imagePullPolicy: IfNotPresent
+            args:
+            - /bin/bash
+            - -c
+            - ./build/env/bin/hue send_query_stats
+            volumeMounts:
+            - name: config-volume
+              mountPath: /usr/share/hue/desktop/conf/z-hue.ini
+              subPath: hue-ini
+            - name: config-volume-extra
+              mountPath: /usr/share/hue/desktop/conf/zz-hue.ini
+              subPath: hue-ini
+          restartPolicy: OnFailure
+          volumes:
+            - name: config-volume
+              configMap:
+                name: hue-config
+            - name: config-volume-extra
+              configMap:
+                name: hue-config-extra