mirror of https://github.com/rancher/ui.git
Show warning for node has disk pressure
This commit is contained in:
parent
5b01163b1b
commit
6e5875ef9b
|
|
@ -10,6 +10,7 @@ import { resolve } from 'rsvp';
|
|||
import C from 'ui/utils/constants';
|
||||
import { isEmpty } from '@ember/utils';
|
||||
import moment from 'moment';
|
||||
const TRUE = 'True';
|
||||
|
||||
export default Resource.extend(Grafana, ResourceUsage, {
|
||||
globalStore: service(),
|
||||
|
|
@ -274,11 +275,46 @@ export default Resource.extend(Grafana, ResourceUsage, {
|
|||
return get(this, 'nodes').filter( (n) => C.ACTIVEISH_STATES.indexOf(get(n, 'state')) === -1 );
|
||||
}),
|
||||
|
||||
displayWarnings: computed('provider', 'inactiveNodes.[]', 'unhealthyComponents.[]', function() {
|
||||
unhealthyNodes: computed('nodes.@each.conditions', function() {
|
||||
const out = [];
|
||||
|
||||
(get(this, 'nodes') || []).forEach((n) => {
|
||||
const conditions = get(n, 'conditions');
|
||||
const outOfDisk = conditions.find((c) => c.type === 'OutOfDisk');
|
||||
const diskPressure = conditions.find((c) => c.type === 'DiskPressure');
|
||||
const memoryPressure = conditions.find((c) => c.type === 'MemoryPressure');
|
||||
|
||||
if ( outOfDisk && get(outOfDisk, 'status') === TRUE ) {
|
||||
out.push({
|
||||
displayName: get(n, 'displayName'),
|
||||
error: 'outOfDisk'
|
||||
});
|
||||
}
|
||||
|
||||
if ( diskPressure && get(diskPressure, 'status') === TRUE ) {
|
||||
out.push({
|
||||
displayName: get(n, 'displayName'),
|
||||
error: 'diskPressure'
|
||||
});
|
||||
}
|
||||
|
||||
if ( memoryPressure && get(memoryPressure, 'status') === TRUE ) {
|
||||
out.push({
|
||||
displayName: get(n, 'displayName'),
|
||||
error: 'memoryPressure'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return out;
|
||||
}),
|
||||
|
||||
displayWarnings: computed('unhealthyNodes.[]', 'provider', 'inactiveNodes.[]', 'unhealthyComponents.[]', function() {
|
||||
const intl = get(this, 'intl');
|
||||
const out = [];
|
||||
const unhealthyComponents = get(this, 'unhealthyComponents') || [];
|
||||
const inactiveNodes = get(this, 'inactiveNodes') || [];
|
||||
const unhealthyNodes = get(this, 'unhealthyNodes') || [];
|
||||
const provider = get(this, 'provider');
|
||||
|
||||
const grayOut = C.GRAY_OUT_SCHEDULER_STATUS_PROVIDERS.indexOf(provider) > -1;
|
||||
|
|
@ -294,6 +330,10 @@ export default Resource.extend(Grafana, ResourceUsage, {
|
|||
out.pushObject(intl.t('clusterDashboard.alert.node', { node: get(node, 'displayName') }))
|
||||
});
|
||||
|
||||
unhealthyNodes.forEach((node) => {
|
||||
out.pushObject(intl.t(`clusterDashboard.alert.nodeCondition.${ get(node, 'error') }`, { node: get(node, 'displayName') }))
|
||||
});
|
||||
|
||||
return out;
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -89,14 +89,9 @@
|
|||
|
||||
{{#unless hideManagerAndSchedulerStatus}}
|
||||
<div class="row">
|
||||
{{#each unhealthyComponents as |component|}}
|
||||
{{#each cluster.displayWarnings as |warning|}}
|
||||
{{#banner-message icon="icon-alert" color="text-left bg-error mt-30"}}
|
||||
<p>{{t "clusterDashboard.alert.component" component=component.name}}</p>
|
||||
{{/banner-message}}
|
||||
{{/each}}
|
||||
{{#each inactiveNodes as |node|}}
|
||||
{{#banner-message icon="icon-alert" color="text-left bg-error mt-30"}}
|
||||
<p>{{t "clusterDashboard.alert.node" node=node.displayName}}</p>
|
||||
<p>{{warning}}</p>
|
||||
{{/banner-message}}
|
||||
{{/each}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -86,6 +86,10 @@ clusterDashboard:
|
|||
alert:
|
||||
node: "Alert: Node {node} is not active."
|
||||
component: "Alert: Component {component} is unhealthy."
|
||||
nodeCondition:
|
||||
outOfDisk: "Alert: Node {node} is out of disk."
|
||||
diskPressure: "Alert: Node {node} has disk pressure."
|
||||
memoryPressure: "Alert: Node {node} has memory pressure."
|
||||
liveTitle: "{used} of {total} Used"
|
||||
reserved: Reserved
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue