# Licensing

## Licensing Methodology

Trilio for Kubernetes must be presented with a valid license to operate. A license is issued as valid for a specified duration of time. The license becomes invalid once its duration expires

## Licensing Trilio for Kubernetes

To generate and apply the Trilio license, perform the following steps:

1\. Obtain a license by getting in touch with us [here](https://trilio.io/request-demo/). The license file will contain the license key.

2\. Apply the license file to a Trilio instance using the command line or UI:

{% tabs %}
{% tab title="Command line" %}

1. Execute the following command:

```
kubectl apply -f <licensefile> -n <install_namespace>
```

2\. If the previous step is successful, check that the output generated is similar to the following:

```
NAMESPACE   NAME             STATUS   MESSAGE                                   CURRENT CPU COUNT   GRACE PERIOD END TIME   EDITION     CAPACITY   EXPIRATION TIME        MAX CPUS
tvk         license-sample   Active   Cluster License Activated successfully.   4                                           FreeTrial   10         2025-07-08T00:00:00Z   8
```

{% hint style="info" %}
Additional license details can be obtained using the following: `kubectl get license -o json`
{% endhint %}
{% endtab %}

{% tab title="Management Console (UI)" %}
{% hint style="info" %}
Prerequisites:

1. Authenticate access to the Management Console (UI). Refer to [ui-authentication-intro](https://docs.trilio.io/kubernetes/4.0.x/advanced-configuration/management-console/ui-authentication-intro "mention").
2. Configure access to the Management Console (UI). Refer to [accessing-the-ui](https://docs.trilio.io/kubernetes/4.0.x/advanced-configuration/management-console/accessing-the-ui "mention").
   {% endhint %}

If you have already executed the above prerequisites, then refer to the guide for applying a license in the UI: [#actions-license-update](https://docs.trilio.io/kubernetes/4.0.x/using-trilio/getting-started-with-management-console/navigating-intro/cluster-management-home#actions-license-update "mention")
{% endtab %}
{% endtabs %}

3. Here is the sample of license YAML file which can be saved as `<licensefile.yaml>`.

   ```yaml
   apiVersion: triliovault.trilio.io/v1
   kind: License
   metadata:
     name: trilio-license
     namespace: tvk
   spec:
     key: <generated-key-required-for-license>
   ```

### Upgrading a license

A license upgrade is required when moving from one license type to another (Trial -> Enterprise and vice-versa). Trilio maintains only one instance of a license for every installation of Trilio for Kubernetes.

To upgrade a license, run `kubectl apply -f <licensefile> -n <install-namespace>` against a new license file to activate it. The previous license will be replaced automatically.
