# 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 Methods](/kubernetes/configuration/management-console/ui-authentication-intro.md).
2. Configure access to the Management Console (UI). Refer to [Configuring the UI](/kubernetes/configuration/management-console/accessing-the-ui.md).
   {% endhint %}

If you have already executed the above prerequisites, then refer to the guide for applying a license in the UI: [Cluster Management (Home)](/kubernetes/user-guide/getting-started-with-management-console/navigating-intro/cluster-management-home.md#actions-license-update)
{% 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trilio.io/kubernetes/installation/licensing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
