config seg aai elasticsearch 15/30315/1
authormayankg2703 <mayank.gupta@amdocs.com>
Mon, 5 Feb 2018 17:18:18 +0000 (17:18 +0000)
committermayankg2703 <mayank.gupta@amdocs.com>
Mon, 5 Feb 2018 17:19:00 +0000 (17:19 +0000)
Change-Id: I1d734fee3e487ba7d2e346576e38aba84928928f
Issue-ID: OOM-660
Signed-off-by: mayankg2703 <mayank.gupta@amdocs.com>
kubernetes/aai/resources/config/elasticsearch/config/elasticsearch.yml [moved from kubernetes/config/docker/init/src/config/aai/elasticsearch/config/elasticsearch.yml with 100% similarity]
kubernetes/aai/templates/elasticsearch-configmap.yaml [new file with mode: 0644]
kubernetes/aai/templates/elasticsearch-deployment.yaml
kubernetes/aai/values.yaml

diff --git a/kubernetes/aai/templates/elasticsearch-configmap.yaml b/kubernetes/aai/templates/elasticsearch-configmap.yaml
new file mode 100644 (file)
index 0000000..4a02346
--- /dev/null
@@ -0,0 +1,9 @@
+#{{ if not .Values.disableAaiElasticsearch }}
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: aai-elasticsearch-configmap
+  namespace: {{ .Values.nsPrefix }}-aai
+data:
+{{ tpl (.Files.Glob "resources/config/elasticsearch/config/elasticsearch.yml").AsConfig . | indent 2 }}
+#{{ end }}
index 680f942..baa1cb8 100644 (file)
@@ -14,6 +14,28 @@ spec:
         app: elasticsearch
       name: elasticsearch
     spec:
+      initContainers:
+      - command:
+        - /bin/sh
+        - -c
+        - |
+          mkdir -p /logroot/elasticsearch/es-data
+          chmod -R 777 /logroot/elasticsearch/es-data
+          chown -R root:root /logroot
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        securityContext:
+          privileged: true
+        image: {{ .Values.image.es_bb }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
+        name: init-sysctl
+        volumeMounts:
+        - name: elasticsearch-data
+          mountPath: /logroot/
       hostname: elasticsearch
       containers:
       - name: elasticsearch
@@ -31,6 +53,7 @@ spec:
           mountPath: /etc/localtime
           readOnly: true
         - name: elasticsearch-config
+          subPath: elasticsearch.yml
           mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
         - name: elasticsearch-data
           mountPath: /usr/share/elasticsearch/data
@@ -39,11 +62,11 @@ spec:
         hostPath:
           path: /etc/localtime
       - name: elasticsearch-config
-        hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/elasticsearch/config/elasticsearch.yml"
+        configMap:
+          name: aai-elasticsearch-configmap
       - name: elasticsearch-data
         hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/elasticsearch/es-data"
+          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/"
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
-#{{ end }}
\ No newline at end of file
+#{{ end }}
index 692d071..6912c73 100644 (file)
@@ -28,3 +28,4 @@ image:
   sparkyBeVersion: v1.1.0
   gremlinServerImage: aaionap/gremlin-server
   filebeat: docker.elastic.co/beats/filebeat:5.5.0
+  es_bb: busybox