Skip to content

Commit

Permalink
feat(console): add alarm node memory used (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-hnny committed Nov 30, 2020
1 parent ca31bc3 commit a33d9cc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
14 changes: 14 additions & 0 deletions web/console/src/modules/alarmPolicy/constants/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,20 @@ export const AlarmPolicyMetrics = {
tip: '',
// metricType: 'event',
unit: ''
},
{
enable: true,
measurement: 'k8s_node',
statisticsPeriod: 1,
metricName: 'k8s_node_filesystem_usage',
evaluatorType: 'gt',
evaluatorValue: '90',
metricDisplayName: t('节点磁盘已使用'),
continuePeriod: 5,
type: 'percent',
tip: '',
// metricType: 'metric',
unit: '%'
}
],
pod: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function ClusterUpdate({ route, actions }: RootProps) {
};

const { clusterId, clusterVersion } = route.queries;
const [_, clusterVersionSecondPart] = clusterVersion.split('.');

function goBack() {
history.back();
Expand Down Expand Up @@ -72,7 +73,17 @@ export function ClusterUpdate({ route, actions }: RootProps) {
label="升级目标版本"
extra="注意:master升级支持一个次版本升级到下一个次版本,或者同样次版本的补丁版。"
name={['version']}
rules={[{ required: true }]}
rules={[
{ required: true },
{
validator(_, value: string) {
const [__, targetSecond] = value.split('.');
return +targetSecond - +clusterVersionSecondPart === 1
? Promise.resolve()
: Promise.reject('不支持直接升级到该版本!');
}
}
]}
>
<Select style={ItemStyle()}>
{k8sValidVersions.map(v => (
Expand Down

0 comments on commit a33d9cc

Please sign in to comment.