Skip to content

Commit bf5fee8

Browse files
restructuring autoscaling in eck
1 parent 758c37f commit bf5fee8

File tree

7 files changed

+67
-73
lines changed

7 files changed

+67
-73
lines changed

deploy-manage/autoscaling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ Autoscaling is not supported on Debian 8.
3333
Find instructions on setting up and managing autoscaling, including supported environments, configuration options, and examples:
3434

3535
* [Autoscaling in {{ece}} and {{ech}}](/deploy-manage/autoscaling/autoscaling-in-ece-and-ech.md)
36-
* [Autoscaling in {{eck}}](TODO)
36+
* [Autoscaling in {{eck}}](/deploy-manage/autoscaling/autoscaling-in-eck.md)
3737
* [Autoscaling deciders](/deploy-manage/autoscaling/autoscaling-deciders.md)
3838
* [Trained model autoscaling](/deploy-manage/autoscaling/trained-model-autoscaling.md)

deploy-manage/autoscaling/deployments-autoscaling-on-eck.md renamed to deploy-manage/autoscaling/autoscaling-in-eck.md

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
22
mapped_pages:
33
- https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-autoscaling.html
4+
- https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-stateless-autoscaling.html
45
applies_to:
56
deployment:
67
eck: ga
78
---
9+
# Autoscaling in {{eck}}
810

9-
# Deployments autoscaling on ECK [k8s-autoscaling]
11+
Configure autoscaling for Elasticsearch deployments in {{eck}}. Learn how to enable autoscaling, define policies, manage resource limits, and monitor scaling. Includes details on autoscaling stateless applications like Kibana, APM Server, and Elastic Maps Server.
12+
13+
## Deployments autoscaling on ECK [k8s-autoscaling]
1014

1115
::::{note}
1216
Elasticsearch autoscaling requires a valid Enterprise license or Enterprise trial license. Check [the license documentation](../license/manage-your-license-in-eck.md) for more details about managing licenses.
@@ -16,12 +20,12 @@ Elasticsearch autoscaling requires a valid Enterprise license or Enterprise tria
1620
ECK can leverage the [autoscaling API](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-autoscaling) introduced in Elasticsearch 7.11 to adjust automatically the number of Pods and the allocated resources in a tier. Currently, autoscaling is supported for Elasticsearch [data tiers](/manage-data/lifecycle/data-tiers.md) and machine learning nodes.
1721

1822

19-
## Enable autoscaling [k8s-enable]
23+
### Enable autoscaling [k8s-enable]
2024

2125
To enable autoscaling on an Elasticsearch cluster, you need to define one or more autoscaling policies. Each autoscaling policy applies to one or more NodeSets which share the same set of roles specified in the `node.roles` setting in the Elasticsearch configuration.
2226

2327

24-
### Define autoscaling policies [k8s-autoscaling-policies]
28+
#### Define autoscaling policies [k8s-autoscaling-policies]
2529

2630
Autoscaling policies can be defined in an `ElasticsearchAutoscaler` resource. Each autoscaling policy must have the following fields:
2731

@@ -93,7 +97,7 @@ In the case of storage the following restrictions apply:
9397
* Scaling up (vertically) is only supported if the available capacity in a PersistentVolume matches the capacity claimed in the PersistentVolumeClaim. Refer to the next section for more information.
9498

9599

96-
### Scale Up and Scale Out [k8s-autoscaling-algorithm]
100+
#### Scale Up and Scale Out [k8s-autoscaling-algorithm]
97101

98102
In order to adapt the resources to the workload, the operator first attempts to scale up the resources (cpu, memory, and storage) allocated to each node in the NodeSets. The operator always ensures that the requested resources are within the limits specified in the autoscaling policy. If each individual node has reached the limits specified in the autoscaling policy, but more resources are required to handle the load, then the operator adds some nodes to the NodeSets. Nodes are added up to the `max` value specified in the `nodeCount` of the policy.
99103

