mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 13:59:40 +02:00
refactor(app): migrate-autoscaling [EE-6387] (#10709)
* refactor(app): migrate-autoscaling [EE-6387]
This commit is contained in:
parent
6da71661d5
commit
2d77e71085
7 changed files with 249 additions and 122 deletions
|
@ -156,6 +156,7 @@ class KubernetesCreateApplicationController {
|
|||
this.onChangePersistedFolder = this.onChangePersistedFolder.bind(this);
|
||||
this.onChangeResourceReservation = this.onChangeResourceReservation.bind(this);
|
||||
this.onChangeReplicaCount = this.onChangeReplicaCount.bind(this);
|
||||
this.onAutoScaleChange = this.onAutoScaleChange.bind(this);
|
||||
}
|
||||
/* #endregion */
|
||||
|
||||
|
@ -238,6 +239,26 @@ class KubernetesCreateApplicationController {
|
|||
this.formValues.AutoScaler.IsUsed = false;
|
||||
}
|
||||
}
|
||||
|
||||
onAutoScaleChange(values) {
|
||||
return this.$async(async () => {
|
||||
if (!this.formValues.AutoScaler.IsUsed && values.isUsed) {
|
||||
this.formValues.AutoScaler = {
|
||||
IsUsed: values.isUsed,
|
||||
MinReplicas: 1,
|
||||
MaxReplicas: 3,
|
||||
TargetCPUUtilization: 50,
|
||||
};
|
||||
return;
|
||||
}
|
||||
this.formValues.AutoScaler = {
|
||||
IsUsed: values.isUsed,
|
||||
MinReplicas: values.minReplicas,
|
||||
MaxReplicas: values.maxReplicas,
|
||||
TargetCPUUtilization: values.targetCpuUtilizationPercentage,
|
||||
};
|
||||
});
|
||||
}
|
||||
/* #endregion */
|
||||
|
||||
/* #region CONFIGMAP UI MANAGEMENT */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue