K8s Envoy Troubleshootingのロゴ

K8s Envoy Troubleshooting

組織
k8s-servant
k8s-envoy-troubleshooting

Kubernetes上のEnvoy proxyがリクエストを処理できない場合に使用します。クライアントに503「no healthy upstream」、503「upstream connect error or disconnect/reset before headers. reset reason: remote connection failure」、空の本文を伴う404、504「upstream request timeout」が返される、アクセスログにレスポンスフラグ(UH、UF、NR、NC、UT、UO、URX、UC)が表示される、Envoyが起動時にクラッシュする(「has unknown fields」「no such field」「route: unknown cluster」)といったケースが該当します。独自のbootstrapを持つDeployment、フロントproxy、sidecarなど、Envoyを直接実行する構成と、Contour、Emissary、Gloo配下のproxyを対象とします。アクセスログ、bootstrap、Envoyの読み取り専用adminエンドポイントを確認します。kubectl getとログを使って調査し、修正案を提示します。まず読み取り専用で調査し、変更を加える前に確認します。

概要

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

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

  • どのLLMでも利用可能

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

  • 2個の同梱ファイル

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

  • オープンソース

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

インストール

AIスキル「K8s Envoy 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-envoy-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-envoy-troubleshooting .claude/skills/k8s-envoy-troubleshooting
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

Envoy troubleshooting

Find out why Envoy does not pass a request on, 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.

Envoy takes a request on a listener, matches a route by the Host header (domains) and the path, and sends it to a cluster, whose hosts come from DNS (STRICT_DNS, LOGICAL_DNS), a static list or a control plane (EDS). When it cannot, it answers itself and records why: in the access log as a response flag (UH, UF, NR ...) and %RESPONSE_CODE_DETAILS%, and in its stats. A standalone Envoy reads its bootstrap once at start, so a config error stops it and an edited ConfigMap needs a restart.

The commands use placeholders: my-namespace, my-envoy (the Envoy workload and its ConfigMap), my-envoy-admin (a Service in front of the admin port, if there is one), my-app (the backend) and my-web (a client). Replace them with the real names. Never read Secrets. The bootstrap can hold TLS keys inline (inline_string): never repeat them. Never fetch a full /config_dump, any *_secrets resource, or /certs; use config_dump with ?resource= for clusters, listeners and routes only.

When to use

  • Clients get 503, 504 or 404 from Envoy, or connections reset.
  • Envoy pods crash at start or are not Ready.
  • One backend gets no traffic through Envoy, or all of it.

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:

  • Envoy runs as an Istio sidecar or gateway: k8s-istio-troubleshooting; as Envoy Gateway's proxy: k8s-envoy-gateway-troubleshooting. Their control planes write the config, so start there.
  • The backend Service has no endpoints, or a NetworkPolicy blocks Envoy: k8s-network-troubleshooting.
  • The backend pods themselves fail: k8s-workload-troubleshooting.
  • Contour: kubectl get httpproxy -A shows each HTTPProxy's status (valid, or invalid with the reason); invalid ones are ignored. Emissary and Gloo report errors in their resources' status and their controller logs.

Investigate

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

1. See Envoy's pods and the client's result.

bash
kubectl get pods -n my-namespace -o wide
kubectl logs -n my-namespace deployment/my-web --tail=10

2. Read Envoy's log: the access log (if one is configured) with the response flag and details for each request, and Envoy's own messages. After a crash, read the previous container.

bash
kubectl logs -n my-namespace deployment/my-envoy --tail=50
kubectl logs -n my-namespace deployment/my-envoy --previous --tail=20

3. Read the bootstrap: listeners, routes (domains, match, cluster) and clusters (type, addresses, ports, timeouts). Do not repeat keys you see.

bash
kubectl get deployment my-envoy -n my-namespace -o jsonpath='{.spec.template.spec.containers[0].args}{"\n"}{range .spec.template.spec.volumes[*]}{.name}{" "}{.configMap.name}{.secret.secretName}{"\n"}{end}'
kubectl get configmap my-envoy -n my-namespace -o yaml
kubectl get services,endpointslices -n my-namespace

4. Ask Envoy's admin interface, if it listens on a pod address and your credentials allow get on services/proxy or pods/proxy (the built-in view role does not). These are read-only: Envoy answers 405 to a GET on any endpoint that changes state. If admin listens on 127.0.0.1 only (the docs' recommendation, Istio, Envoy Gateway, Contour), there is no kubectl path to it; say so and work from the log.

