|
| 1 | +# Copyright 2017 The Openstack-Helm Authors. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +apiVersion: extensions/v1beta1 |
| 16 | +kind: Deployment |
| 17 | +metadata: |
| 18 | + name: {{ .Values.labels.es_client.name }} |
| 19 | + labels: |
| 20 | + component: {{ .Values.labels.common.component }} |
| 21 | + role: {{ .Values.labels.es_client.role }} |
| 22 | +spec: |
| 23 | + replicas: {{ .Values.replicas.es_client }} |
| 24 | + template: |
| 25 | + metadata: |
| 26 | + labels: |
| 27 | + component: {{ .Values.labels.common.component }} |
| 28 | + role: {{ .Values.labels.es_client.role }} |
| 29 | + annotations: |
| 30 | + # Elasticsearch uses a hybrid mmapfs / niofs directory by default to |
| 31 | + # store its indices. The default operating system limits on mmap counts |
| 32 | + # is likely to be too low, which may result in out of memory exceptions, |
| 33 | + # so we use vm.max_map_count=262144 to increase that value. |
| 34 | + pod.beta.kubernetes.io/init-containers: '[ |
| 35 | + { |
| 36 | + "name": "sysctl", |
| 37 | + "image": "busybox", |
| 38 | + "imagePullPolicy": "IfNotPresent", |
| 39 | + "command": ["sysctl", "-w", "vm.max_map_count=262144"], |
| 40 | + "securityContext": { |
| 41 | + "privileged": true |
| 42 | + } |
| 43 | + } |
| 44 | + ]' |
| 45 | + spec: |
| 46 | + containers: |
| 47 | + - name: {{ .Values.labels.es_client.name }} |
| 48 | + securityContext: |
| 49 | + privileged: false |
| 50 | + capabilities: |
| 51 | + add: |
| 52 | + - IPC_LOCK |
| 53 | + - SYS_RESOURCE |
| 54 | + image: {{ .Values.images.elasticsearch }} |
| 55 | + imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 56 | + {{- if .Values.resources.enabled }} |
| 57 | + resources: |
| 58 | + limits: |
| 59 | + cpu: {{ .Values.resources.limits.cpu }} |
| 60 | + memory: {{ .Values.resources.limits.memory }} |
| 61 | + requests: |
| 62 | + cpu: {{ .Values.resources.requests.cpu }} |
| 63 | + memory: {{ .Values.resources.requests.memory }} |
| 64 | + {{- end }} |
| 65 | + env: |
| 66 | + - name: NAMESPACE |
| 67 | + valueFrom: |
| 68 | + fieldRef: |
| 69 | + fieldPath: metadata.namespace |
| 70 | + - name: NODE_NAME |
| 71 | + valueFrom: |
| 72 | + fieldRef: |
| 73 | + fieldPath: metadata.name |
| 74 | + - name: "CLUSTER_NAME" |
| 75 | + value: {{ .Values.cluster_name }} |
| 76 | + - name: NODE_MASTER |
| 77 | + value: "false" |
| 78 | + - name: NODE_DATA |
| 79 | + value: "false" |
| 80 | + - name: HTTP_ENABLE |
| 81 | + value: "true" |
| 82 | + - name: "ES_JAVA_OPTS" |
| 83 | + value: {{ .Values.es_java_opts.es_client }} |
| 84 | + ports: |
| 85 | + - containerPort: {{ .Values.network.client.port }} |
| 86 | + name: {{ .Values.network.client.name }} |
| 87 | + protocol: {{ .Values.network.client.protocol }} |
| 88 | + - containerPort: {{ .Values.network.discovery.port}} |
| 89 | + name: {{ .Values.network.discovery.name }} |
| 90 | + protocol: {{ .Values.network.discovery.protocol }} |
| 91 | + volumeMounts: |
| 92 | + - name: storage |
| 93 | + mountPath: /data |
| 94 | + volumes: |
| 95 | + - name: storage |
| 96 | + emptyDir: {} |
0 commit comments