Skip to content

Commit 7e9ba03

Browse files
authored
Merge pull request #8 from geonetwork/tools-pipeline
Add tools-pipelines to helm charts
2 parents 34b08fd + 1a96a44 commit 7e9ba03

File tree

6 files changed

+147
-0
lines changed

6 files changed

+147
-0
lines changed

gn-tools-pipeline/.helmignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

gn-tools-pipeline/Chart.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: v2
2+
name: gn-tools-pipelines
3+
description: A Helm chart to deploy the tools-pipelines utility for geonetwork-ui
4+
type: application
5+
version: 0.1.0
6+
maintainers:
7+
- name: geOrchestra
8+
url: https://www.georchestra.org

gn-tools-pipeline/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# GN-tools-pipelines
2+
3+
Contains utilities related to registering pipelines on ElasticSearch.
4+
Pipelines are used to preprocess records during the indexation process, thus offering greater control over the values returned by ElasticSearch and giving an improved user experience when searching records.
5+
6+
## Source Code
7+
8+
* https://github.com/geonetwork/geonetwork-ui/tree/main/apps/datahub
9+
10+
## Requirements
11+
12+
Kubernetes: `>=1.14.0-0`
13+
14+
## Dependencies
15+
16+
None
17+
18+
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "gn-tools-pipelines.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "gn-tools-pipelines.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "gn-tools-pipelines.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "gn-tools-pipelines.labels" -}}
37+
helm.sh/chart: {{ include "gn-tools-pipelines.chart" . }}
38+
{{ include "gn-tools-pipelines.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "gn-tools-pipelines.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "gn-tools-pipelines.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "gn-tools-pipelines.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "gn-tools-pipelines.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: {{ include "gn-tools-pipelines.fullname" }}
5+
labels:
6+
{{ include "gn-tools-pipelines.labels" . | nindent 4 }}
7+
spec:
8+
template:
9+
spec:
10+
initContainers:
11+
- name: init
12+
image: curlimages/curl:latest
13+
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']
14+
containers:
15+
- name: {{ include "gn-tools-pipelines.fullname" }}
16+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
17+
imagePullPolicy: {{ .Values.image.pullPolicy }}
18+
env:
19+
- name: ES_HOST
20+
value: {{ .Values.config.elasticsearch.host | required ".Values.config.elasticsearch.host is required." }}
21+
- name: RECORDS_INDEX
22+
value: {{ .Values.config.elasticsearch.index | required ".Values.config.elasticsearch.index is required." }}
23+
restartPolicy: Never
24+
25+
backoffLimit: 2

gn-tools-pipeline/values.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
replicaCount: 1
2+
3+
image:
4+
repository: geonetwork/geonetwork-ui-tools-pipelines
5+
tag: latest
6+
pullPolicy: Always
7+
8+
config:
9+
elasticsearch:
10+
host: "http://localhost:9200"
11+
index: "gn-records"

0 commit comments

Comments
 (0)