[CORD-2909] Flatten and parameterize charts

Change-Id: I695c1df063b0f6f6ccf280254d54cc701292348f
diff --git a/xos-services/exampleservice/templates/_helpers.tpl b/xos-services/exampleservice/templates/_helpers.tpl
index 99cc097..56ecf89 100644
--- a/xos-services/exampleservice/templates/_helpers.tpl
+++ b/xos-services/exampleservice/templates/_helpers.tpl
@@ -45,3 +45,37 @@
 {{- define "exampleservice.chart" -}}
 {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
+
+{{- define "exampleservice.serviceConfig" -}}
+name: exampleservice
+accessor:
+  username: {{ .Values.xosAdminUser | quote }}
+  password: {{ .Values.xosAdminPassword | quote }}
+  endpoint: xos-core:50051
+required_models:
+  - ExampleService
+  - ExampleServiceInstance
+  - ServiceDependency
+  - ServiceMonitoringAgentInfo
+dependency_graph: "/opt/xos/synchronizers/exampleservice/model-deps"
+steps_dir: "/opt/xos/synchronizers/exampleservice/steps"
+sys_dir: "/opt/xos/synchronizers/exampleservice/sys"
+model_policies_dir: "/opt/xos/synchronizers/exampleservice/model_policies"
+models_dir: "/opt/xos/synchronizers/exampleservice/models"
+logging:
+  version: 1
+  handlers:
+    console:
+      class: logging.StreamHandler
+    file:
+      class: logging.handlers.RotatingFileHandler
+      filename: /var/log/xos.log
+      maxBytes: 10485760
+      backupCount: 5
+  loggers:
+    'multistructlog':
+      handlers:
+          - console
+          - file
+      level: DEBUG
+{{- end -}}
diff --git a/xos-services/exampleservice/templates/configmap.yaml b/xos-services/exampleservice/templates/configmap.yaml
index 7e25008..84c030d 100644
--- a/xos-services/exampleservice/templates/configmap.yaml
+++ b/xos-services/exampleservice/templates/configmap.yaml
@@ -20,5 +20,4 @@
   name: exampleservice
 data:
   serviceConfig: |
-{{ toYaml .Values.serviceConfig | indent 4 }}
-
+{{ include "exampleservice.serviceConfig" . | indent 4 }}
diff --git a/xos-services/exampleservice/templates/deployment.yaml b/xos-services/exampleservice/templates/deployment.yaml
index 14f0c22..4509f9b 100644
--- a/xos-services/exampleservice/templates/deployment.yaml
+++ b/xos-services/exampleservice/templates/deployment.yaml
@@ -1,5 +1,4 @@
 ---
-
 # Copyright 2018-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -37,16 +36,17 @@
     spec:
       containers:
         - name: {{ .Chart.Name }}
-          image: "{{ .Values.pull_docker_registry }}{{ .Values.image.repository }}:{{ .Values.image.tag }}"
-          imagePullPolicy: {{ .Values.image.pullPolicy }}
+          image: {{ .Values.exampleservice_synchronizerImage | quote }}
+          imagePullPolicy: {{ .Values.imagePullPolicy }}
           resources:
 {{ toYaml .Values.resources | indent 12 }}
           volumeMounts:
             - name: exampleservice-config
               mountPath: /opt/xos/synchronizers/exampleservice/exampleservice_config.yaml
               subPath: exampleservice_config.yaml
-            - name: cert-chain-secret
-              mountPath: /usr/local/share/ca-certificates
+            - name: certchain-volume
+              mountPath: /usr/local/share/ca-certificates/local_certs.crt
+              subPath: config/ca_cert_chain.pem
       volumes:
         - name: exampleservice-config
           configMap:
@@ -54,9 +54,12 @@
             items:
               - key: serviceConfig
                 path: exampleservice_config.yaml
-        - name: cert-chain-secret
-          secret:
-            secretName: cert-chain-secret
+        - name: certchain-volume
+          configMap:
+            name: ca-certificates
+            items:
+              - key: chain
+                path: config/ca_cert_chain.pem
     {{- with .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml . | indent 8 }}