
Autoscaling Node Pools
Node pools support autoscaling through standard Kubernetes Horizontal
Pod Autoscalers (HPAs). The operator does not create an HPA
automatically. Instead, the operator creates a shadow
HumioNodePool custom resource for
each node pool that exposes a
/scale subresource. You create an
HPA separately that targets this shadow resource.
To enable autoscaling, two feature flags are required:
enableIndependentHumioNodePools: true: Creates the shadowHumioNodePoolCRs with the/scaleendpoint that an HPA can target.enableDownscalingFeature: true: Allows the operator to remove pods when the HPA scales down the replica count.
Add an autoscaling block to the
node pool spec to define the replica bounds. When
autoscaling is configured, the
nodeCount field becomes optional
for that node pool; the HPA manages the replica count through the shadow
resource instead.
apiVersion: core.humio.com/v1alpha1
kind: HumioCluster
metadata:
name: example-humiocluster
spec:
image: humio/humio-core:1.244.0
nodeCount: 1
license:
secretKeyRef:
name: example-humiocluster-license
key: data
featureFlags:
enableDownscalingFeature: true
enableIndependentHumioNodePools: true
nodePools:
- name: ingest-only
spec:
autoscaling:
minReplicas: 1
maxReplicas: 2
resources:
limits:
cpu: "2"
memory: 4Gi
requests:
cpu: "1"
memory: 2Gi
dataVolumePersistentVolumeClaimSpecTemplate:
storageClassName: standard
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 10Gi
environmentVariables:
- name: NODE_ROLES
value: lightweightingestonly
Once the HumioCluster is applied, the operator creates a shadow
HumioNodePool resource named
<cluster-name>-<pool-name>.
Create an HPA that targets this shadow resource:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: ingest-only-hpa
spec:
scaleTargetRef:
apiVersion: core.humio.com/v1alpha1
kind: HumioNodePool
name: example-humiocluster-ingest-only
minReplicas: 1
maxReplicas: 2
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
The HPA adjusts the replica count on the shadow
HumioNodePool through its
/scale endpoint. The operator
reads this value and adjusts the number of running pods accordingly.
Note
A metrics provider such as the Kubernetes Metrics Server must be installed in the cluster for the HPA to function.