# 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\. Create a kubernetes secret with the license key using the command line or UI. If the secret is created using the command line (`kubectl`), you must manually create or update the license custom resource to reference the secret.

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

1. Execute the following command:

```
kubectl create secret generic <secret_name> --from-literal=trilioLicense=<license-key>  -n <T4K-installation-namespace>
```

2. Apply the license custom resource referencing the created secret:

```
kubectl apply -f - <<EOF
apiVersion: triliovault.trilio.io/v1
kind: License
metadata:
  name: license-sample
  namespace: <T4K-installation-namespace>
spec:
  secretRef:
    name: <secret_name> 
    namespace: <T4K-installation-namespace>
EOF
```

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

```
NAME             STATUS   MESSAGE                           EXPIRATION TIME
trilio-license   Active   License Activated successfully.   2026-02-18T00:00:00Z
```

{% 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](https://docs.trilio.io/kubernetes/advanced-configuration/management-console/ui-authentication "mention").
2. Configure access to the Management Console (UI). Refer to [accessing-the-ui](https://docs.trilio.io/kubernetes/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/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.

   <pre class="language-yaml"><code class="lang-yaml">apiVersion: v1
   kind: Secret
   metadata:
     name: trilio-license-secret
     namespace: tvk
   type: Opaque
   data:
     trilioLicense: &#x3C;license-key> // must provide values as base64-encoded string.
   <strong>---
   </strong><strong>apiVersion: triliovault.trilio.io/v1
   </strong>kind: License
   metadata:
     name: trilio-license
     namespace: tvk
   spec:
      secretRef:
        name: trilio-license-secret           
        namespace: tvk
   </code></pre>

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