> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamnative.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure licenses

This page introduces how to configure and manage the license in the StreamNative Private Cloud.

Before installing the StreamNative Private Cloud, you need to import a valid license. Otherwise, StreamNative Private Cloud will stop reconciling with a "no valid license" error message:

```
ERROR	controller.pulsarcoordinator	Reconciler error	{"reconciler group": "k8s.streamnative.io", "reconciler kind": "PulsarCoordinator", "name": "private-cloud", "namespace": "pulsar", "error": "No valid license has been found under namespace operators, please contact https://streamnative.io/deployment/start-free-trial"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
```

If you do not have any license, you can apply for a trial from [https://streamnative.io/deployment/private-cloud-license](https://streamnative.io/deployment/private-cloud-license).

## Import a license

StreamNative Private Cloud provides a license using the Kubernetes [Secret](https://kubernetes.io/docs/concepts/configuration/secret/).

To import a license, follow these steps:

1. Get a license token from StreamNative.
2. Define a license manifest like the example below:

<Note title="Note">
  `metadata.labels` with the `cloud.streamnative.io/type: "license"` is required because the `sn-operator` will detect secrets in its namespace with label and to import automatically.
</Note>

```
apiVersion: v1
kind: Secret
metadata:
  labels:
    cloud.streamnative.io/type: "license"
  name: sn-license
  namespace: "the Kubernetes namespace you will install the StreamNative Operator"
type: Opaque
stringData:
  license: "Your license token"
```

3. Run the following command to import your license.

```
kubectl apply -f <your-license-secret-file>
```

## Update a license

Before your current license expires, you need to contact the StreamNative to get a new one.

To update the license, you need to import the new license as a new Kubernetes Secret with a different secret name in the same namespace. StreamNative Private Cloud Operators will automatically detect the new Secret and adopt the new license.

## View license status and resource utilization

StreamNative Private Cloud Operators maintain and store the license status and resource usage data to a Kubernetes [ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) named `sn-valid-license`. By default, the ConfigMap is stored in the namespace where StreamNative Private Cloud Operators are installed.

Run the command below to view the license status and resource utilization.

```
kubectl get configmap sn-private-cloud-license -n operators -o json | jq .data

{
  "issued_to": "Contoso",
  "issuer": "StreamNative, Inc.",
  "email": "contoso@gmail.com",
  "expiry_date_in_seconds": "1678867200",
  "issue_date_in_seconds": "1678796436",
  "type": "trial",
  "status": "active",
  "max_compute_unit": "1",
  "max_storage_unit": "1",
  "used_compute_unit": "1500m",
  "used_storage_unit": "3"
}
```
