|
| 1 | +{{- if .Values.rostersSchedulerJob.enabled -}} |
| 2 | +apiVersion: batch/v1 |
| 3 | +kind: CronJob |
| 4 | +metadata: |
| 5 | + name: {{ include "lms-data-service.rostersSchedulerJobName" . }} |
| 6 | + # These labels do not also get added to the pods created by this job |
| 7 | + labels: |
| 8 | + {{- include "lms-data-service.labels" . | nindent 4 }} |
| 9 | + jobCommonName: lms-rosters-scheduler-job |
| 10 | + annotations: |
| 11 | + description: > |
| 12 | + Sends a message to the LMS Data Service application via ActiveMQ notifying it to |
| 13 | + load rosters (aka Learning Enrollments) from the LMS. |
| 14 | +spec: |
| 15 | + schedule: {{ .Values.rostersSchedulerJob.schedule | quote }} |
| 16 | + concurrencyPolicy: {{ .Values.rostersSchedulerJob.concurrencyPolicy | quote }} |
| 17 | + jobTemplate: |
| 18 | + spec: |
| 19 | + template: |
| 20 | + metadata: |
| 21 | + annotations: |
| 22 | + {{- with .Values.rostersSchedulerJob.podAnnotations }} |
| 23 | + {{- toYaml . | nindent 12 }} |
| 24 | + {{- end }} |
| 25 | + labels: |
| 26 | + {{- with .Values.rostersSchedulerJob.podLabels }} |
| 27 | + {{- toYaml . | nindent 12 }} |
| 28 | + {{- end }} |
| 29 | + spec: |
| 30 | + containers: |
| 31 | + - name: thub-event-scheduler-job |
| 32 | + image: "{{ .Values.rostersSchedulerJob.image.repository }}:{{ .Values.rostersSchedulerJob.image.tag | default (include "thub.eventSchedulerJobTag" .) }}" |
| 33 | + imagePullPolicy: {{ .Values.rostersSchedulerJob.image.pullPolicy }} |
| 34 | + command: ["java", "-jar", "/home/app/application.jar", "jms", "{{ include "lms-data-service.rostersSchedulerJobInputFile" . }}"] |
| 35 | + ports: |
| 36 | + - containerPort: {{ .Values.rostersSchedulerJob.port }} |
| 37 | + name: http-server |
| 38 | + resources: |
| 39 | + {{- toYaml .Values.global.eventSchedulerResources | nindent 14 }} |
| 40 | + env: |
| 41 | + - name: server.port |
| 42 | + value: {{ .Values.rostersSchedulerJob.port | quote }} |
| 43 | + - name: hclabs.scheduler.destinationQueue |
| 44 | + value: {{ include "thub.sfLmsDataJobQueueName" . }} |
| 45 | + - name: micronaut.jms.activemq.classic.connection-string |
| 46 | + valueFrom: |
| 47 | + configMapKeyRef: |
| 48 | + name: mq-broker-config |
| 49 | + key: spring.activemq.brokerUrl |
| 50 | + - name: micronaut.jms.activemq.classic.username |
| 51 | + valueFrom: |
| 52 | + configMapKeyRef: |
| 53 | + name: mq-broker-config |
| 54 | + key: spring.activemq.user |
| 55 | + - name: micronaut.jms.activemq.classic.password |
| 56 | + valueFrom: |
| 57 | + configMapKeyRef: |
| 58 | + name: mq-broker-config |
| 59 | + key: spring.activemq.password |
| 60 | + volumeMounts: |
| 61 | + - name: message-file |
| 62 | + mountPath: /home/app/temp |
| 63 | + readOnly: true |
| 64 | + volumes: |
| 65 | + - name: message-file |
| 66 | + configMap: |
| 67 | + # Provide the name of the ConfigMap containing the files you want |
| 68 | + # to add to the container |
| 69 | + name: {{ include "lms-data-service.eventSchedulerInputFilesConfigmapName" . }} |
| 70 | + restartPolicy: {{ .Values.rostersSchedulerJob.restartPolicy }} |
| 71 | +{{- end }} |
0 commit comments