version: '2'
catalog:
    name: Elasticsearch Cluster
    version: 5.4.2-rancher2
    description: Scalable Elasticsearch Cluster

    questions:
        - variable: "cluster_name"
          type: "string"
          required: true
          label: "Cluster name"
          description: "Name of the Elasticsearch Cluster"
          default: "es-cluster"

        - variable: "UPDATE_SYSCTL"
          label: "Update host sysctl:"
          description: |
            Set true to avoid vm.max_map_count errors.
            WARN: If set true, host param vm.max_map_count will be update to 262144.
          default: false
          required: true
          type: enum
          options:
            - false
            - true

        - variable: "master_heap_size"
          type: "string"
          required: true
          label: "Heap size (master nodes)"
          description: "Heap size to be allocated for Java (mater nodes)"
          default: "512m"

        - variable: "master_mem_limit"
          type: "int"
          required: true
          label: "Memory limit in byte (master nodes)"
          description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (master nodes)"
          default: 1073741824

        - variable: "data_heap_size"
          type: "string"
          required: true
          label: "Heap size (data nodes)"
          description: "Heap size to be allocated for Java (mater nodes)"
          default: "512m"

        - variable: "data_mem_limit"
          type: "int"
          required: true
          label: "Memory limit in byte (data nodes)"
          description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (data nodes)"
          default: 1073741824

        - variable: "client_heap_size"
          type: "string"
          required: true
          label: "Heap size (client nodes)"
          description: "Heap size to be allocated for Java (mater nodes)"
          default: "512m"

        - variable: "client_mem_limit"
          type: "int"
          required: true
          label: "Memory limit in byte (client nodes)"
          description: "Memory limit in Byte per elasticsearch container. AT LEAST double the heap size! (client nodes)"
          default: 1073741824

        - variable: "minimum_master_nodes"
          type: "int"
          required: true
          label: "# of minimum Master Nodes"
          description: "Set the number of required master nodes to reach quorum. Sets initial scale to this value as well"
          default: 3

        - variable: "initial_data_nodes"
          type: "int"
          required: true
          label: "# of initial data nodes"
          description: "Set the initial number of data nodes"
          default: 2

        - variable: "initial_client_nodes"
          type: "int"
          required: true
          label: "# of initial client nodes"
          description: "Set the initial number of client nodes"
          default: 1

        - variable: "VOLUME_DRIVER"
          description: "The VOLUME driver to associate with this server"
          label: "VOLUME Driver"
          required: true
          default: "local"
          type: enum
          options:
            - local
            - rancher-nfs
            - rancher-efs
            - rancher-ebs

services:

  es-master:
    scale: ${minimum_master_nodes}

  es-data:
    scale: ${initial_data_nodes}

  es-client:
    scale: ${initial_client_nodes}
