text: UPDATE `sp_alert_rules` SET `enable` = 0 WHERE `alert_index`= 'kubernetes_instance_ready';
  INSERT `sp_alert_rules`(`alert_index`,`alert_scope`,`alert_type`,`attributes`,`name`,`template`) VALUES("kubernetes_instance_ready","org","kubernetes","{\"alert_group\":\"{{cluster_name}}-{{daemonset_name}}-{{statefulset_name}}-{{deployment_name}}\",\"level\":\"FATAL\",\"recover\":\"true\",\"tickets_metric_key\":\"{{daemonset_name}}-{{statefulset_name}}-{{deployment_name}}\"}","kubernetes组件实例Ready状态异常","{\"filters\":[{\"operator\":\"in\",\"tag\":\"cluster_name\",\"value\":[\"$cluster_name\"]},{\"operator\":\"eq\",\"tag\":\"namespace\",\"value\":\"kube-system\"}],\"functions\":[{\"aggregator\":\"max\",\"alias\":\"not_ready_value\",\"field\":\"not_ready\",\"field_script\":\"function invoke(fields,tags){if(tags.daemonset_name){return fields.number_unavailable}else{if(tags.statefulset_name){return fields.replicas-fields.replicas_ready}else{if(tags.deployment_name){return fields.replicas_unavailable}}}return 0}\",\"operator\":\"gt\",\"value\":0},{\"aggregator\":\"max\",\"alias\":\"ready_value\",\"field\":\"ready_value\",\"field_script\":\"function invoke(fields,tags){if(tags.daemonset_name){return fields.number_available}else{if(tags.statefulset_name){return fields.replicas_ready}else{if(tags.deployment_name){return fields.replicas_available}}}return 0}\"},{\"aggregator\":\"max\",\"alias\":\"total_value\",\"field\":\"total_value\",\"field_script\":\"function invoke(fields,tags){if(tags.daemonset_name){return fields.number_unavailable+fields.number_available}else{if(tags.statefulset_name){return fields.replicas}else{if(tags.deployment_name){return fields.replicas}}}return 0}\"},{\"aggregator\":\"value\",\"alias\":\"resource_name_value\",\"field\":\"resource_name_value\",\"field_script\":\"function invoke(fields,tags){if(tags.daemonset_name){return tags.daemonset_name}else{if(tags.statefulset_name){return tags.statefulset_name}else{if(tags.deployment_name){return tags.deployment_name}}}return null};\"}],\"group\":[\"cluster_name\",\"namespace\",\"daemonset_name\",\"statefulset_name\",\"deployment_name\"],\"metrics\":[\"kubernetes_daemonset\",\"kubernetes_statefulset\",\"kubernetes_deployment\"],\"outputs\":[\"alert\"],\"select\":{\"_meta\":\"#_meta\",\"_metric_scope\":\"#_metric_scope\",\"_metric_scope_id\":\"#_metric_scope_id\",\"cluster_name\":\"#cluster_name\",\"component_name\":\"#resource_name_value\",\"daemonset_name\":\"#daemonset_name\",\"deployment_name\":\"#deployment_name\",\"namespace\":\"#namespace\",\"org_name\":\"#org_name\",\"statefulset_name\":\"#statefulset_name\"},\"window\":1}");
  