Updating Elastic X-Pack licenses

Starting with IBM Cloud Private logging 3.2.1, there are three options available to configure X-Pack licenses for the Elastic stack. These options are available for logging instances in managed or standard mode.

Checking current licenses

  1. Log in to the Kibana console and click Dev tools.
  2. From the navigation window, prepare the request to retrieve and review your license.

    GET /_xpack/license
    
  3. To make the API call, click the button adjacent to your request payload. The following example resembles your current license.

    {
      "license": {
        "status": "active",
        "uid": "46e1db38-a100-44bc-9a3a-69542a1aaf7e",
        "type": "trial",
        "issue_date": "2019-01-03T20:16:07.591Z",
        "issue_date_in_millis": 1546546567591,
        "expiry_date": "2019-02-02T20:16:07.591Z",
        "expiry_date_in_millis": 1549138567591,
        "max_nodes": 1000,
        "issued_to": "elasticsearch",
        "issuer": "elasticsearch",
        "start_date_in_millis": -1
      }
    }
    

Using trial licenses

Complete the following steps to update your license.

  1. Create a xpack.yaml file that refers to the Secret and enables the wanted services.

    xpack:
      license:
        # accepted values: secret, selfGenerated
        # what it does: determines which xpack license will be used
        source: selfGenerated
        selfGenerated:
          # accepted values: trial, basic
          # what it does:
          # see https://www.elastic.co/guide/en/elasticsearch/reference/6.8/license-settings.html
          type: trial
    
  2. Extract the existing logging chart parameters.

    • Extract Helm parameters by running the following command.

      helm get values logging --tls > values-old.yaml
      
    • Optionally, apply prior adjustments. All Kubernetes resource manifest adjustments that are made by using the kubectl command are overridden with values that are defined in chart parameters. Replica count, JVM heap size, or container memory limits are a few examples. If prior Kubernetes resource manifests were adjusted, make sure that you apply the same adjustments to values-old.yaml.

  3. Download the chart.

    • Identify the chart version. Logging chart versions vary based on the installed IBM Cloud Private version. You can use the IBM Cloud Private management console to find chart versions in the service catalog. The logging chart is identified by the name ibm-icplogging under the mgmt-repo repository. You can also select SOURCE & TAR FILES from the IBM Cloud Private management console to find a local link to a chart.
    • Download the chart .tar file. Run the following command by using the local link found in Step 3.
      curl -k https://<master ip>:8443/mgmt-repo/requiredAssets/ibm-icplogging-x.y.z.tgz > ibm-icplogging-x.y.z.tgz
      
  4. Upgrade Helm chart. Run the following command. Replace x.y.z with the version that you found in Step 3.

    helm upgrade logging ibm-icplogging-x.y.z.tgz -f values-old.yaml -f xpack.yaml --recreate-pods --force --timeout 600 --tls
    
  5. The logging service becomes available in approximately 5 - 10 minutes. You can also check Helm upgrade status by using the following command.

     helm history --tls logging
    
  6. Validate your license update. Wait for 10 more minutes, then follow steps in Checking current licenses to verify that Elasticsearch returns the expected license.

Using free basic licenses

A self-generated free basic license is used by default. If you need to change license settings back to using a basic license, follow the instructions in Using trial licenses except in Step 1, set xpack.license.selfGenerated.type to basic.

Bring your own license

Complete the following steps to update your license.

  1. Acquire the Elastic license based on the feature set that you want. Elastic license comes in JSON format.
  2. In the namespace of the logging deployment, create a Kubernetes Secret that contains the license.
    kubectl create secret generic es-license --from-file=./license.json --namespace=<logging namespace>
    

For the system logging deployment, <logging namespace> is kube-system. For all other logging releases, it is the namespace that hosts the logging deployment.

  1. Create a xpack.yaml file that refers to the Secret and enables the services that you want.
    xpack:
      license:
        # accepted values: secret, selfGenerated
        # what it does: determines which xpack license will be used
        source: secret
        secret:
          # the secret needs to be in the same namespace as the chart release
          secretName: es-license
          # the Kubenetes field name (key) within the specified secret
          # that stores license json file
          fieldName: license.json
    
  2. Extract the existing logging chart parameters.

    • Extract Helm parameters by running the following command.

      helm get values logging --tls > values-old.yaml
      
    • Optionally, apply prior adjustments. All Kubernetes resource manifest adjustments that are made by using the kubectl command are overridden with values that are defined in chart parameters. Replica count, JVM heap size, or container memory limits are a few examples. If prior Kubernetes resource manifests were adjusted, make sure that you apply the same adjustments to values-old.yaml.

  3. Download the chart.

    • Identify the chart version. Logging chart versions vary based on the installed IBM Cloud Private version. You can use IBM Cloud Private management console to find chart versions in the service catalog. The logging chart can be identified by the name ibm-icplogging under the mgmt-repo repository. You can also select SOURCE & TAR FILES from the IBM Cloud Private management console to find a local link to a chart.
    • Download the chart .tar file. Run the following command by using the local link found in Step 5:
      curl -k https://<master ip>:8443/mgmt-repo/requiredAssets/ibm-icplogging-x.y.z.tgz > ibm-icplogging-x.y.z.tgz
      
  4. Upgrade Helm chart. Run the following command. Replace x.y.z with the version that you found in Step 5:

    helm upgrade logging ibm-icplogging-x.y.z.tgz -f values-old.yaml -f xpack.yaml --recreate-pods --force --timeout 600 --tls
    
  5. The logging service becomes available in approximately 5 - 10 minutes. You can also check Helm upgrade status by using the following command.

     helm history --tls logging
    
  6. Validate your license update. Wait for 10 more minutes, then follow steps in Checking current licenses to verify that Elasticsearch returns the expected license.