Configure License Manager
Set up a License Manager for Splunk Operator deployments.
Create a LicenseManager using a ConfigMap and configure Standalone and Indexer Cluster deployments to use it.
- Create a ConfigMap that contains your license file or files.
CODE
kubectl create configmap splunk-licenses --from-file=enterprise.licThe ConfigMap can contain multiple license files:
CODEkubectl create configmap splunk-licenses --from-file=enterprise1.lic,enterprise2.lic - Create a LicenseManager custom resource that mounts the ConfigMap and sets licenseUrl.
The following example uses API version
v4, the nameexample, namespacesplunk-operator, a volume namedlicensesbacked by thesplunk-licensesConfigMap, and licenseUrl pointing at the mounted file:CODEapiVersion: enterprise.splunk.com/v4 kind: LicenseManager metadata: name: example namespace: splunk-operator finalizers: - enterprise.splunk.com/delete-pvc spec: volumes: - name: licenses configMap: name: splunk-licenses licenseUrl: /mnt/licenses/enterprise.licNote:licenseUrl can reference more than one license as a comma-separated list:
CODElicenseUrl: "/mnt/licenses/enterprise1.lic,/mnt/licenses/enterprise2.lic"Note:licenseUrl can specify a local path or a URL such as
https://myco.com/enterprise.lic. You can mount any Kubernetes volume type under volumes. See Volumes in the Kubernetes documentation. - Configure Standalone to use the License Manager by adding licenseManagerRef to the Standalone
spec.CODEapiVersion: enterprise.splunk.com/v4 kind: Standalone metadata: name: example namespace: splunk-operator finalizers: - enterprise.splunk.com/delete-pvc spec: licenseManagerRef: name: example - Configure Indexer Clusters to use the License Manager by adding licenseManagerRef only to the ClusterManager
spec.CODEcat <<EOF | kubectl apply -f - apiVersion: enterprise.splunk.com/v4 kind: ClusterManager metadata: name: example-cm namespace: splunk-operator finalizers: - enterprise.splunk.com/delete-pvc spec: licenseManagerRef: name: example --- apiVersion: enterprise.splunk.com/v3 kind: IndexerCluster metadata: name: example-idc namespace: splunk-operator finalizers: - enterprise.splunk.com/delete-pvc spec: clusterManagerRef: name: example-cm EOFTo forward License Manager logs to the Indexer Cluster, add clusterManagerRef to the LicenseManager
spec:CODEapiVersion: enterprise.splunk.com/v4 kind: LicenseManager metadata: name: example namespace: splunk-operator finalizers: - enterprise.splunk.com/delete-pvc spec: volumes: - name: licenses configMap: name: splunk-licenses licenseUrl: /mnt/licenses/enterprise.lic clusterManagerRef: name: example-cm