Manage licenses in ECK

edit

When you install the default distribution of ECK, you receive a Basic license. Any Elastic stack application you manage through ECK will also be Basic licensed. Go to https://www.elastic.co/subscriptions to check which features are included in the Basic license for free.

ECK is only offered in two licensing tiers: Basic and Enterprise. Similar to the Elastic Stack, customers can download and use ECK with a Basic license for free. Basic license users can obtain support from GitHub or through our community. A paid Enterprise subscription is required to engage the Elastic support team. For more details, check the Elastic subscriptions.

In this section, you are going to learn how to:

Start a trial

edit

If you want to try the features included in the Enterprise subscription, you can start a 30-day trial. To start a trial, create a Kubernetes secret as shown in this example. Note that it must be in the same namespace as the operator:

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Secret
metadata:
  name: eck-trial-license
  namespace: elastic-system
  labels:
    license.k8s.elastic.co/type: enterprise_trial
  annotations:
    elastic.co/eula: accepted 
EOF

By setting this annotation to accepted you are expressing that you have accepted the Elastic EULA which can be found at https://www.elastic.co/eula.

You can initiate a trial only if a trial has not been previously activated.

At the end of the trial period, the Platinum and Enterprise features operate in a degraded mode. You can revert to a Basic license, extend the trial, or purchase an Enterprise subscription.

Add a license

edit

If you have a valid Enterprise subscription or a trial license extension, you will receive a link to download a license as a JSON file.

When downloading the license choose the "Orchestration license" option.

The downloaded JSON file contains the Enterprise orchestration license which enables ECK Enterprise features. Embedded in the orchestration license are also Enterprise stack licenses for recent Elasticsearch versions and Platinum licenses for older Elasticsearch versions that do not support Enterprise licenses.

To add the license to your ECK installation, create a Kubernetes secret of the following form:

apiVersion: v1
kind: Secret
metadata:
  labels:
    license.k8s.elastic.co/scope: operator 
  name: eck-license
type: Opaque
data:
  license: "JSON license in base64 format"  

This label is required for ECK to identify your license secret.

The license file can have any name.

You can easily create this secret using kubectl built-in support for secrets. Note that it must be in the same namespace as the operator:

kubectl create secret generic eck-license --from-file=my-license-file.json -n elastic-system
kubectl label secret eck-license "license.k8s.elastic.co/scope"=operator -n elastic-system

After you install a license into ECK, the Enterprise features of the operator are available, like Elasticsearch autoscaling and support for Elastic Maps Server. All the Elastic Stack applications you manage with ECK will have Platinum and Enterprise features enabled. The _license API reports that individual Elasticsearch clusters are running under an Enterprise license, and the elastic-licensing ConfigMap contains the current license level of the ECK operator. The applications created before you installed the license are upgraded to Platinum or Enterprise features without interruption of service after a short delay.

The Elasticsearch _license API for versions before 8.0.0 reports a Platinum license level for backwards compatibility even if an Enterprise license is installed.

Update your license

edit

Before your current Enterprise license expires, you will receive a new Enterprise license from Elastic (provided that your subscription is valid).

You can check the expiry date of your license in the elastic-licensing ConfigMap. Enterprise licenses are container licenses that include multiple licenses for individual Elasticsearch clusters with shorter expiry. Therefore, you get a different expiry in Kibana or through the Elasticsearch _license API. ECK automatically updates the Elasticsearch cluster licenses until the expiry date of the ECK Enterprise license is reached.

To avoid any unintended downgrade of individual Elasticsearch clusters to a Basic license while installing the new license, we recommend installing the new Enterprise license as a new Kubernetes secret next to your existing Enterprise license. Just replace eck-license with a different name in the Kubernetes secret example. ECK will use the correct license automatically.

Once you have created the new license secret you can safely delete the old license secret.

Get usage data

edit

The operator periodically writes the total amount of Elastic resources under management to a configmap named elastic-licensing, which is in the same namespace as the operator. Here is an example of retrieving the data:

> kubectl -n elastic-system get configmap elastic-licensing -o json | jq .data
{
  "eck_license_level": "enterprise",
  "eck_license_expiry_date": "2022-01-01T00:59:59+01:00",
  "enterprise_resource_units": "1",
  "max_enterprise_resource_units": "10",
  "timestamp": "2020-01-03T23:38:20Z",
  "total_managed_memory": "64GiB",
  "total_managed_memory_bytes": "68719476736"
}

If the operator metrics endpoint is enabled with the --metrics-port flag (check Configure ECK), license usage data will be included in the reported metrics.

> curl "$ECK_METRICS_ENDPOINT" | grep elastic_licensing
# HELP elastic_licensing_enterprise_resource_units_total Total enterprise resource units used
# TYPE elastic_licensing_enterprise_resource_units_total gauge
elastic_licensing_enterprise_resource_units_total{license_level="basic"} 6
# HELP elastic_licensing_memory_gigabytes_total Total memory used in GB
# TYPE elastic_licensing_memory_gigabytes_total gauge
elastic_licensing_memory_gigabytes_total{license_level="basic"} 357.01915648