Implement a job to configure opendistro

Change-Id: If4acf78f0072f467acf28a0ed63dfa323944f7f6
diff --git a/logging/opendistro_setting/templates/job.yml b/logging/opendistro_setting/templates/job.yml
new file mode 100644
index 0000000..609d6a7
--- /dev/null
+++ b/logging/opendistro_setting/templates/job.yml
@@ -0,0 +1,74 @@
+# Copyright 2020-present Open Networking Foundation
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+apiVersion: batch/v1
+kind: Job
+metadata:
+  name: "{{ .Release.Name }}"
+spec:
+  backoffLimit: 4
+  activeDeadlineSeconds: 100
+  template:
+    metadata:
+      name: "{{ .Release.Name }}"
+    spec:
+      restartPolicy: OnFailure
+      containers:
+        - name: config
+          image: opennetworking/utils:jq-kubectl-curl
+          imagePullPolicy: IfNotPresent
+          env:
+            - name: ES_URL
+              value: "{{ .Values.elasticsearch.host }}:{{ .Values.elasticsearch.port}}"
+            {{ if .Values.configuration.setting }}
+            - name: SETTING_DIR
+              value: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.setting }}"
+            {{ end }}
+            {{ if .Values.configuration.monitor }}
+            - name: MONITOR_DIR
+              value: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.monitor }}"
+            {{ end }}
+            {{ if .Values.configuration.destination }}
+            - name: DEST_DIR
+              value: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.destination }}"
+            {{ end }}
+          volumeMounts:
+            - name: config-script
+              mountPath: /tmp/update.sh
+              subPath: update.sh
+            {{ if .Values.configuration.setting }}
+            - name: setting-configs
+              mountPath: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.setting }}"
+            {{ end }}
+            {{ if .Values.configuration.monitor }}
+            - name: monitor-configs
+              mountPath: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.monitor }}"
+            {{ end }}
+            {{ if .Values.configuration.destination }}
+            - name: destination-configs
+              mountPath: "{{ .Values.configuration.base_dir }}/{{ .Values.configuration.destination }}"
+            {{ end }}
+          command: ["sh", "-c", "/tmp/update.sh"]
+      volumes:
+        - name: "config-script"
+          configMap:
+            name: "{{ .Release.Name }}-scripts"
+            defaultMode: 0755
+        {{ if .Values.configuration.setting }}
+        - name: "setting-configs"
+          configMap:
+            name: "{{ .Values.configuration.setting_configmap }}"
+            defaultMode: 0644
+        {{ end }}
+        {{ if .Values.configuration.monitor }}
+        - name: "monitor-configs"
+          configMap:
+            name: "{{ .Values.configuration.monitor_configmap }}"
+            defaultMode: 0644
+        {{ end }}
+        {{ if .Values.configuration.destination }}
+        - name: "destination-configs"
+          secret:
+            secretName: "{{ .Values.configuration.destination_secret }}"
+            defaultMode: 0644
+        {{ end }}