@@ -129,7 +133,7 @@ spec:
129133
```
130134

131135

132-
### Set the limits [k8s-autoscaling-resources]
136+
#### Set the limits [k8s-autoscaling-resources]
133137

134138
The value set for memory and CPU limits are computed by applying a ratio to the calculated resource request. The default ratio between the request and the limit for both CPU and memory is 1. This means that request and limit have the same value. You can change the default ratio between the request and the limit for both the CPU and memory ranges by using the `requestsToLimitsRatio` field.
135139

@@ -165,7 +169,7 @@ spec:
165169
You can find [a complete example in the ECK GitHub repository](https://github.com/elastic/cloud-on-k8s/blob/2.16/config/recipes/autoscaling/elasticsearch.yaml) which will also show you how to fine-tune the [autoscaling deciders](/deploy-manage/autoscaling/autoscaling-deciders.md).
166170

167171

168-
### Change the polling interval [k8s-autoscaling-polling-interval]
172+
#### Change the polling interval [k8s-autoscaling-polling-interval]
169173

170174
The Elasticsearch autoscaling capacity endpoint is polled every minute by the operator. This interval duration can be controlled using the `pollingPeriod` field in the autoscaling specification:
171175

@@ -197,10 +201,10 @@ spec:
197201
```
198202

199203

200-
## Monitoring [k8s-monitoring]
204+
### Monitoring [k8s-monitoring]
201205

202206

203-
### Autoscaling status [k8s-autoscaling-status]
207+
#### Autoscaling status [k8s-autoscaling-status]
204208

205209
In addition to the logs generated by the operator, an autoscaling status is maintained in the `ElasticsearchAutoscaler` resource. This status holds several `Conditions` to summarize the health and the status of the autoscaling mechanism. For example, dedicated `Conditions` may report if the controller cannot connect to the Elasticsearch cluster, or if a resource limit has been reached:
206210

@@ -237,7 +241,7 @@ kubectl get elasticsearchautoscaler autoscaling-sample \
237241
```
238242

239243

240-
### Expected resources [k8s-autoscaling-expected-resources]
244+
#### Expected resources [k8s-autoscaling-expected-resources]
241245

242246
The autoscaler status also contains a `policies` section which describes the expected resources for each NodeSet managed by an autoscaling policy.
243247

@@ -273,7 +277,7 @@ kubectl get elasticsearchautoscaler.autoscaling.k8s.elastic.co/autoscaling-sampl
273277
```
274278

275279

276-
### Events [k8s-events]
280+
#### Events [k8s-events]
277281

278282
Important events are also reported through Kubernetes events, for example when the maximum autoscaling size limit is reached:
279283

@@ -284,7 +288,7 @@ Important events are also reported through Kubernetes events, for example when t
284288
```
285289

286290

287-
## Disable autoscaling [k8s-disable]
291+
### Disable autoscaling [k8s-disable]
288292

289293
You can disable autoscaling at any time by deleting the `ElasticsearchAutoscaler` resource. For machine learning the following settings are not automatically reset:
290294

@@ -294,3 +298,50 @@ You can disable autoscaling at any time by deleting the `ElasticsearchAutoscaler
294298

295299
You should adjust those settings manually to match the size of your deployment when you disable autoscaling.
296300

