Updating Elastic X-Pack licenses

A 30-day trial Elastic X-Pack license is included during the IBM Cloud Private logging service installation. This trial license allows access to all features. It is generated by the logging instance itself and is referred to as a self-generated trial license. The logging service can be updated with customized licenses obtained by the customer.

Before you begin, consider the following tips:

Complete the following steps to update your license.

  1. Acquire Elastic license. Based on the wanted feature set, acquire a license in JSON format. For more information, see Basic subscriptions Opens in a new tab.

  2. Check your existing license.

    • Log in to Kibana console and click Dev Tools.
    • From the left navigation window, prepare the request to retrieve and review your license:

      GET /_xpack/license
      
    • Click the green triangle to make the API call. 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
        }
      }
      
  3. 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.

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

        xpack:
          monitoring: true
          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
    

    If xpack.license.source is set to selfGenerated, a new 30-day license is requested from Elasticsearch every time the Elasticsearch master pod is restarted.

  5. 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.

  6. 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 6:

       curl -k https://<master ip>:8443/mgmt-repo/requiredAssets/ibm-icplogging-x.y.z.tgz > ibm-icplogging-x.y.z.tgz
      
  7. Upgrade Helm chart

    Run the following command. Replace x.y.z with the version that you found in Step 6:

    helm upgrade logging ibm-icplogging-x.y.z.tgz -f values-old.yaml -f xpack.yaml --recreate-pods --force --timeout 600 --tls
    
  8. 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
    
  9. Validate your license update. Wait for 10 more minutes, then follow Step 2 to verify that Elasticsearch returns the expected license.