k8s-diagnostics

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Kubernetes Diagnostics

Kubernetes 诊断工具

Analyze cluster health and compare resources using kubectl-mcp-server's diagnostic tools.
借助kubectl-mcp-server的诊断工具分析集群健康状态并对比资源情况。

When to Apply

适用场景

Use this skill when:
  • User mentions: "metrics", "health check", "compare", "analysis", "capacity"
  • Operations: cluster health assessment, environment comparison, resource analysis
  • Keywords: "how much", "usage", "difference between", "capacity planning"
在以下场景使用本技能:
  • 用户提及:metrics、health check、compare、analysis、capacity
  • 操作场景:集群健康评估、环境对比、资源分析
  • 关键词:用量多少、资源使用率、差异对比、容量规划

Priority Rules

优先级规则

PriorityRuleImpactTools
1Check metrics-server before using metricsCRITICAL
get_resource_metrics
2Run health check before deploymentsHIGH
cluster_health_check
3Compare staging vs prod before releaseMEDIUM
compare_namespaces
4Document baseline metricsLOW
get_nodes_summary
优先级规则影响程度工具
1使用metrics前先检查metrics-server严重
get_resource_metrics
2部署前执行健康检查
cluster_health_check
3发布前对比预发布环境与生产环境
compare_namespaces
4记录基准指标数据
get_nodes_summary

Quick Reference

快速参考

TaskToolExample
Cluster health
cluster_health_check
cluster_health_check()
Pod metrics
get_resource_metrics
get_resource_metrics(namespace)
Node summary
get_nodes_summary
get_nodes_summary()
Compare envs
compare_namespaces
compare_namespaces(ns1, ns2, type)
List CRDs
list_crds
list_crds()
任务工具示例
集群健康检查
cluster_health_check
cluster_health_check()
Pod指标
get_resource_metrics
get_resource_metrics(namespace)
节点汇总
get_nodes_summary
get_nodes_summary()
环境对比
compare_namespaces
compare_namespaces(ns1, ns2, type)
列出CRD
list_crds
list_crds()

Resource Metrics

资源指标

python
get_resource_metrics(namespace="default")

get_node_metrics()

get_top_pods(namespace="default", sort_by="cpu")

get_top_pods(namespace="default", sort_by="memory")
python
get_resource_metrics(namespace="default")

get_node_metrics()

get_top_pods(namespace="default", sort_by="cpu")

get_top_pods(namespace="default", sort_by="memory")

Cluster Health Check

集群健康检查

python
cluster_health_check()

get_cluster_info()
python
cluster_health_check()

get_cluster_info()

Compare Environments

环境对比

python
compare_namespaces(
    namespace1="staging",
    namespace2="production",
    resource_type="deployment"
)

compare_namespaces(
    namespace1="default",
    namespace2="default",
    resource_type="deployment",
    context1="staging-cluster",
    context2="prod-cluster"
)
python
compare_namespaces(
    namespace1="staging",
    namespace2="production",
    resource_type="deployment"
)

compare_namespaces(
    namespace1="default",
    namespace2="default",
    resource_type="deployment",
    context1="staging-cluster",
    context2="prod-cluster"
)

API Discovery

API 发现

python
get_api_versions()

check_crd_exists(crd_name="certificates.cert-manager.io")

list_crds()
python
get_api_versions()

check_crd_exists(crd_name="certificates.cert-manager.io")

list_crds()

Resource Analysis

资源分析

python
get_nodes_summary()

kubeconfig_view()

list_contexts_tool()
python
get_nodes_summary()

kubeconfig_view()

list_contexts_tool()

Diagnostic Workflows

诊断工作流

Cluster Overview

集群概览

python
cluster_health_check()
get_nodes_summary()
get_events(namespace="")
list_crds()
python
cluster_health_check()
get_nodes_summary()
get_events(namespace="")
list_crds()

Pre-deployment Check

部署前检查

python
get_resource_metrics(namespace="production")
get_nodes_summary()
compare_namespaces(namespace1="staging", namespace2="prod", resource_type="deployment")
python
get_resource_metrics(namespace="production")
get_nodes_summary()
compare_namespaces(namespace1="staging", namespace2="prod", resource_type="deployment")

Post-incident Analysis

事后分析

python
get_events(namespace)
get_pod_logs(name, namespace, previous=True)
get_resource_metrics(namespace)
describe_node(name)
python
get_events(namespace)
get_pod_logs(name, namespace, previous=True)
get_resource_metrics(namespace)
describe_node(name)

Related Skills

相关技能

  • k8s-troubleshoot - Debug issues
  • k8s-cost - Cost analysis
  • k8s-incident - Incident response
  • k8s-troubleshoot - 问题排查
  • k8s-cost - 成本分析
  • k8s-incident - 事件响应