diff --git a/app/models/cluster.js b/app/models/cluster.js
index 19c184fec..06def7edb 100644
--- a/app/models/cluster.js
+++ b/app/models/cluster.js
@@ -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;
}),
diff --git a/lib/monitoring/addon/components/cluster-dashboard/template.hbs b/lib/monitoring/addon/components/cluster-dashboard/template.hbs
index b6b52c82f..405901cbf 100644
--- a/lib/monitoring/addon/components/cluster-dashboard/template.hbs
+++ b/lib/monitoring/addon/components/cluster-dashboard/template.hbs
@@ -89,14 +89,9 @@
{{#unless hideManagerAndSchedulerStatus}}
- {{#each unhealthyComponents as |component|}}
+ {{#each cluster.displayWarnings as |warning|}}
{{#banner-message icon="icon-alert" color="text-left bg-error mt-30"}}
-
{{t "clusterDashboard.alert.component" component=component.name}}
- {{/banner-message}}
- {{/each}}
- {{#each inactiveNodes as |node|}}
- {{#banner-message icon="icon-alert" color="text-left bg-error mt-30"}}
-
{{t "clusterDashboard.alert.node" node=node.displayName}}
+
{{warning}}
{{/banner-message}}
{{/each}}
diff --git a/lib/monitoring/addon/node-detail/template.hbs b/lib/monitoring/addon/node-detail/template.hbs
index c16803205..eb2472061 100644
--- a/lib/monitoring/addon/node-detail/template.hbs
+++ b/lib/monitoring/addon/node-detail/template.hbs
@@ -3,10 +3,11 @@
{{t 'hostsPage.hostPage.header.title' name=model.node.displayName}}{{copy-to-clipboard clipboardText=model.node.displayName size="small"}}
-{{!--
-
- {{model.node.hostname}} {{copy-to-clipboard clipboardText=model.node.hostname size="small"}}
-
--}}
+ {{#each model.node.displayRoles as |role|}}
+
+ {{role}}
+
+ {{/each}}
{{badge-state model=model.node}}
diff --git a/lib/monitoring/translations/en-us.yaml b/lib/monitoring/translations/en-us.yaml
index fa2be7cb5..68c37e063 100644
--- a/lib/monitoring/translations/en-us.yaml
+++ b/lib/monitoring/translations/en-us.yaml
@@ -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
diff --git a/lib/shared/addon/components/node-taints/component.js b/lib/shared/addon/components/node-taints/component.js
index 4657820dd..cf0ce7a39 100644
--- a/lib/shared/addon/components/node-taints/component.js
+++ b/lib/shared/addon/components/node-taints/component.js
@@ -2,6 +2,7 @@ import { get, set, observer } from '@ember/object';
import Component from '@ember/component';
import layout from './template';
import EmberObject from '@ember/object';
+import C from 'ui/utils/constants';
const NO_SCHEDULE = 'NoSchedule';
const NO_EXECUTE = 'NoExecute';
@@ -82,9 +83,10 @@ export default Component.extend({
initTaints() {
set(this, 'taints', (get(this, 'model.nodeTaints') || get(this, 'model.taints') || []).map((taint) => {
return {
- key: get(taint, 'key'),
- value: get(taint, 'value'),
- effect: get(taint, 'effect'),
+ key: get(taint, 'key'),
+ value: get(taint, 'value'),
+ effect: get(taint, 'effect'),
+ readonly: C.LABEL_PREFIX_TO_IGNORE.find((L) => get(taint, 'key').startsWith(L))
}
}));
},
diff --git a/lib/shared/addon/components/node-taints/template.hbs b/lib/shared/addon/components/node-taints/template.hbs
index 1b637ae14..3075fc173 100644
--- a/lib/shared/addon/components/node-taints/template.hbs
+++ b/lib/shared/addon/components/node-taints/template.hbs
@@ -39,6 +39,7 @@
class="form-control input-sm"
type="text"
value=taint.key
+ disabled=taint.readonly
placeholder=(t "formNodeTaints.key.placeholder")
}}
@@ -50,6 +51,7 @@
class="form-control input-sm"
type="text"
value=taint.value
+ disabled=taint.readonly
placeholder=(t "formNodeTaints.value.placeholder")
}}
@@ -61,12 +63,14 @@
classNames="form-control input-sm"
content=effects
value=taint.effect
+ disabled=taint.readonly
}}
|