Skip to content

Commit

Permalink
Convert toolspipeline to cronjob (#17)
Browse files Browse the repository at this point in the history
* convert gn_tools_pipeline to cronjob
  • Loading branch information
jeanmi151 authored Dec 5, 2024
1 parent 9a7689b commit cd4d7cc
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 36 deletions.
2 changes: 1 addition & 1 deletion gn-tools-pipelines/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: gn-tools-pipelines
description: A Helm chart to deploy the tools-pipelines utility for geonetwork-ui
type: application
version: 1.0.0
version: 1.1.0
appVersion: "1.0"
maintainers:
- name: geOrchestra
Expand Down
31 changes: 31 additions & 0 deletions gn-tools-pipelines/templates/gntoolspipelines-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "gn-tools-pipelines.fullname" . }}
labels:
{{ include "gn-tools-pipelines.labels" . | nindent 4 }}
spec:
schedule: {{ .Values.job.schedule | quote }}
successfulJobsHistoryLimit: {{ .Values.job.successfulJobsHistoryLimit }}
jobTemplate:
spec:
template:
spec:
initContainers:
- name: init
image: curlimages/curl:latest
command: ['sh', '-c', 'while [ `curl -Lk --write-out "%{http_code}\n" --silent --output /dev/null "{{ .Values.config.elasticsearch.host }}/{{ .Values.config.elasticsearch.index }}"` -ne 200 ]; do sleep 2; done']
containers:
- name: {{ include "gn-tools-pipelines.fullname" . }}
image: "{{ .Values.job.image.repository }}:{{ .Values.job.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.job.image.pullPolicy }}
env:
- name: ES_HOST
value: {{ .Values.config.elasticsearch.host | required ".Values.config.elasticsearch.host is required." }}
- name: RECORDS_INDEX
value: {{ .Values.config.elasticsearch.index | required ".Values.config.elasticsearch.index is required." }}
restartPolicy: Never
{{- with .Values.job.tolerations }}
tolerations:
{{- toYaml . | nindent 10 }}
{{- end }}
29 changes: 0 additions & 29 deletions gn-tools-pipelines/templates/gntoolspipelines-job.yaml

This file was deleted.

15 changes: 9 additions & 6 deletions gn-tools-pipelines/values.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
replicaCount: 1

image:
repository: geonetwork/geonetwork-ui-tools-pipelines
tag: latest
pullPolicy: Always
job:
image:
repository: geonetwork/geonetwork-ui-tools-pipelines
tag: latest
pullPolicy: Always
schedule: "0 1 1 1 *"
successfulJobsHistoryLimit: 3
restartPolicy: OnFailure
tolerations: []

config:
elasticsearch:
host: "http://localhost:9200"
index: "gn-records"

tolerations: []

0 comments on commit cd4d7cc

Please sign in to comment.