1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00
portainer/app/kubernetes/node/models.js
Maxime Bajeux 1bf97426bf
feat(k8s/node): Add the ability to apply taints and labels to nodes (#4176)
* feat(node): Add the ability to apply taints and labels to nodes

* feat(k8s/node): minor UI update

* feat(k8s/node): UI update and disable system labels

* feat(k8s/node): minor UI update

* fix(node): fix add first taint

* refacto(node): add KubernetesNodeHelper

* feat(node): add used label to labels

* feat(node): add node update modals

* fix(node): modal when used label changes

* feat(k8s/node): minor UI update

Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
2020-08-12 11:42:55 +12:00

65 lines
1.2 KiB
JavaScript

/**
* KubernetesNode Model
*/
const _KubernetesNode = Object.freeze({
Id: '',
Name: '',
Labels: {},
Role: '',
Status: '',
CPU: 0,
Memory: '',
Version: '',
IPAddress: '',
Api: false,
Taints: [],
Port: 0,
});
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 KubernetesNodeTaintEffects = Object.freeze({
NOSCHEDULE: 'NoSchedule',
PREFERNOSCHEDULE: 'PreferNoSchedule',
NOEXECUTE: 'NoExecute',
});