K8s Cilium Troubleshootingのロゴ

K8s Cilium Troubleshooting

組織
k8s-servant
k8s-cilium-troubleshooting

CNIとしてCiliumを実行するKubernetesクラスターでネットワーク障害が発生した場合に使用します。CiliumNetworkPolicyまたはCiliumClusterwideNetworkPolicyの適用後にPod間の通信が遮断またはタイムアウトする、Hubbleに「Policy denied」のdropが表示される、egress policy適用後にDNS名前解決ができなくなる、L7ルールによるHTTP 403「Access denied」、toFQDNsルールが一致しない、「unable to connect to Cilium agent」によりPodがContainerCreatingのままになる、Cilium agentまたはoperatorのPodがReadyにならない、CiliumEndpointsがReadyにならない、IPAMが枯渇する、といったケースが該当します。kubectl get、describe、events、ログを使って調査します。agent内でcilium-dbgまたはhubbleを実行する前に確認し、修正案を提示します。まず読み取り専用で調査し、変更を加える前に確認します。

概要

公開者k8s-servant
リポジトリk8s-skills
スキル名k8s-cilium-troubleshooting
スター
36
フォーク
7
同梱ファイル
2
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 2個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    k8s-servantがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「K8s Cilium Troubleshooting」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-cilium-troubleshooting
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/k8s-servant/k8s-skills.git /tmp/k8s-skills
mkdir -p .claude/skills
cp -r /tmp/k8s-skills/skills/k8s-cilium-troubleshooting .claude/skills/k8s-cilium-troubleshooting
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでK8s Cilium Troubleshootingを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にK8s Cilium Troubleshootingを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、K8s Cilium Troubleshootingは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Cilium troubleshooting

Find out why traffic fails on a cluster that runs Cilium, and propose a fix. Read first, ask before changing. Run the investigation commands freely. Run a command under an "Ask first" line only after the user approves that exact command; if your credentials do not allow it, give it to the user to run. Never run a "Proposed fix"; hand it to the user.

Cilium gives each pod a CiliumEndpoint with a security identity derived from its labels, and enforces Kubernetes NetworkPolicies, CiliumNetworkPolicies (one namespace) and CiliumClusterwideNetworkPolicies by identity. Once any policy selects an endpoint for a direction (ingress or egress), only what some policy allows gets through in that direction. L7 rules (HTTP, DNS) send the traffic through Cilium's Envoy proxy. Hubble records each flow with its verdict.

The commands use placeholders: my-namespace, my-app (the server) and my-web (the client), my-policy, and cilium-xxxxx (the Cilium agent pod on the node of the pod you investigate). Replace them with the real names. The built-in view role cannot read cilium.io objects (Cilium adds nothing to it); if they are forbidden, say so and ask the user for them. Never read Secrets (Cilium keeps its CA and Cluster Mesh credentials in Secrets).

When to use

  • Pods cannot reach each other, or a Service, on a cluster with Cilium; often right after a policy change.
  • DNS lookups fail (bad address, time-outs) after an egress policy.
  • Requests get HTTP 403 Access denied although the app does not return that.
  • Pods stay ContainerCreating with a Cilium CNI error, or Cilium's own pods are not ready.

Hand-offs, by skill name. When the evidence points elsewhere, continue with that skill; if it is not installed, keep going with the steps here and tell the user which skill would help:

  • The Service has no endpoints, a wrong selector or port, or the target pods are not Ready: k8s-network-troubleshooting (Services and Kubernetes NetworkPolicies) and k8s-workload-troubleshooting.
  • A node is NotReady: k8s-node-troubleshooting.
  • Cilium's Gateway API support (the class io.cilium/gateway-controller) does not accept a Gateway or a route: k8s-gateway-api-troubleshooting.

Investigate

Work through the steps in order. Stop when you have the cause and its evidence.

1. Check Cilium itself: the agent on each node, the operator, Envoy.

bash
kubectl get pods -n kube-system -l k8s-app=cilium -o wide
kubectl get deployments,daemonsets -n kube-system | grep -i -E "cilium|hubble"
kubectl get ciliumnodes

2. Read the client's error and the endpoints. A time-out usually means a drop by policy; bad address means DNS; a 403 with Access denied comes from an L7 rule.

bash
kubectl logs -n my-namespace deployment/my-web --tail=20
kubectl get ciliumendpoints -n my-namespace
kubectl get pods -n my-namespace --show-labels -o wide

A CiliumEndpoint should be ready. Pods without one (hostNetwork pods, pods started before Cilium) are not managed and get no policy.

3. Find the policies that select the pods, in both directions: ingress on the server, egress on the client, and cluster-wide ones.

bash
kubectl get ciliumnetworkpolicies,networkpolicies -n my-namespace
kubectl get ciliumclusterwidenetworkpolicies
kubectl get ciliumnetworkpolicy my-policy -n my-namespace -o yaml
kubectl describe ciliumnetworkpolicy my-policy -n my-namespace

