mirror of https://github.com/rancher/dashboard.git
Changes to kube node list
- Make type node seen in explorer / node list clearer - also mention where lifecycle management can be done - Remove node pool groups for rke1, so there are no pools at all in this view - Fix #3355
This commit is contained in:
parent
f3390b2a1d
commit
8d5aa08b40
|
|
@ -4292,6 +4292,7 @@ typeDescription:
|
||||||
monitoring.coreos.com.prometheusrule: A Prometheus Rule resource defines both recording and/or alert rules. A recording rule can pre-compute values and save the results. Alerting rules allow you to define conditions on when to send notifications to AlertManager.
|
monitoring.coreos.com.prometheusrule: A Prometheus Rule resource defines both recording and/or alert rules. A recording rule can pre-compute values and save the results. Alerting rules allow you to define conditions on when to send notifications to AlertManager.
|
||||||
monitoring.coreos.com.prometheus: A Prometheus server is a Prometheus deployment whose scrape configuration and rules are determined by selected ServiceMonitors, PodMonitors, and PrometheusRules and whose alerts will be sent to all selected Alertmanagers with the custom resource's configuration.
|
monitoring.coreos.com.prometheus: A Prometheus server is a Prometheus deployment whose scrape configuration and rules are determined by selected ServiceMonitors, PodMonitors, and PrometheusRules and whose alerts will be sent to all selected Alertmanagers with the custom resource's configuration.
|
||||||
monitoring.coreos.com.alertmanager: An alert manager is deployment whose configuration will be specified by a secret in the same namespace, which determines which alerts should go to which receiver.
|
monitoring.coreos.com.alertmanager: An alert manager is deployment whose configuration will be specified by a secret in the same namespace, which determines which alerts should go to which receiver.
|
||||||
|
node: The base Kubernetes Node resource represents a virtual or physical machine which hosts deployments. To manage the machine lifecyle, if available, go to Cluster Management.
|
||||||
catalog.cattle.io.clusterrepo: 'A chart repository is a Helm repository or {vendor} git based application catalog. It provides the list of available charts in the cluster.'
|
catalog.cattle.io.clusterrepo: 'A chart repository is a Helm repository or {vendor} git based application catalog. It provides the list of available charts in the cluster.'
|
||||||
catalog.cattle.io.operation: An operation is the list of recent Helm operations that have been applied to the cluster.
|
catalog.cattle.io.operation: An operation is the list of recent Helm operations that have been applied to the cluster.
|
||||||
catalog.cattle.io.app: An installed application is a Helm 3 chart that was installed either via our charts or through the Helm CLI.
|
catalog.cattle.io.app: An installed application is a Helm 3 chart that was installed either via our charts or through the Helm CLI.
|
||||||
|
|
@ -4464,6 +4465,11 @@ typeLabel:
|
||||||
one { Namespace }
|
one { Namespace }
|
||||||
other { Namespaces }
|
other { Namespaces }
|
||||||
}
|
}
|
||||||
|
node: |-
|
||||||
|
{count, plural,
|
||||||
|
one { Kube Node }
|
||||||
|
other { Kube Nodes }
|
||||||
|
}
|
||||||
group.principal: |-
|
group.principal: |-
|
||||||
{count, plural,
|
{count, plural,
|
||||||
one { Group }
|
one { Group }
|
||||||
|
|
|
||||||
149
list/node.vue
149
list/node.vue
|
|
@ -10,7 +10,6 @@ import metricPoller from '@/mixins/metric-poller';
|
||||||
import {
|
import {
|
||||||
MANAGEMENT, METRIC, NODE, NORMAN, POD
|
MANAGEMENT, METRIC, NODE, NORMAN, POD
|
||||||
} from '@/config/types';
|
} from '@/config/types';
|
||||||
import { mapGetters } from 'vuex';
|
|
||||||
import { allHash } from '@/utils/promise';
|
import { allHash } from '@/utils/promise';
|
||||||
import { get } from '@/utils/object';
|
import { get } from '@/utils/object';
|
||||||
import { GROUP_RESOURCES, mapPref } from '@/store/prefs';
|
import { GROUP_RESOURCES, mapPref } from '@/store/prefs';
|
||||||
|
|
@ -33,25 +32,21 @@ export default {
|
||||||
async fetch() {
|
async fetch() {
|
||||||
const hash = { kubeNodes: this.$store.dispatch('cluster/findAll', { type: NODE }) };
|
const hash = { kubeNodes: this.$store.dispatch('cluster/findAll', { type: NODE }) };
|
||||||
|
|
||||||
const canViewNodePools = this.$store.getters[`management/schemaFor`](MANAGEMENT.NODE_POOL);
|
const canViewMgmtNodes = this.$store.getters[`management/schemaFor`](MANAGEMENT.NODE);
|
||||||
const canViewNodeTemplates = this.$store.getters[`management/schemaFor`](MANAGEMENT.NODE_TEMPLATE);
|
|
||||||
const canViewPods = this.$store.getters[`cluster/schemaFor`](POD);
|
|
||||||
|
|
||||||
const canViewNormanNodes = this.$store.getters[`rancher/schemaFor`](NORMAN.NODE);
|
const canViewNormanNodes = this.$store.getters[`rancher/schemaFor`](NORMAN.NODE);
|
||||||
|
|
||||||
|
this.canViewPods = this.$store.getters[`cluster/schemaFor`](POD);
|
||||||
|
|
||||||
if (canViewNormanNodes) {
|
if (canViewNormanNodes) {
|
||||||
// Required for Drain action
|
// Required for Drain/Cordon action
|
||||||
hash.normanNodes = this.$store.dispatch('rancher/findAll', { type: NORMAN.NODE });
|
hash.normanNodes = this.$store.dispatch('rancher/findAll', { type: NORMAN.NODE });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canViewNodePools && canViewNodeTemplates) {
|
if (canViewMgmtNodes) {
|
||||||
// Managemnet Node's required for kube role and some resource states
|
|
||||||
hash.mgmtNodes = this.$store.dispatch('management/findAll', { type: MANAGEMENT.NODE });
|
hash.mgmtNodes = this.$store.dispatch('management/findAll', { type: MANAGEMENT.NODE });
|
||||||
hash.nodePools = this.$store.dispatch('management/findAll', { type: MANAGEMENT.NODE_POOL });
|
|
||||||
hash.nodeTemplates = this.$store.dispatch('management/findAll', { type: MANAGEMENT.NODE_TEMPLATE });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canViewPods) {
|
if (this.canViewPods) {
|
||||||
// Used for running pods metrics
|
// Used for running pods metrics
|
||||||
hash.pods = this.$store.dispatch('cluster/findAll', { type: POD });
|
hash.pods = this.$store.dispatch('cluster/findAll', { type: POD });
|
||||||
}
|
}
|
||||||
|
|
@ -59,67 +54,38 @@ export default {
|
||||||
const res = await allHash(hash);
|
const res = await allHash(hash);
|
||||||
|
|
||||||
this.kubeNodes = res.kubeNodes;
|
this.kubeNodes = res.kubeNodes;
|
||||||
this.nodePools = res.nodePools || [];
|
|
||||||
this.nodeTemplates = res.nodeTemplates || [];
|
|
||||||
|
|
||||||
await this.updateNodePools(res.kubeNodes);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
kubeNodes: null,
|
kubeNodes: null,
|
||||||
nodeTemplates: null,
|
canViewPods: false,
|
||||||
nodePools: null,
|
};
|
||||||
headers: [STATE, NAME, ROLES, VERSION, INTERNAL_EXTERNAL_IP, {
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
tableGroup: mapPref(GROUP_RESOURCES),
|
||||||
|
|
||||||
|
headers() {
|
||||||
|
const headers = [STATE, NAME, ROLES, VERSION, INTERNAL_EXTERNAL_IP, {
|
||||||
...CPU,
|
...CPU,
|
||||||
breakpoint: COLUMN_BREAKPOINTS.LAPTOP
|
breakpoint: COLUMN_BREAKPOINTS.LAPTOP
|
||||||
}, {
|
}, {
|
||||||
...RAM,
|
...RAM,
|
||||||
breakpoint: COLUMN_BREAKPOINTS.LAPTOP
|
breakpoint: COLUMN_BREAKPOINTS.LAPTOP
|
||||||
}, {
|
}];
|
||||||
|
|
||||||
|
if (this.canViewPods) {
|
||||||
|
headers.push({
|
||||||
...PODS,
|
...PODS,
|
||||||
breakpoint: COLUMN_BREAKPOINTS.DESKTOP
|
breakpoint: COLUMN_BREAKPOINTS.DESKTOP
|
||||||
}, AGE],
|
});
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
...mapGetters(['currentCluster']),
|
|
||||||
tableGroup: mapPref(GROUP_RESOURCES),
|
|
||||||
|
|
||||||
clusterNodePools() {
|
|
||||||
return this.nodePools?.filter(pool => pool?.spec?.clusterName === this.currentCluster.id) || [];
|
|
||||||
},
|
|
||||||
|
|
||||||
clusterNodePoolsMap() {
|
|
||||||
return this.clusterNodePools.reduce((res, node) => {
|
|
||||||
res[node.id] = node;
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}, {});
|
|
||||||
},
|
|
||||||
|
|
||||||
hasPools() {
|
|
||||||
return !!this.clusterNodePools.length;
|
|
||||||
},
|
|
||||||
|
|
||||||
groupBy() {
|
|
||||||
if (!this.hasPools) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.tableGroup === 'none' ? '' : 'nodePoolId';
|
|
||||||
}
|
}
|
||||||
|
headers.push(AGE);
|
||||||
|
|
||||||
|
return headers;
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
|
||||||
kubeNodes: {
|
|
||||||
deep: true,
|
|
||||||
handler(neu, old) {
|
|
||||||
this.updateNodePools(neu);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -136,26 +102,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
updateNodePools(nodes = []) {
|
|
||||||
nodes.forEach((node) => {
|
|
||||||
const sNode = node.managementNode;
|
|
||||||
|
|
||||||
if (sNode) {
|
|
||||||
node.nodePoolId = sNode.spec.nodePoolName?.replace(':', '/') || '' ;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
getNodePoolFromTableGroup(group) {
|
|
||||||
return this.getNodePool(group.key);
|
|
||||||
},
|
|
||||||
|
|
||||||
getNodeTemplate(nodeTemplateName) {
|
|
||||||
const parsedName = nodeTemplateName.replace(':', '/');
|
|
||||||
|
|
||||||
return this.nodeTemplates.find(nt => nt.id === parsedName);
|
|
||||||
},
|
|
||||||
|
|
||||||
get,
|
get,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -170,27 +116,10 @@ export default {
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:rows="[...kubeNodes]"
|
:rows="kubeNodes"
|
||||||
:groupable="hasPools"
|
|
||||||
:group-by="groupBy"
|
|
||||||
group-tooltip="node.list.pool"
|
|
||||||
:sub-rows="true"
|
:sub-rows="true"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
>
|
>
|
||||||
<template #group-by="{group}">
|
|
||||||
<div class="pool-row" :class="{'has-description':clusterNodePoolsMap[group.key] && clusterNodePoolsMap[group.key].nodeTemplate}">
|
|
||||||
<div v-trim-whitespace class="group-tab">
|
|
||||||
<div v-if="clusterNodePoolsMap[group.key]" class="project-name" v-html="t('resourceTable.groupLabel.nodePool', { name: clusterNodePoolsMap[group.key].spec.hostnamePrefix, count: group.rows.length}, true)">
|
|
||||||
</div>
|
|
||||||
<div v-else class="project-name" v-html="t('resourceTable.groupLabel.notInANodePool')">
|
|
||||||
</div>
|
|
||||||
<div v-if="clusterNodePoolsMap[group.key] && clusterNodePoolsMap[group.key].nodeTemplate" class="description text-muted text-small">
|
|
||||||
{{ clusterNodePoolsMap[group.key].providerDisplay }} – {{ clusterNodePoolsMap[group.key].providerLocation }} / {{ clusterNodePoolsMap[group.key].providerSize }} ({{ clusterNodePoolsMap[group.key].providerName }})
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #sub-row="{fullColspan, row}">
|
<template #sub-row="{fullColspan, row}">
|
||||||
<tr class="taints sub-row" :class="{'empty-taints': !row.spec.taints || !row.spec.taints.length}">
|
<tr class="taints sub-row" :class="{'empty-taints': !row.spec.taints || !row.spec.taints.length}">
|
||||||
<template v-if="row.spec.taints && row.spec.taints.length">
|
<template v-if="row.spec.taints && row.spec.taints.length">
|
||||||
|
|
@ -212,38 +141,6 @@ export default {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
.pool-row {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.project-name {
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.has-description {
|
|
||||||
.right {
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
.group-tab {
|
|
||||||
&, &::after {
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
right: -20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.description {
|
|
||||||
margin-top: -20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BUTTON {
|
|
||||||
line-height: 1em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.taints {
|
.taints {
|
||||||
td {
|
td {
|
||||||
padding-top:0;
|
padding-top:0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue