k8s-dns-failure

k8s-dns-failure is a skill for Claude Code, Codex from kudig-io/kudig-database. It costs 0 tokens per session (3,567 once invoked), scanned A, original, Apache-2.0.

A guide for diagnosing and fixing DNS problems in Kubernetes, a system for running containerised applications. It focuses on CoreDNS, the component that helps services find one another and reach external services.

In plain words
What is it for?
Use it when Kubernetes services cannot find each other or cannot reach external systems because of DNS failures.
Why use it?
It helps trace failures caused by broken name lookups, which can stop service discovery and access to outside dependencies.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it when Kubernetes services cannot find each other or cannot reach external systems because of DNS failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kudig-io/kudig-database/k8s-dns-failure
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add kudig-io/kudig-database --skill k8s-dns-failure
Clone the repo
git clone --depth 1 https://github.com/kudig-io/kudig-database

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for k8s-dns-failure

README.md
[![agentmods](https://agentmods.dev/badge/skills/kudig-io/kudig-database/k8s-dns-failure/github.svg)](https://agentmods.dev/skills/kudig-io/kudig-database/k8s-dns-failure)
Your own site
<a href="https://agentmods.dev/skills/kudig-io/kudig-database/k8s-dns-failure"><img src="https://agentmods.dev/badge/skills/kudig-io/kudig-database/k8s-dns-failure/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for k8s-dns-failure

Your own site · 80×15
<a href="https://agentmods.dev/skills/kudig-io/kudig-database/k8s-dns-failure"><img src="https://agentmods.dev/badge/skills/kudig-io/kudig-database/k8s-dns-failure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,567 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03567
Opus 5.5 $0.00000 $0.01427
Sonnet 5.5 $0.00000 $0.00713
Haiku 4.5 $0.00000 $0.00357

Measured 1mo ago against content hash 082d0d5e30cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

k8s-dns-failure scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/diagnose-quick.sh, scripts/verify-dns.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

19-故障诊断/08-技能体系/skill-set/k8s-dns-failure/SKILL.md · 295 lines

How it starts

The opening of the file, as written. The whole thing — 295 lines — stays where its author put it; the contents beside it link to each section on GitHub.

生产环境安全提示

本文档包含可直接执行的运维命令。执行前请确认:当前目标集群与 Namespace 是否正确;是否具备足够的 RBAC 权限;是否已在非生产环境验证。命令风险等级标注:🔴 高风险(可能造成数据丢失或服务中断)、🟡 中风险(会修改集群状态,但通常可回滚)、🟢 低风险/只读(信息收集,无副作用)。

DNS 解析问题诊断与修复

概述

[[coredns|CoreDNS]] 是 [[kubernetes|Kubernetes]] 集群 DNS 的核心组件。DNS 问题会导致服务发现失败、外部依赖不可访问等连锁问题。

典型触发场景:

  1. CoreDNS Pod 崩溃或资源不足
  2. CoreDNS ConfigMap 配置错误
  3. [[networkpolicy|NetworkPolicy]] 阻断 UDP/53
  4. 节点 DNS 配置冲突(systemd-resolved 等)

症状识别

# 症状描述 检测方法 置信度
S1 Pod 内域名解析失败 nslookup kubernetes.default 0.95
S2 跨服务调用超时 应用日志显示连接超时 0.80
S3 CoreDNS Pod 未 Running `kubectl get [[Pods pods]] -n kube-system`

快速诊断

./scripts/diagnose-quick.sh <namespace> [pod-name] [test-domain]

修复动作

低风险修复

# 修复动作 命令
R1 重启 CoreDNS Pod kubectl rollout restart deployment coredns -n kube-system
R2 扩大 CoreDNS 副本数 kubectl scale deployment coredns -n kube-system --replicas=3
R3 修正 Pod dnsPolicy kubectl patch pod <pod> --type merge -p '{"spec":{"dnsPolicy":"ClusterFirst"}}'

中风险修复

# 修复动作 风险
R4 修改 CoreDNS ConfigMap 配置错误可能导致全集群 DNS 问题
R5 修改节点 resolv.conf 可能影响节点上所有容器

验证修复

./scripts/verify-dns.sh <namespace> [pod-name] [test-domain]

升级条件

  • 修复后 DNS 仍间歇性失败 → 升级至网络深度诊断
  • 怀疑 CNI 问题 → 升级至 SKILL-NET-003

远程顾问信息收集

作为远程顾问,我无法直接连接你的集群。请帮我收集以下信息,我会根据你提供的内容给出准确的诊断建议。

第一步:快速确认(30 秒内回答)

  1. 影响范围:这个问题影响多少个节点 / Pod / 命名空间?
  2. 紧急程度:业务是否已中断?是否有用户投诉?
  3. 发生时间:问题是突然发生还是逐渐恶化?最近是否有变更?

第二步:关键信息(请提供你能获取的)

  1. kubectl 版本:kubectl version --short 的输出
  2. K8s 集群版本:kubectl get nodes -o wide 中的 VERSION 列
  3. 节点状态:控制平面节点是否正常?工作节点是否正常?

第三步:诊断信息(按需补充)

如果以下命令你无法执行,请直接告诉我「无法执行」,我会提供替代方案。

  1. 相关组件日志:kubectl logs -n <namespace> <pod> 的最后 30 行
  2. 节点资源:kubectl top nodes 或 kubectl describe node <node> 的 Capacity/Allocated resources
  3. 近期变更:最近 24 小时是否有部署、扩缩容、配置变更?

Read the full file on GitHub · 295 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +19 lines 082d0d5e30cf
  2. 1mo ago First seen · 276 lines · 0 tokens per session scan A 9d893a5568fe

Subscribe to this mod's changes

k8s-dns-failure is a skill published in the GitHub repository kudig-io/kudig-database (6 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,567 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.