
- Discover searches take a long time to return results.
- Newest log lines appear with several minutes of delay.
elasticsearch-0) has CPU pegged. What can Bob actually change to recover search speed and lower ingestion lag?
Two high-level directions exist: make a pod bigger (vertical scaling) or add more pods (horizontal scaling). Both are valid and often used together.

Vertical scaling (make a pod larger)
Vertical scaling is straightforward to understand. In Kubernetes you set container resourcerequests and limits. The scheduler reserves CPU/memory based on requests, and the runtime enforces limits. Example:
cpu: "250m"→ 250 millicores (0.25 CPU) requestedcpu: "500m"→ 500 millicores (0.5 CPU) limit
Horizontal scaling (add more pods)
Start with Fluentd. A DaemonSet ensures one Fluentd pod per node, so newly added nodes automatically get a collector. But that doesn’t help when a single node is noisy and produces far more logs than others.
nodeSelector or nodeAffinity) so they run alongside the DaemonSet pod. Example Deployment to add two extra collectors on nodes labeled logging=busy:

Can you add more Elasticsearch pods?
You can only add more Elasticsearch pods to gain parallelism if the data can be split across shards. Right now Bob’s Fluentd index uses a single primary shard:number_of_shards: 1. A second Elasticsearch pod would have no shard to host, so the cluster wouldn’t get parallelism for that index.
Elasticsearch uses shards to distribute an index. To change the shard count for existing data you typically:
- Create a new index configured with the desired number of primary shards.
- Reindex data from the old index into the new index using the Reindex API.
- Verify, switch aliases, and remove the old index.

You cannot change the number of primary shards for an existing index in place. Reindexing moves data into a new index and can be resource-intensive; plan reindex windows, replica settings, and shard allocation accordingly. Always snapshot before major index operations.
Handle fluctuating load with autoscaling
Load often fluctuates (for example high during daytime, low at night). Manually adjusting pods around the clock is impractical. Kubernetes can autoscale pods if it can see their resource usage.- Install the Metrics Server to expose pod CPU and memory metrics via the
metrics.k8s.ioAPI. - Configure a Horizontal Pod Autoscaler (HPA) to maintain a target utilization (e.g., aim for 80% CPU across Elasticsearch pods, with min/max replica counts).



Install Metrics Server and start with conservative HPA thresholds. Monitor behavior and adjust
min/max pod counts, target CPU, and stabilization settings to avoid oscillation. See the Kubernetes HPA docs for more details: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/.Quick comparison and guidance
CLI sequence — apply these changes
Adjust names, namespaces, and endpoints to match your cluster. These commands illustrate the typical order: install Metrics Server, update Elasticsearch resources, deploy extra Fluentd collectors, create a sharded index and reindex data, then add an HPA.Summary: patterns to apply
- Tune resource
requestsandlimitsfor steady load (vertical scaling). - Add targeted Fluentd collectors on busy nodes to spread ingestion (horizontal for collectors).
- Reshard Elasticsearch indexes by creating new indexes and reindexing data when you need parallelism (horizontal for data).
- Use Metrics Server + HPA to automate scaling for predictable load cycles.
- Elasticsearch docs: https://www.elastic.co/guide/
- Kubernetes HPA docs: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
- Fluentd plugin/buffering: https://docs.fluentd.org/plugin-overview