Create instance configurations

edit

If you plan to create your own templates and the default instance configurations that ship with ECE don’t quite suit your purpose, it’s generally easier and safer to create your own custom instance configurations first. Instance configurations match components of the Elastic Stack to allocators and tailor how memory and storage resources get sized relative to each other, and what sizes are available.

Before you begin

edit

Before you start creating your own instance configurations, you should have tagged your allocators to tell ECE what kind of hardware you have available for Elastic Stack deployments. If you do not tag your allocators, templates that use these instance configurations will deploy wherever there is space rather than on specific allocators.

Create an instance configuration in the UI

edit
  1. Log into the Cloud UI.
  2. From the Platform menu, select Templates.
  3. Select the Instance configurations tab and click Create instance configuration.
  4. In the Input section, construct a query that filters on specific allocator tags.

    An outer clause ANDs or ORs your main filtering criteria. You use outer clauses to find the allocators that you tagged earlier. An inner clause modifies an outer clause and let’s you refine your filtering criteria further. If you are unsure how the process works, try searching on some of the allocator tags that you added and see how the query results change.

    1. Click And or Or to add a first outer clause.
    2. Enter a key-value pair in the Key and Value fields that you previously tagged your allocators with.

      For example: If you tagged your allocators with this tag, enter SSD and true or enter whatever tag you are using for a similar purpose.

    3. Check the list of allocators that get matched by your query:

      • If you are satisfied that your query matches all the allocators where the component(s) of the Elastic Stack can be deployed, move on to the next step.
      • If you need to refine your query further, continue to adjust your outer or inner clauses. If you are unsure what to do, we recommend keeping your initial query simple. You can always refine the query later on by re-editing the instance configuration.
  5. Click Instance types.
  6. Pick the products and features of the Elastic Stack that can get deployed on the allocators you identified in the previous step. For products such as Elasticsearch, you can also select some additional options, such as the specific node types that can be deployed.

    Note that not all combinations of Elasticsearch node types are available. You can create either a general purpose Elasticsearch node that includes all three of data, master, and coordinating, or a dedicated node that includes any one of these types. Machine learning is also available as a separate instance type.

  7. Click Sizes.
  8. Adjust how memory and storage resources get sized relative to each other and set the available sizes, including the default size. Size your instance configuration so that it will use the available memory and storage on your allocators efficiently, without leaving hardware resources unused. Keep in mind that very small sizes might not provide adequate performance for some use cases.

    The size of an instance configuration also determines performance, as CPU resources get sized in lockstep. For example: A 32 GB instance configuration receives double the CPU resources of a 16 GB one.

  9. Click Name.
  10. Give your instance configuration a name and include a description that reflects its intended use.
  11. Click Save and create configuration.

Create an instance configuration through the RESTful API

edit
  1. Obtain the existing instance configurations to see some examples of what the required JSON looks like. You can take the JSON for one of the existing configurations and modify it to create a new instance configuration, similar to what gets shown in the next step.

    curl -k -X GET -H "Authorization: ApiKey $ECE_API_KEY" https://COORDINATOR_HOST:12443/api/v1/platform/configuration/instances
  2. Post the JSON for your new instance configuration.

    The following examples creates an instance configuration for machine learning with size increments that start at the recommended minimum of 16 GB of memory. To make sure that machine learning nodes get deployed only on the right allocators, this instance configuration also filters for allocator tags from our earlier example to match only allocators with high CPU resources and SSD storage.

    curl -k -X POST -H "Authorization: ApiKey $ECE_API_KEY" https://COORDINATOR_HOST:12443/api/v1/platform/configuration/instances -H 'content-type: application/json' -d '{
     "name": "Machine Learning Only",
      "description": "Custom machine learning instance configuration",
      "storage_multiplier": 32.0,
      "discrete_sizes": {
        "sizes": [16384, 32768, 65536],
        "default_size": 16384,
        "resource": "memory"
      },
      "allocator_filter": {
        "bool": {
          "must": [{
            "bool": {
              "must": [{
                "nested": {
                  "query": {
                    "bool": {
                      "must": [{
                        "term": {
                          "metadata.key": {
                            "value": "SSD"
                          }
                        }
                      }, {
                        "term": {
                          "metadata.value.keyword": {
                            "value": "true"
                          }
                        }
                      }]
                    }
                  },
                  "path": "metadata"
                }
              }]
            }
          }, {
            "bool": {
              "must": [{
                "nested": {
                  "query": {
                    "bool": {
                      "must": [{
                        "term": {
                          "metadata.key": {
                            "value": "highCPU"
                          }
                        }
                      }, {
                        "term": {
                          "metadata.value.keyword": {
                            "value": "true"
                          }
                        }
                      }]
                    }
                  },
                  "path": "metadata"
                }
              }]
            }
          }]
        }
      },
      "node_types": ["ml"], 
      "instance_type": "elasticsearch"
    }'

    Note, that not all combinations of Elasticsearch node types are allowed here. You can create either a general purpose Elasticsearch node that includes all three of data, master, and ingest, or a dedicated node, that includes any one of these types or ml.

    After you have created your new instance configuration, you can use it when you create new deployment templates or when you edit existing ones.