mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
feat(k8s/application): add the ability to set the auto-scale policy of an application (#4118)
* feat(application): add horizontalpodautoscaler creation * feat(application): Add the ability to set the auto-scale policy of an application * feat(k8s/application): minor UI update * fix(application): set api version and prevent to use hpa with global deployment type * feat(settings): add a switch to enable features based on server metrics * feat(k8s/applications): minor UI update Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
parent
909e1ef02c
commit
6756b04b67
16 changed files with 534 additions and 84 deletions
86
app/kubernetes/horizontal-pod-auto-scaler/payload.js
Normal file
86
app/kubernetes/horizontal-pod-auto-scaler/payload.js
Normal file
|
@ -0,0 +1,86 @@
|
|||
/**
|
||||
* KubernetesHorizontalPodAutoScaler Create Payload Model
|
||||
*/
|
||||
const _KubernetesHorizontalPodAutoScalerCreatePayload = Object.freeze({
|
||||
metadata: {
|
||||
namespace: '',
|
||||
name: '',
|
||||
},
|
||||
spec: {
|
||||
maxReplicas: 0,
|
||||
minReplicas: 0,
|
||||
targetCPUUtilizationPercentage: 0,
|
||||
scaleTargetRef: {
|
||||
kind: '',
|
||||
name: '',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export class KubernetesHorizontalPodAutoScalerCreatePayload {
|
||||
constructor() {
|
||||
Object.assign(this, JSON.parse(JSON.stringify(_KubernetesHorizontalPodAutoScalerCreatePayload)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* KubernetesHorizontalPodAutoScaler Create Payload Model for v2beta2
|
||||
* Include support of memory usage
|
||||
*/
|
||||
|
||||
// const _KubernetesHorizontalPodAutoScalerCreatePayload = Object.freeze({
|
||||
// metadata: {
|
||||
// namespace: '',
|
||||
// name: ''
|
||||
// },
|
||||
// spec: {
|
||||
// maxReplicas: 0,
|
||||
// minReplicas: 0,
|
||||
// targetCPUUtilizationPercentage: 0,
|
||||
// scaleTargetRef: {
|
||||
// kind: '',
|
||||
// name: ''
|
||||
// },
|
||||
// metrics: []
|
||||
// }
|
||||
// });
|
||||
|
||||
// export class KubernetesHorizontalPodAutoScalerCreatePayload {
|
||||
// constructor() {
|
||||
// Object.assign(this, JSON.parse(JSON.stringify(_KubernetesHorizontalPodAutoScalerCreatePayload)));
|
||||
// }
|
||||
// }
|
||||
|
||||
// const _KubernetesHorizontalPodAutoScalerCPUMetric = Object.freeze({
|
||||
// type: 'Resource',
|
||||
// resource: {
|
||||
// name: 'cpu',
|
||||
// target: {
|
||||
// type: 'Utilization',
|
||||
// averageUtilization: 0
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// export class KubernetesHorizontalPodAutoScalerCPUMetric {
|
||||
// constructor() {
|
||||
// Object.assign(this, JSON.parse(JSON.stringify(_KubernetesHorizontalPodAutoScalerCPUMetric)));
|
||||
// }
|
||||
// }
|
||||
|
||||
// const _KubernetesHorizontalPodAutoScalerMemoryMetric = Object.freeze({
|
||||
// type: 'Resource',
|
||||
// resource: {
|
||||
// name: 'memory',
|
||||
// target: {
|
||||
// type: 'AverageValue',
|
||||
// averageValue: ''
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// export class KubernetesHorizontalPodAutoScalerMemoryMetric {
|
||||
// constructor() {
|
||||
// Object.assign(this, JSON.parse(JSON.stringify(_KubernetesHorizontalPodAutoScalerMemoryMetric)));
|
||||
// }
|
||||
// }
|
Loading…
Add table
Add a link
Reference in a new issue