1
0
Fork 0
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:
Ali 2024-01-03 10:42:39 +13:00 committed by GitHub
parent 6da71661d5
commit 2d77e71085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 249 additions and 122 deletions

View file

@ -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 */