summaryrefslogtreecommitdiff
path: root/contrib/k8s-emc/elasticsearch-statefulset.yml
blob: 86edd8fcf312a4535020f11ee097fd1d563d0a42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
apiVersion: apps/v1
kind: StatefulSet
metadata:
  namespace: emc
  name: stats-es
  labels:
    app: elasticsearch
    tier: stats
spec:
  serviceName: stats-es
  replicas: 1
  selector:
    matchLabels:
      app: elasticsearch
      tier: stats
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: elasticsearch
        tier: stats
    spec:
      nodeName: emc-stats
      securityContext:
        runAsUser: 998
        fsGroup: 998
      initContainers:
      - name: prepare-es-data
        image: busybox
        command: ['sh', '-c', 'chown 998:998 /srv/data && chmod 700 /srv/data']
        securityContext:
          runAsUser: 0
        volumeMounts:
        - name: es-data
          mountPath: /srv/data
      containers:
      - name: elasticsearch
        image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.2
        imagePullPolicy: Always
        resources:
          limits:
            memory: 3072Mi
          requests:
            memory: 2048Mi
        env:
        - name: ES_JAVA_OPTS
          value: "-Xms1536m -Xmx1536m"
        - name: cluster.name
          value: emc-stats
        - name: node.name
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        volumeMounts:
        - name: es-data
          mountPath: /usr/share/elasticsearch/data
      volumes:
      - name: es-data
        hostPath:
          type: DirectoryOrCreate
          path: /srv/stats/elasticsearch