Compare each policy's endpointSelector with the pods' labels, and its fromEndpoints, toEndpoints, toPorts and rules with the traffic that fails.

4. Ask Cilium what it drops. Find the agent pod on the node of the client or server (step 1 and the pod's node), then read the recent dropped flows and the endpoints' policy state. These run a reading command inside the agent, so ask first:

Ask first: the agent runs this only after the user approves it.

bash
kubectl exec cilium-xxxxx -n kube-system -c cilium-agent -- hubble observe --last 50 --namespace my-namespace --verdict DROPPED
kubectl exec cilium-xxxxx -n kube-system -c cilium-agent -- cilium-dbg endpoint list

hubble observe needs Hubble, which is on by default. Without it, cilium-dbg status and the agent's logs are the fallback.

5. Open the matching reference and follow its steps:

What you seeReference
Time-outs, Policy denied drops, a policy that allows the wrong peer, default deny surprises, DNS blocked by an egress policy, L7 403s, toFQDNsreferences/policies.md
Cilium pods not ready, unable to connect to Cilium agent, endpoints not ready, IPAM exhausted, kube-proxy replacement, MTUreferences/agent-and-datapath.md

Read the results

What the common findings mean (Cilium 1.20):

  • Client time-outs, and Hubble shows Policy denied DROPPED with INGRESS DENIED from the client to the server: a policy selects the server for ingress and none allows this client. Compare the policy's fromEndpoints labels with the client's labels.
  • The same with EGRESS DENIED: a policy selects the client for egress and does not allow the destination.
  • bad address or DNS time-outs right after an egress policy on the client: the policy put the client in default-deny for egress and does not allow DNS to kube-dns (UDP and TCP 53, k8s-app: kube-dns in kube-system).
  • HTTP 403 with the body Access denied: an L7 HTTP rule allows the connection but not that method or path; Cilium's Envoy answers instead of the app.
  • cilium-dbg endpoint list shows Enabled for a direction: some policy selects that endpoint there, so default deny applies to it. Disabled means no policy selects it in that direction.
  • A CiliumNetworkPolicy with VALID False: Cilium rejected it; describe shows why.

State the cause in one sentence, then the evidence you saw (the policy and its selectors, the pods' labels, the drop verdict, the client's error), then the proposed fix.

Proposed fix

Show each fix to the user before running it: what it changes and how to undo it. Creating, changing or deleting a network policy changes what traffic is allowed, often for more pods than the one that fails: never run it yourself; hand the change to the user as a proposed fix, with the narrowest rule that allows the traffic. Changing Cilium's configuration (cilium-config, Helm values) and restarting Cilium are for the cluster's administrators. Prefer fixing the policy in the source it is deployed from. Write each undo with the values you found.

Allow my-web into my-app on port 80, next to the existing rule (the user applies it):

Proposed fix: review before running. The agent does not run this.

bash
kubectl apply -f my-app-ingress-from-my-web.yaml
# Undo: kubectl delete -f my-app-ingress-from-my-web.yaml

with my-app-ingress-from-my-web.yaml a CiliumNetworkPolicy in my-namespace whose endpointSelector is app: my-app and whose ingress allows fromEndpoints app: my-web on toPorts port 80/TCP. Policies add up, so the existing rule stays.

Sources

Checked against the Cilium 1.20 documentation and source (v1.20.4):

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「K8s Cilium Troubleshooting」では何ができますか?

CNIとしてCiliumを実行するKubernetesクラスターでネットワーク障害が発生した場合に使用します。CiliumNetworkPolicyまたはCiliumClusterwideNetworkPolicyの適用後にPod間の通信が遮断またはタイムアウトする、Hubbleに「Policy denied」のdropが表示される、egress policy適用後にDNS名前解決ができなくなる、L7ルールによるHTTP 403「Access denied」、toFQDNsルールが一致しない、「unable to connect to Cilium agent」によりPodがContainerCreatingのままになる、Cilium agentまたはoperatorのPodがReadyにならない、CiliumEndpointsがReadyにならない、IPAMが枯渇する、といったケースが該当します。kubectl get、describe、events、ログを使って調査します。agent内でcilium-dbgまたはhubbleを実行する前に確認し、修正案を提示します。まず読み取り専用で調査し、変更を加える前に確認します。

TypingMindでK8s Cilium Troubleshootingを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。K8s Cilium Troubleshootingはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにK8s Cilium Troubleshootingをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-cilium-troubleshootingを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

K8s Cilium Troubleshootingを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

K8s Cilium Troubleshootingで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもK8s Cilium Troubleshootingを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「K8s Cilium Troubleshooting」は無料ですか?

はい。k8s-servantがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