Skip to content

Commit 8a2209b

Browse files
committed
fix: move proc_configuring-number-of-replicas partial to optimize module
1 parent 1b3d859 commit 8a2209b

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
:_content-type: PROCEDURE
2+
3+
[id="configuring-number-of-replicas"]
4+
= Configuring the number of replicas
5+
6+
To configure the number of replicas for {prod-short} operands using {kubernetes} `HorizontalPodAutoscaler`
7+
(HPA), you can define an `HPA` resource for deployment. The `HPA` dynamically adjusts the number
8+
of replicas based on specified metrics.
9+
10+
.Procedure
11+
12+
. Create an `HPA` resource for a deployment, specifying the target metrics and desired replica count.
13+
+
14+
[source,yaml,subs="+attributes,+quotes"]
15+
----
16+
apiVersion: autoscaling/v2
17+
kind: HorizontalPodAutoscaler
18+
metadata:
19+
name: scaler
20+
namespace: {prod-namespace}
21+
spec:
22+
scaleTargetRef:
23+
apiVersion: apps/v1
24+
kind: Deployment
25+
name: __<deployment_name>__ <1>
26+
...
27+
----
28+
<1> The `<deployment_name>` corresponds to the one following deployments:
29+
* `{prod-deployment}`
30+
* `che-gateway`
31+
* `{prod-deployment}-dashboard`
32+
* `plugin-registry`
33+
* `devfile-registry`
34+
35+
.Create a `HorizontalPodAutoscaler` for {prod-deployment} deployment:
36+
====
37+
[source,yaml,subs="+attributes,+quotes"]
38+
----
39+
apiVersion: autoscaling/v2
40+
kind: HorizontalPodAutoscaler
41+
metadata:
42+
name: {prod-deployment}-scaler
43+
namespace: {prod-namespace}
44+
spec:
45+
scaleTargetRef:
46+
apiVersion: apps/v1
47+
kind: Deployment
48+
name: {prod-deployment}
49+
minReplicas: 2
50+
maxReplicas: 5
51+
metrics:
52+
- type: Resource
53+
resource:
54+
name: cpu
55+
target:
56+
type: Utilization
57+
averageUtilization: 75
58+
----
59+
In this example, the HPA is targeting the Deployment named {prod-deployment}, with a minimum of 2 replicas, a maximum of 5 replicas
60+
and scaling based on CPU utilization.
61+
====
62+
63+
.Additional resources
64+
* link:https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale[Horizontal Pod Autoscaling]

0 commit comments

Comments
 (0)