1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00
portainer/app/kubernetes/node/models.js
Maxime Bajeux 32a9a2e46b
Enable the ability to cordon/uncordon/drain nodes (#4723)
* feat(node): Enable the ability to cordon/uncordon/drain nodes

* feat(cluster): check if there is a drain operation somewhere

* feat(kubernetes): allow to cordon, uncordon, drain nodes

* refacto(kubernetes): set a constant for drain label name

* fix(node): Relocate the warning message next to the dropdown and change the information message
2021-03-15 22:36:14 +01:00

74 lines
1.4 KiB
JavaScript

export const KubernetesPortainerNodeDrainLabel = 'io.portainer/node-status-drain';
/**
* KubernetesNode Model
*/
const _KubernetesNode = Object.freeze({
Id: '',
Name: '',
Labels: {},
Role: '',
Status: '',
CPU: 0,
Memory: '',
Version: '',
IPAddress: '',
Api: false,
Taints: [],
Port: 0,
Availability: '',
});
export class KubernetesNode {
constructor() {
Object.assign(this, JSON.parse(JSON.stringify(_KubernetesNode)));
}
}
/**
* KubernetesNodeDetails Model
*/
const _KubernetesNodeDetails = Object.freeze({
CreationDate: '',
OS: {
Architecture: '',
Platform: '',
Image: '',
},
Conditions: [],
Yaml: '',
});
export class KubernetesNodeDetails {
constructor() {
Object.assign(this, JSON.parse(JSON.stringify(_KubernetesNode)));
Object.assign(this, JSON.parse(JSON.stringify(_KubernetesNodeDetails)));
}
}
/**
* KubernetesNodeTaint Model
*/
const _KubernetesNodeTaint = Object.freeze({
Key: '',
Value: '',
Effect: '',
});
export class KubernetesNodeTaint {
constructor() {
Object.assign(this, JSON.parse(JSON.stringify(_KubernetesNodeTaint)));
}
}
export const KubernetesNodeAvailabilities = Object.freeze({
ACTIVE: 'Active',
PAUSE: 'Pause',
DRAIN: 'Drain',
});
export const KubernetesNodeTaintEffects = Object.freeze({
NOSCHEDULE: 'NoSchedule',
PREFERNOSCHEDULE: 'PreferNoSchedule',
NOEXECUTE: 'NoExecute',
});