Update Confluent Platform License¶
You can use Confluent for Kubernetes (CFK), Kafka, and Confluent Control Center for a 30-day trial period without a license key. After 30 days, Confluent for Kubernetes and Confluent components require license keys. See Confluent Platform Licenses for information about Confluent licenses, including types of licenses.
When using CFK, you have two options to configure the license for Confluent Platform components:
Important
When you update the global or component license, restart the components that use the license so that the license change propagates to the component.
Update CFK global license¶
The CFK configures the global license key for Confluent components.
To add or update the CFK license key, navigate to the directory that has the downloaded CFK bundle. Navigate to the
helm
sub-directory and run the following command:helm upgrade --install confluent-operator ./confluent-for-kubernetes \ --set licenseKey=<CFK license key>
When the above command runs, the
confluent-operator-licensing
secret is created with thelicense.txt
andpublicKey.pem
files:license.txt
contains the<CFK license key>
you specified in the command.publicKey.pem
contains the public key used to validate the signed license. This key is only used by CFK and is not used by Confluent Platform components.
To use the global license set in CFK, repeat the following steps for each component that you want to apply the license to:
Set the following in the component custom resource (CR):
spec: license: globalLicense: true
Apply the component CR change.
If you have multiple component CRs defined in a single file, you only need to run the command once after setting
spec.license.globalLicense
properties in all the component CRs.kubectl apply -f <component CR> --namespace <namespace>
Restart the updated components to use the global license.
Find the name of the StatefulSet corresponding to the Confluent Platform cluster you want to restart:
kubectl get statefulset --namespace <namespace>
Using the StatefulSet name,
<name-of-statefulset>
, from the previous step, roll the cluster:kubectl rollout restart statefulset/<name-of-statefulset> \ --namespace <namespace>
When using the global license, CFK creates the confluent-operator-licensing
and internal-confluent-operator-licensing
secrets. The secrets are used by
Confluent Platform components and should not be deleted.
Update component-level licenses¶
You can configure the license structure at the component-level which takes precedence over the license configured by CFK.
The component-level license can be provided using one of the following methods:
The license.txt
file is required to be present either in the secretRef
or directoryPathInContainer
path.
If both secretRef
or directoryPathInContainer
is configured,
directoryPathInContainer
takes precedence.
Component-level license configuration with Kubernetes secrets¶
To provide a component license key using a Kubernetes secret:
Create the
license.txt
file withlicense=<your license key>
:echo -n "license=<your license key>" > license.txt
Create a Kubernetes secret for the
license.txt
file.--from-file=license.txt=
should be included in the command:For example, with the
license.txt
file in the current directory:kubectl create secret generic confluent-license \ --from-file=license.txt=./license.txt \ --namespace <namespace>
Set the secret name in the component CR. Using the previous example:
spec: license: secretRef: confluent-license
Apply the component CR change:
kubectl apply -f <component CR> --namespace <namespace>
Roll the component cluster to apply the license change.
Find the name of the StatefulSet corresponding to the Confluent Platform cluster you want to restart:
kubectl get statefulset --namespace <namespace>
Using the StatefulSet name,
<name-of-statefulset>
, from the previous step, roll the cluster:kubectl rollout restart statefulset/<name-of-statefulset> \ --namespace <namespace>
Component-level license configuration with an external secret provider¶
To provide a component license key using an external secret provider, such as HashiCorp Vault:
Install and configure Vault.
Create the
license.txt
file withlicense=<your license key>
:echo -n "license=<your license key>" > license.txt
Write
license.txt
to Vault. For example:cat ./license.txt | \ vault kv put /secrets/license.txt license=-
Set the secret name in the component CR. Using the previous example:
spec: license: directoryPathInContainer: /vault/secrets
Apply the component CR change:
kubectl apply -f <component CR> --namespace <namespace>
Roll the component cluster to apply the license change.
Find the name of the StatefulSet corresponding to the Confluent Platform cluster you want to restart:
kubectl get statefulset --namespace <namespace>
Using the StatefulSet name,
<name-of-statefulset>
, from the previous step, roll the cluster:kubectl rollout restart statefulset/<name-of-statefulset> \ --namespace <namespace>