diff options
Diffstat (limited to 'kubernetes/log/templates/elasticsearch-deployment.yaml')
-rw-r--r-- | kubernetes/log/templates/elasticsearch-deployment.yaml | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/kubernetes/log/templates/elasticsearch-deployment.yaml b/kubernetes/log/templates/elasticsearch-deployment.yaml index 74ab921834..cbc19a8591 100644 --- a/kubernetes/log/templates/elasticsearch-deployment.yaml +++ b/kubernetes/log/templates/elasticsearch-deployment.yaml @@ -4,9 +4,10 @@ kind: Deployment metadata: labels: app: elasticsearch - name: elasticsearch - namespace: {{ .Values.nsPrefix }}-log + name: log-elasticsearch + namespace: {{ .Values.nsPrefix }} spec: + replicas: {{ .Values.elasticsearchReplicas }} selector: matchLabels: app: elasticsearch @@ -14,13 +15,18 @@ spec: metadata: labels: app: elasticsearch - name: elasticsearch + name: log-elasticsearch spec: initContainers: - command: - - sysctl - - -w - - vm.max_map_count=262144 + - /bin/sh + - -c + - | + sysctl -w vm.max_map_count=262144 + mkdir -p /logroot/elasticsearch/logs + mkdir -p /logroot/elasticsearch/data + chmod -R 777 /logroot/elasticsearch + chown -R root:root /logroot env: - name: NAMESPACE valueFrom: @@ -32,6 +38,9 @@ spec: image: {{ .Values.image.es_bb }} imagePullPolicy: {{ .Values.pullPolicy }} name: init-sysctl + volumeMounts: + - name: elasticsearch-logs + mountPath: /logroot/ containers: - name: elasticsearch image: {{ .Values.image.elasticsearch}} @@ -59,10 +68,10 @@ spec: claimName: elasticsearch-db - name: elasticsearch-logs hostPath: - path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/elasticsearch/logs + path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/log/ - name: elasticsearch-conf configMap: - name: elasticsearch-configmap + name: log-elasticsearch-configmap items: - key: elasticsearch.yml path: elasticsearch.yml @@ -70,8 +79,8 @@ spec: apiVersion: v1 kind: ConfigMap metadata: - name: elasticsearch-configmap - namespace: {{ .Values.nsPrefix }}-log + name: log-elasticsearch-configmap + namespace: {{ .Values.nsPrefix }} data: {{ (.Files.Glob "resources/elasticsearch/conf/elasticsearch.yml").AsConfig | indent 2 }} #{{ end }} |