Scaling the ingestion tier with HPA
You can use Kubernetes HorizontalPodAutoscaler to automatically scale IngestorCluster replicas.
To automatically adjust the number of IngestorCluster replicas according to ingestion demand, you can use the Kubernetes HorizontalPodAutoscaler (HPA). HPA uses the metrics you specify as the basis for deciding when to add replicas because current capacity is insufficient or remove replicas because traffic has decreased.
HPA is a Kubernetes resource and is not managed by Splunk Operator for Kubernetes (SOK).
You can configure HPA to scale the IngestorCluster. Configure the minimum and maximum number of replicas and scaling metrics according to your workload.
The following manifest is an example only and must be adapted to your environment. It configures a HorizontalPodAutoscaler named ingestor-hpa to scale the IngestorCluster custom resource named ingestor. With average utilization set to 50%, the HPA scales ingestor between 3 and 10 replicas.
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: ingestor-hpa
spec:
scaleTargetRef:
apiVersion: enterprise.splunk.com/v4
kind: IngestorCluster
name: ingestor
minReplicas: 3
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
For more information about HPA, search Kubernetes documentation for HorizontalPodAutoscaler.