301+
## Autoscaling stateless applications on ECK [k8s-stateless-autoscaling]
302+
303+
::::{note}
304+
This section only applies to stateless applications. Check [Elasticsearch autoscaling](#k8s-autoscaling) for more details about scaling automatically Elasticsearch.
305+
::::
306+
307+
308+
The [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale) can be used to automatically scale the deployments of the following resources:
309+
310+
* Kibana
311+
* APM Server
312+
* Elastic Maps Server
313+
314+
These resources expose the `scale` subresource which can be used by the Horizontal Pod Autoscaler controller to automatically adjust the number of replicas according to the CPU load or any other custom or external metric. This example shows how to create an `HorizontalPodAutoscaler` resource to adjust the replicas of a Kibana deployment according to the CPU load:
315+
316+
```yaml
317+
apiVersion: elasticsearch.k8s.elastic.co/v1
318+
kind: Elasticsearch
319+
metadata:
320+
name: elasticsearch-sample
321+
spec:
322+
version: 8.16.1
323+
nodeSets:
324+
- name: default
325+
count: 1
326+
config:
327+
node.store.allow_mmap: false
328+
329+
apiVersion: autoscaling/v2beta2
330+
kind: HorizontalPodAutoscaler
331+
metadata:
332+
name: kb
333+
spec:
334+
scaleTargetRef:
335+
apiVersion: kibana.k8s.elastic.co/v1
336+
kind: Kibana
337+
name: kibana-sample
338+
minReplicas: 1
339+
maxReplicas: 4
340+
metrics:
341+
- type: Resource
342+
resource:
343+
name: cpu
344+
target:
345+
type: Utilization
346+
averageUtilization: 50
347+
```

deploy-manage/autoscaling/autoscaling-stateless-applications-on-eck.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

deploy-manage/deploy/cloud-on-k8s/elasticsearch-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Other sections of the documentation also include relevant configuration options
5656

5757
* [Remote clusters](/deploy-manage/remote-clusters/eck-remote-clusters.md)
5858

59-
* [Autoscaling](../../autoscaling/deployments-autoscaling-on-eck.md)
59+
* [Autoscaling](../../autoscaling/autoscaling-in-eck.md#k8s-autoscaling.md)
6060

6161
* [Stack monitoring](/deploy-manage/monitor/stack-monitoring/eck-stack-monitoring.md): Monitor your {{es}} cluster smoothly with the help of ECK.
6262

deploy-manage/deploy/cloud-on-k8s/kibana-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ The following sections describe how to customize a {{kib}} deployment to suit yo
2929
* [Disable TLS](k8s-kibana-http-configuration.md#k8s-kibana-http-disable-tls)
3030
* [Install {{kib}} plugins](k8s-kibana-plugins.md)
3131

32-
* [Autoscaling stateless applications](../../autoscaling/autoscaling-stateless-applications-on-eck.md): Use [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) for {{kib}} or other stateless applications.
32+
* [Autoscaling stateless applications](../../autoscaling/autoscaling-in-eck.md#k8s-stateless-autoscaling): Use [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) for {{kib}} or other stateless applications.
3333

3434

deploy-manage/deploy/cloud-on-k8s/orchestrate-other-elastic-applications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ When orchestrating any of these applications, also consider the following topics
2222
* [Access Elastic Stack services](accessing-services.md)
2323
* [Customize Pods](customize-pods.md)
2424
* [Manage compute resources](manage-compute-resources.md)
25-
* [Autoscaling stateless applications](../../autoscaling/autoscaling-stateless-applications-on-eck.md)
25+
* [Autoscaling stateless applications](../../autoscaling/autoscaling-in-eck.md#k8s-stateless-autoscaling)
2626
* [Elastic Stack configuration policies](elastic-stack-configuration-policies.md)
2727
* [Upgrade the Elastic Stack version](../../upgrade/deployment-or-cluster.md)
2828
* [Connect to external Elastic resources](connect-to-external-elastic-resources.md)

deploy-manage/toc.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,7 @@ toc:
485485
- file: autoscaling.md
486486
children:
487487
- file: autoscaling/autoscaling-in-ece-and-ech.md
488-
- file: autoscaling/autoscaling-stateless-applications-on-eck.md
489-
- file: autoscaling/deployments-autoscaling-on-eck.md
488+
- file: autoscaling/autoscaling-in-eck.md
490489
- file: autoscaling/autoscaling-deciders.md
491490
- file: autoscaling/trained-model-autoscaling.md
492491
- file: remote-clusters.md

0 commit comments

Comments
 (0)