-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configuring number of replicas (#2676)
* feat: configuring number of replicas Signed-off-by: Anatolii Bazko <[email protected]> * Update modules/administration-guide/partials/proc_configuring-number-of-replicas.adoc Co-authored-by: Jana Vrbkova <[email protected]> --------- Signed-off-by: Anatolii Bazko <[email protected]> Co-authored-by: Jana Vrbkova <[email protected]>
- Loading branch information
1 parent
fbfd367
commit da474ae
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
modules/administration-guide/pages/configuring-number-of-replicas.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
:_content-type: ASSEMBLY | ||
:description: Configuring number of replicas for a {prod} container | ||
:keywords: administration guide, configuring-number-of-replicas | ||
:navtitle: Configuring number of replicas for a {prod} container | ||
:page-aliases: | ||
|
||
[id="configuring-number-of-replicas"] | ||
|
||
include::partial$proc_configuring-number-of-replicas.adoc[leveloffset=+1] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
modules/administration-guide/partials/proc_configuring-number-of-replicas.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
:_content-type: PROCEDURE | ||
:description: Configuring a number of replicas | ||
:keywords: administration-guide, configuring-number-of-replicas | ||
:navtitle: Configuring a number of replicas {prod-cli} | ||
:page-aliases: | ||
|
||
[id="configuring-number-of-replicas"] | ||
= Configuring the number of replicas | ||
|
||
To configure the number of replicas for {prod-short} operands using {kubernetes} `HorizontalPodAutoscaler` | ||
(HPA), you can define an `HPA` resource for deployment. The `HPA` dynamically adjusts the number | ||
of replicas based on specified metrics. | ||
|
||
.Procedure | ||
|
||
. Create an `HPA` resource for a deployment, specifying the target metrics and desired replica count. | ||
+ | ||
[source,yaml,subs="+attributes,+quotes"] | ||
---- | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: scaler | ||
namespace: {prod-namespace} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: __<deployment_name>__ <1> | ||
... | ||
---- | ||
<1> The `__<deployment_name>__` corresponds to the one following deployments: | ||
* `{prod-deployment}` | ||
* `che-gateway` | ||
* `{prod-deployment}-dashboard` | ||
* `plugin-registry` | ||
* `devfile-registry` | ||
|
||
.Create a `HorizontalPodAutoscaler` for {prod-deployment} deployment: | ||
==== | ||
[source,yaml,subs="+attributes,+quotes"] | ||
---- | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {prod-deployment}-scaler | ||
namespace: {prod-namespace} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {prod-deployment} | ||
minReplicas: 2 | ||
maxReplicas: 5 | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: 75 | ||
---- | ||
In this example, the HPA is targeting the Deployment named {prod-deployment}, with a minimum of 2 replicas, a maximum of 5 replicas | ||
and scaling based on CPU utilization. | ||
==== | ||
|
||
.Additional resources | ||
* link:https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale[Horizontal Pod Autoscaling] |