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

     1  ---
     2  # Source: elastic-stack/charts/elasticsearch/templates/configmap.yaml
     3  apiVersion: v1
     4  kind: ConfigMap
     5  metadata:
     6    name: elastic-stack-elasticsearch
     7    labels:
     8      app: elastic-stack-elasticsearch
     9      chart: "elasticsearch-1.16.0"
    10      release: "elastic-stack"
    11      heritage: "Tiller"
    12  data:
    13    elasticsearch.yml: |-
    14      cluster.name: elasticsearch
    15  
    16      node.data: ${NODE_DATA:true}
    17      node.master: ${NODE_MASTER:true}
    18      node.ingest: ${NODE_INGEST:true}
    19      node.name: ${HOSTNAME}
    20  
    21      network.host: 0.0.0.0
    22      # see https://github.com/kubernetes/kubernetes/issues/3595
    23      bootstrap.memory_lock: ${BOOTSTRAP_MEMORY_LOCK:false}
    24  
    25      discovery:
    26        zen:
    27          ping.unicast.hosts: ${DISCOVERY_SERVICE:}
    28          minimum_master_nodes: ${MINIMUM_MASTER_NODES:2}
    29  
    30      # see https://github.com/elastic/elasticsearch-definitive-guide/pull/679
    31      processors: ${PROCESSORS:}
    32  
    33      # avoid split-brain w/ a minimum consensus of two masters plus a data node
    34      gateway.expected_master_nodes: ${EXPECTED_MASTER_NODES:2}
    35      gateway.expected_data_nodes: ${EXPECTED_DATA_NODES:1}
    36      gateway.recover_after_time: ${RECOVER_AFTER_TIME:5m}
    37      gateway.recover_after_master_nodes: ${RECOVER_AFTER_MASTER_NODES:2}
    38      gateway.recover_after_data_nodes: ${RECOVER_AFTER_DATA_NODES:1}
    39    log4j2.properties: |-
    40      status = error
    41      appender.console.type = Console
    42      appender.console.name = console
    43      appender.console.layout.type = PatternLayout
    44      appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n
    45      rootLogger.level = info
    46      rootLogger.appenderRef.console.ref = console
    47      logger.searchguard.name = com.floragunn
    48      logger.searchguard.level = info
    49    pre-stop-hook.sh: |-
    50      #!/bin/bash
    51      exec &> >(tee -a "/var/log/elasticsearch-hooks.log")
    52      NODE_NAME=${HOSTNAME}
    53      echo "Prepare to migrate data of the node ${NODE_NAME}"
    54      echo "Move all data from node ${NODE_NAME}"
    55      curl -s -XPUT -H 'Content-Type: application/json' 'elastic-stack-elasticsearch-client:9200/_cluster/settings' -d "{
    56        \"transient\" :{
    57            \"cluster.routing.allocation.exclude._name\" : \"${NODE_NAME}\"
    58        }
    59      }"
    60      echo ""
    61  
    62      while true ; do
    63        echo -e "Wait for node ${NODE_NAME} to become empty"
    64        SHARDS_ALLOCATION=$(curl -s -XGET 'http://elastic-stack-elasticsearch-client:9200/_cat/shards')
    65        if ! echo "${SHARDS_ALLOCATION}" | grep -E "${NODE_NAME}"; then
    66          break
    67        fi
    68        sleep 1
    69      done
    70      echo "Node ${NODE_NAME} is ready to shutdown"
    71    post-start-hook.sh: |-
    72      #!/bin/bash
    73      exec &> >(tee -a "/var/log/elasticsearch-hooks.log")
    74      NODE_NAME=${HOSTNAME}
    75      CLUSTER_SETTINGS=$(curl -s -XGET "http://elastic-stack-elasticsearch-client:9200/_cluster/settings")
    76      if echo "${CLUSTER_SETTINGS}" | grep -E "${NODE_NAME}"; then
    77        echo "Activate node ${NODE_NAME}"
    78        curl -s -XPUT -H 'Content-Type: application/json' "http://elastic-stack-elasticsearch-client:9200/_cluster/settings" -d "{
    79          \"transient\" :{
    80              \"cluster.routing.allocation.exclude._name\" : null
    81          }
    82        }"
    83      fi
    84      echo "Node ${NODE_NAME} is ready to be used"