Skip to content

Latest commit

 

History

History
224 lines (180 loc) · 11.1 KB

CustomResources.md

File metadata and controls

224 lines (180 loc) · 11.1 KB

Custom Resource Guide

The Splunk Operator provides a collection of custom resources you can use to manage Splunk Enterprise deployments in your Kubernetes cluster.

For examples on how to use these custom resources, please see Configuring Splunk Enterprise Deployments.

Metadata Parameters

All resources in Kubernetes include a metadata section. You can use this to define a name for a specific instance of the resource, and which namespace you would like the resource to reside within:

Key Type Description
name string Each instance of your resource is distinguished using this name.
namespace string Your instance will be created within this namespace. You must ensure that this namespace exists beforehand.

If you do not provide a namespace, you current context will be used.

apiVersion: enterprise.splunk.com/v1alpha2
kind: Standalone
metadata:
  name: s1
  namespace: splunk
  finalizers:
  - enterprise.splunk.com/delete-pvc

The enterprise.splunk.com/delete-pvc finalizer is optional, and may be used to tell the Splunk Operator that you would like it to remove all the Persistent Volumes associated with the instance when you delete it.

Common Spec Parameters for All Resources

apiVersion: enterprise.splunk.com/v1alpha2
kind: Standalone
metadata:
  name: example
spec:
  imagePullPolicy: Always
  resources:
    requests:
      memory: "64Mi"
      cpu: "250m"
    limits:
      memory: "128Mi"
      cpu: "500m"

The spec section is used to define the desired state for a resource. All custom resources provided by the Splunk Operator include the following configuration parameters:

Key Type Description
image string Container image to use for pod instances (overrides RELATED_IMAGE_SPLUNK_ENTERPRISE or RELATED_IMAGE_SPLUNK_SPARK environment variables)
imagePullPolicy string Sets pull policy for all images (either "Always" or the default: "IfNotPresent")
schedulerName string Name of Scheduler to use for pod placement (defaults to "default-scheduler")
affinity Affinity Kubernetes Affinity rules that control how pods are assigned to particular nodes
resources ResourceRequirements CPU and memory compute resource requirements to use for each pod instance
serviceTemplate Service Template used to create Kubernetes Services

Common Spec Parameters for Splunk Enterprise Resources

apiVersion: enterprise.splunk.com/v1alpha2
kind: Standalone
metadata:
  name: example
spec:
  storageClassName: gp2
  etcStorage: "100Gi"
  varStorage: "500Gi"
  volumes:
    - name: licenses
      configMap:
        name: splunk-licenses
  licenseMasterRef:
    name: example
  indexerClusterRef:
    name: example

The following additional configuration parameters may be used for all Splunk Enterprise resources, including: Standalone, LicenseMaster, SearchHeadCluster, and IndexerCluster:

Key Type Description
storageClassName string Name of StorageClass to use for persistent volume claims
etcStorage string Storage capacity to request for Splunk etc volume claims (default="10Gi")
varStorage string Storage capacity to request for Splunk var volume claims (default="100Gi")
volumes []Volume List of one or more Kubernetes volumes. These will be mounted in all container pods as as /mnt/<name>
defaults string Inline map of default.yml overrides used to initialize the environment
defaultsUrl string Full path or URL for one or more default.yml files, separated by commas
licenseUrl string Full path or URL for a Splunk Enterprise license file
licenseMasterRef ObjectReference Reference to a Splunk Operator managed LicenseMaster instance (via name and optionally namespace) to use for licensing
indexerClusterRef ObjectReference Reference to a Splunk Operator managed IndexerCluster instance (via name and optionally namespace) to use for indexing

Spark Resource Spec Parameters

apiVersion: enterprise.splunk.com/v1alpha2
kind: Spark
metadata:
  name: example
spec:
  replicas: 3

In addition to Common Spec Parameters for All Resources, the Spark resource provides the following Spec configuration parameters:

Key Type Description
replicas integer The number of spark workers pods (defaults to 1)

LicenseMaster Resource Spec Parameters

apiVersion: enterprise.splunk.com/v1alpha2
kind: LicenseMaster
metadata:
  name: example
spec:
  volumes:
    - name: licenses
      configMap:
        name: splunk-licenses
  licenseUrl: /mnt/licenses/enterprise.lic

Please see Common Spec Parameters for All Resources and Common Spec Parameters for All Splunk Enterprise Resources. The LicenseMaster resource does not provide any additional configuration parameters.

Standalone Resource Spec Parameters

apiVersion: enterprise.splunk.com/v1alpha2
kind: Standalone
metadata:
  name: example
spec:
  sparkImage: splunk/spark:edge
  sparkRef:
    name: example

In addition to Common Spec Parameters for All Resources and Common Spec Parameters for All Splunk Enterprise Resources, the Standalone resource provides the following Spec configuration parameters:

Key Type Description
replicas integer The number of standalone replicas (defaults to 1)
sparkImage string Container image Data Fabric Search (DFS) will use for JDK and Spark libraries (overrides RELATED_IMAGE_SPLUNK_SPARK environment variables)
sparkRef ObjectReference Reference to a Splunk Operator managed Spark instance (via name and optionally namespace). When defined, Data Fabric Search (DFS) will be enabled and configured to use it.

SearchHeadCluster Resource Spec Parameters

apiVersion: enterprise.splunk.com/v1alpha2
kind: SearchHeadCluster
metadata:
  name: example
spec:
  replicas: 5
  sparkImage: splunk/spark:edge
  sparkRef:
    name: example

In addition to Common Spec Parameters for All Resources and Common Spec Parameters for All Splunk Enterprise Resources, the SearchHeadCluster resource provides the following Spec configuration parameters:

Key Type Description
replicas integer The number of search heads cluster members (minimum of 3, which is the default)
sparkImage string Container image Data Fabric Search (DFS) will use for JDK and Spark libraries (overrides RELATED_IMAGE_SPLUNK_SPARK environment variables)
sparkRef ObjectReference Reference to a Splunk Operator managed Spark instance (via name and optionally namespace). When defined, Data Fabric Search (DFS) will be enabled and configured to use it.

IndexerCluster Resource Spec Parameters

apiVersion: enterprise.splunk.com/v1alpha2
kind: IndexerCluster
metadata:
  name: example
spec:
  replicas: 3

In addition to Common Spec Parameters for All Resources and Common Spec Parameters for All Splunk Enterprise Resources, the IndexerCluster resource provides the following Spec configuration parameters:

Key Type Description
replicas integer The number of indexer cluster members (defaults to 1)