bash
kubectl get --raw /api/v1/namespaces/my-namespace/services/my-envoy-admin:admin/proxy/clusters
kubectl get --raw "/api/v1/namespaces/my-namespace/services/my-envoy-admin:admin/proxy/stats?filter=cluster.my-app."
kubectl get --raw "/api/v1/namespaces/my-namespace/services/my-envoy-admin:admin/proxy/config_dump?resource=static_route_configs"
kubectl get --raw /api/v1/namespaces/my-namespace/services/my-envoy-admin:admin/proxy/server_info

5. Open the matching reference and follow its steps:

What you seeReference
A response flag, an error body, /clusters and stats, DNS clusters, health checks, timeouts, circuit breakersreferences/responses-and-upstreams.md
A crash at start, bootstrap errors, the admin interface and what it may show, imagesreferences/bootstrap-and-admin.md

Read the results

What the common findings mean (Envoy 1.40):

  • 503 no healthy upstream, flag UH, details no_healthy_upstream: the cluster has no healthy host. With STRICT_DNS, a name that does not exist counts as a successful lookup with no addresses: /clusters shows no host lines for the cluster, membership_total is 0, and update_success keeps rising, so the DNS name is the first thing to check against the Services.
  • 503 upstream connect error or disconnect/reset before headers. reset reason: remote connection failure, flag UF: Envoy reached a host but the connection was refused (a wrong port, nothing listening). The access log's %UPSTREAM_TRANSPORT_FAILURE_REASON% adds delayed connect error: Connection refused; since 1.39 it is no longer in the response body. reset reason: connection timeout means no answer within connect_timeout (a NetworkPolicy, a dropped port).
  • 404 with an empty body, flag NR, details route_not_found: no virtual host's domains match the request's Host header, or no route matches the path.
  • 504 upstream request timeout, flag UT: the backend did not answer within the route timeout (15s by default).
  • Envoy exits at start with Protobuf message (type envoy.config.bootstrap.v3.Bootstrap reason INVALID_ARGUMENT: ... no such field: '...') has unknown fields: a misspelled or misplaced field; the @ <path> names where. route: unknown cluster '...' means a static route names a cluster that is not defined.

State the cause in one sentence, then the evidence you saw (the client's status and body, the access-log flag and details, the bootstrap field, /clusters), then the proposed fix.

Proposed fix

Show each fix to the user before running it: what it changes and how to undo it. Envoy's bootstrap serves every route and backend behind it: never change it yourself; hand it to the user as a proposed fix. Prefer fixing the source (the Helm values, the manifest in Git, or the control plane's resources). Never use the admin endpoints that change state (/quitquitquit, /healthcheck/fail, /drain_listeners, /logging, /reset_counters, /runtime_modify).

Fix the bootstrap in its source, apply it and restart Envoy so it reads it:

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

bash
kubectl apply -f my-envoy-configmap.yaml
kubectl rollout restart deployment/my-envoy -n my-namespace
# Undo: kubectl apply -f my-envoy-configmap-before.yaml, then restart my-envoy again

If an edited ConfigMap is already in place but Envoy still runs the old bootstrap, restart it:

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

bash
kubectl rollout restart deployment/my-envoy -n my-namespace
# Undo: none needed; the restart only recreates the pods with the same template

Sources

Checked against the Envoy 1.40 documentation and source (v1.40.1):

同梱ファイル

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

よくある質問

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

Kubernetes上のEnvoy proxyがリクエストを処理できない場合に使用します。クライアントに503「no healthy upstream」、503「upstream connect error or disconnect/reset before headers. reset reason: remote connection failure」、空の本文を伴う404、504「upstream request timeout」が返される、アクセスログにレスポンスフラグ(UH、UF、NR、NC、UT、UO、URX、UC)が表示される、Envoyが起動時にクラッシュする(「has unknown fields」「no such field」「route: unknown cluster」)といったケースが該当します。独自のbootstrapを持つDeployment、フロントproxy、sidecarなど、Envoyを直接実行する構成と、Contour、Emissary、Gloo配下のproxyを対象とします。アクセスログ、bootstrap、Envoyの読み取り専用adminエンドポイントを確認します。kubectl getとログを使って調査し、修正案を提示します。まず読み取り専用で調査し、変更を加える前に確認します。

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

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

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

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

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

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

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

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

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

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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