github.com/replicatedhq/ship@v0.55.0/integration/unfork/elastic-stack/expected/base/charts/elasticsearch/templates/data-statefulset.yaml (about)

     1  ---
     2  # Source: elastic-stack/charts/elasticsearch/templates/data-statefulset.yaml
     3  apiVersion: apps/v1beta1
     4  kind: StatefulSet
     5  metadata:
     6    labels:
     7      app: elasticsearch
     8      chart: elasticsearch-1.16.0
     9      component: "data"
    10      heritage: Tiller
    11      release: elastic-stack
    12    name: elastic-stack-elasticsearch-data
    13  spec:
    14    serviceName: elastic-stack-elasticsearch-data
    15    replicas: 2
    16    template:
    17      metadata:
    18        labels:
    19          app: elasticsearch
    20          component: "data"
    21          release: elastic-stack
    22          role: data
    23      spec:
    24        serviceAccountName: elastic-stack-elasticsearch-data
    25        securityContext:
    26          fsGroup: 1000
    27        affinity:
    28          podAntiAffinity:
    29            preferredDuringSchedulingIgnoredDuringExecution:
    30            - weight: 1
    31              podAffinityTerm:
    32                topologyKey: kubernetes.io/hostname
    33                labelSelector:
    34                  matchLabels:
    35                    app: "elasticsearch"
    36                    release: "elastic-stack"
    37                    component: "data"
    38        initContainers:
    39        # see https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
    40        # and https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html#mlockall
    41        - name: "sysctl"
    42          image: "busybox:latest"
    43          imagePullPolicy: "Always"
    44          resources:
    45              {}
    46              
    47          command: ["sysctl", "-w", "vm.max_map_count=262144"]
    48          securityContext:
    49            privileged: true
    50        - name: "chown"
    51          image: "docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.4"
    52          imagePullPolicy: "IfNotPresent"
    53          resources:
    54              {}
    55              
    56          command:
    57          - /bin/bash
    58          - -c
    59          - >
    60            set -e;
    61            set -x;
    62            chown elasticsearch:elasticsearch /usr/share/elasticsearch/data;
    63            for datadir in $(find /usr/share/elasticsearch/data -mindepth 1 -maxdepth 1 -not -name ".snapshot"); do
    64              chown -R elasticsearch:elasticsearch $datadir;
    65            done;
    66            chown elasticsearch:elasticsearch /usr/share/elasticsearch/logs;
    67            for logfile in $(find /usr/share/elasticsearch/logs -mindepth 1 -maxdepth 1 -not -name ".snapshot"); do
    68              chown -R elasticsearch:elasticsearch $logfile;
    69            done
    70          securityContext:
    71            runAsUser: 0
    72          volumeMounts:
    73          - mountPath: /usr/share/elasticsearch/data
    74            name: data
    75        containers:
    76        - name: elasticsearch
    77          env:
    78          - name: DISCOVERY_SERVICE
    79            value: elastic-stack-elasticsearch-discovery
    80          - name: NODE_MASTER
    81            value: "false"
    82          - name: PROCESSORS
    83            valueFrom:
    84              resourceFieldRef:
    85                resource: limits.cpu
    86          - name: ES_JAVA_OPTS
    87            value: "-Djava.net.preferIPv4Stack=true -Xms1536m -Xmx1536m "
    88          - name: MINIMUM_MASTER_NODES
    89            value: "2"
    90          image: "docker.elastic.co/elasticsearch/elasticsearch-oss:6.5.4"
    91          imagePullPolicy: "IfNotPresent"
    92          ports:
    93          - containerPort: 9300
    94            name: transport
    95  
    96          resources:
    97              limits:
    98                cpu: "1"
    99              requests:
   100                cpu: 25m
   101                memory: 1536Mi
   102              
   103          readinessProbe:
   104            httpGet:
   105              path: /_cluster/health?local=true
   106              port: 9200
   107            initialDelaySeconds: 5
   108          volumeMounts:
   109          - mountPath: /usr/share/elasticsearch/data
   110            name: data
   111          - mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
   112            name: config
   113            subPath: elasticsearch.yml
   114          - name: config
   115            mountPath: /pre-stop-hook.sh
   116            subPath: pre-stop-hook.sh
   117          - name: config
   118            mountPath: /post-start-hook.sh
   119            subPath: post-start-hook.sh
   120          lifecycle:
   121            preStop:
   122              exec:
   123                command: ["/bin/bash","/pre-stop-hook.sh"]
   124            postStart:
   125              exec:
   126                command: ["/bin/bash","/post-start-hook.sh"]
   127        terminationGracePeriodSeconds: 3600
   128        volumes:
   129        - name: config
   130          configMap:
   131            name: elastic-stack-elasticsearch
   132    updateStrategy:
   133      type: OnDelete
   134    volumeClaimTemplates:
   135    - metadata:
   136        name: data
   137      spec:
   138        accessModes:
   139          - "ReadWriteOnce"
   140        resources:
   141          requests:
   142            storage: "30Gi"