This is an automated email from the ASF dual-hosted git repository.

eamonford pushed a commit to branch helm-ingester
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git


The following commit(s) were added to refs/heads/helm-ingester by this push:
     new 29f3799  wip
29f3799 is described below

commit 29f37998f9f45f9fae4262a00ae220f18a950cb9
Author: Eamon Ford <[email protected]>
AuthorDate: Wed Jul 1 17:03:54 2020 -0500

    wip
---
 helm/templates/_helpers.tpl                  | 23 +++++++++++++++
 helm/templates/collection-manager.yml        | 44 ++++++++++++++++------------
 helm/templates/collections-config-gitcfg.yml | 12 ++++----
 helm/values.yaml                             | 14 ++++-----
 4 files changed, 62 insertions(+), 31 deletions(-)

diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl
new file mode 100644
index 0000000..f3f70bc
--- /dev/null
+++ b/helm/templates/_helpers.tpl
@@ -0,0 +1,23 @@
+{{/* vim: set filetype=mustache: */}}
+
+{{/*
+Name of the generated configmap containing the contents of the collections 
config file.
+*/}}
+{{- define "nexus.collectionsConfig.configmapName" -}}
+collections-config
+{{- end -}}
+
+{{/*
+Path at which to mount the collections config file in the Collection Manager.
+*/}}
+{{- define "nexus.collectionsConfig.mountPath" -}}
+/sdap/history
+{{- end -}}
+
+{{/*
+Path at which to mount the history directory in the Collection Manager, if not 
using Solr for history.
+*/}}
+{{- define "nexus.history.mountPath" -}}
+/sdap/history
+{{- end -}}
+
diff --git a/helm/templates/collection-manager.yml 
b/helm/templates/collection-manager.yml
index 182951e..b99366c 100644
--- a/helm/templates/collection-manager.yml
+++ b/helm/templates/collection-manager.yml
@@ -1,4 +1,6 @@
-{{ if .Values.ingestion.enabled }}
+{{- $history := .Values.ingestion.history | default dict }}
+
+{{- if .Values.ingestion.enabled }}
 apiVersion: apps/v1
 kind: Deployment
 metadata:
@@ -26,40 +28,46 @@ spec:
             - name: RABBITMQ_HOST
               value: {{ .Values.rabbitmq.fullnameOverride }}
             - name: COLLECTIONS_PATH
-              value: /sdap/ingester/collections.yml
-            {{ if .Values.collectionManager.historyUrl }}
+              value: {{ include "nexus.collectionsConfig.mountPath" . 
}}/collections.yml
+            {{- if $history.url }}
             - name: HISTORY_URL
-              value: {{ .Values.collectionManager.historyUrl }}
-            {{ else }}
+              value: {{ .Values.ingestion.history.url}}
+            {{- else }}
             - name: HISTORY_PATH
-              value: /sdap/history
-            {{ end }}
+              value: {{ include "nexus.history.mountPath" . }}
+            {{- end }}
           volumeMounts:
             - name: collections-config-volume
-              mountPath: /sdap/ingester
-            {{ if not .Values.collectionManager.historyUrl }}
+              mountPath: {{ include "nexus.collectionsConfig.mountPath" . }}
+            {{- if not $history.url }}
             - name: history-volume
-              mountPath: /sdap/history
-            {{ end }}
+              mountPath: {{ include "nexus.history.mountPath" . }}
+            {{- end }}
             - name: data-volume
               mountPath: /data
       volumes:
         - name: collections-config-volume
           configMap:
-            name: collections-config
-        {{ if not .Values.collectionManager.historyUrl }}
+            name: {{ include "nexus.collectionsConfig.configmapName" . }}
+        {{- if not $history.url }}
         - name: history-volume
           persistentVolumeClaim:
             claimName: history-volume-claim
-        {{ end }}
+        {{- end }}
         - name: data-volume
+          {{- if .Values.ingestion.granules.nfsServer }}
+          nfs:
+            server: {{ .Values.ingestion.granules.nfsServer }}
+            path: {{ .Values.ingestion.granules.path }}
+          {{- else }}
           hostPath:
-            path: {{ .Values.ingestion.dataPath }}
+            path: {{ .Values.ingestion.granules.path }}
+          {{- end }}
       restartPolicy: Always
 
 ---
 
-{{ if not .Values.collectionManager.historyUrl }}
+{{- if not $history.url }}
 apiVersion: v1
 kind: PersistentVolumeClaim
 metadata:
@@ -71,6 +79,6 @@ spec:
     requests:
       storage: 3Gi
   storageClassName: {{ .Values.storageClass }}
-{{ end }}
+{{- end }}
 
-{{ end }}
\ No newline at end of file
+{{- end }}
\ No newline at end of file
diff --git a/helm/templates/collections-config-gitcfg.yml 
b/helm/templates/collections-config-gitcfg.yml
index 4288ea0..e4b7294 100644
--- a/helm/templates/collections-config-gitcfg.yml
+++ b/helm/templates/collections-config-gitcfg.yml
@@ -3,11 +3,11 @@ kind: GitBasedConfig
 metadata:
   name: collections-config-gitcfg
 spec:
-  {{ if .Values.ingestion.collectionsConfig.git }}
-  git-url: {{ .Values.ingestion.collectionsConfig.git.url }}
-  git-branch: {{ .Values.ingestion.collectionsConfig.git.branch }}
-  git-token: {{ .Values.ingestion.collectionsConfig.token }}
+  {{ if .Values.ingestion.collections.git }}
+  git-url: {{ .Values.ingestion.collections.git.url }}
+  git-branch: {{ .Values.ingestion.collections.git.branch }}
+  git-token: {{ .Values.ingestion.collections.token }}
   {{ else }}
-  local-dir: {{ .Values.ingestion.collectionsConfig.localDir }}
+  local-dir: {{ .Values.ingestion.collections.localDir }}
   {{ end }}
-  config-map: collections-config
+  config-map: {{ include "nexus.collectionsConfig.configmapName" . }}
diff --git a/helm/values.yaml b/helm/values.yaml
index ccaca4b..3411e1b 100644
--- a/helm/values.yaml
+++ b/helm/values.yaml
@@ -22,17 +22,17 @@ webapp:
 
 ingestion:
   enabled: true
-  dataPath: /Users/edford/Desktop/ingestion_test/data
-  collectionsConfig:
-#    localDir: /Users/edford/Desktop/collections.yml
+  granules:
+    # nfsServer: test-nfs-server.com
+    path: /Users/edford/Desktop/ingestion_test/data
+  collections:
+    # localDir: /Users/edford/Desktop/collections.yml
     git:
       url: https://github.com/eamonford/sdap-ingestion-test.git
       branch: master
       token: test
-
-collectionManager:
-  enabled: true
-#  historyUrl: history-solr
+  history:
+#     url: history-solr
 
 cassandra:
   replicas: 2

Reply via email to