Skip to content
57 changes: 53 additions & 4 deletions docs/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ deployments.
- [Installing Splunk Apps](#installing-splunk-apps)
- [Using Apps for Splunk Configuration](#using-apps-for-splunk-configuration)
- [Creating a LicenseMaster Using a ConfigMap](#creating-a-licensemaster-using-a-configmap)
- [Configuring Standalone to use License Master](#configuring-standalone-to-use-license-master)
- [Configuring Indexer Clusters to use License Master](#configuring-indexer-clusters-to-use-license-master)
- [Using an External License Master](#using-an-external-license-master)
- [Using an External Indexer Cluster](#using-an-external-indexer-cluster)
- [Managing global kubernetes secret object](#managing-global-kubernetes-secret-object)
Expand All @@ -28,7 +30,6 @@ Please refer to the [Custom Resource Guide](CustomResources.md) for more
information about the custom resources that you can use with the Splunk
Operator.


## Creating a Clustered Deployment

The two basic building blocks of Splunk Enterprise are search heads and
Expand Down Expand Up @@ -579,12 +580,14 @@ Note that `licenseUrl` may specify a local path or URL such as
"https://myco.com/enterprise.lic", and the `volumes` parameter can
be used to mount any type of [Kubernetes Volumes](https://kubernetes.io/docs/concepts/storage/volumes/).

Finally, configure all of your other Splunk Enterprise components to use
the `LicenseMaster` by adding `licenseMasterRef` to their spec:
## Configuring Standalone to use License Master

Once a LicenseMaster is created, you can configure your `Standalone` to use
the `LicenseMaster` by adding `licenseMasterRef` to its spec as follows:

```yaml
apiVersion: enterprise.splunk.com/v1
kind: IndexerCluster
kind: Standalone
metadata:
name: example
finalizers:
Expand All @@ -594,6 +597,52 @@ spec:
name: example
```

## Configuring Indexer Clusters to use License Master

While configuring [`Indexer Clusters`](Examples.md#indexer-clusters) to use the `LicenseMaster`, you need to add `licenseMasterRef` only to the `ClusterMaster` spec as follows:

```yaml
cat <<EOF | kubectl apply -f -
apiVersion: enterprise.splunk.com/v1
kind: ClusterMaster
metadata:
name: example-cm
finalizers:
- enterprise.splunk.com/delete-pvc
spec:
licenseMasterRef:
name: example
---
apiVersion: enterprise.splunk.com/v1
kind: IndexerCluster
metadata:
name: example-idc
finalizers:
- enterprise.splunk.com/delete-pvc
spec:
clusterMasterRef:
name: example-cm
EOF
```

In order to forward `LicenseMaster` logs to the above `Indexer Cluster`, you need to add `clusterMasterRef` to the `LicenseMaster` spec as follows:

```yaml
apiVersion: enterprise.splunk.com/v1
kind: LicenseMaster
metadata:
name: example
finalizers:
- enterprise.splunk.com/delete-pvc
spec:
volumes:
- name: licenses
configMap:
name: splunk-licenses
licenseUrl: /mnt/licenses/enterprise.lic
clusterMasterRef:
name: example-cm
```

## Using an External License Master

Expand Down