K8s Gateway Api Troubleshootingのロゴ

K8s Gateway Api Troubleshooting

組織
k8s-servant
k8s-gateway-api-troubleshooting

Kubernetes上のGateway APIオブジェクトで、実装にかかわらずルーティングできないときに使います。GatewayClassが"Waiting for controller"のまま、またはAcceptedにならない、Gatewayにアドレスが割り当てられない、あるいはPROGRAMMEDがUnknownまたはFalse("ListenersNotValid", "AddressNotAssigned")、ListenerがProgrammedにならない("InvalidCertificateRef", "ProtocolConflict", "InvalidRouteKinds", "RefNotPermitted")、HTTPRoute、GRPCRoute、TLSRouteがAcceptedにならない("NoMatchingParent", "NotAllowedByListeners", "NoMatchingListenerHostname")、またはステータスが表示されない、ResolvedRefsがFalse("BackendNotFound"、ReferenceGrantがない状態での"RefNotPermitted")、ListenerSets、BackendTLSPolicy、Gateway APIのCRDバージョンやチャネルの不一致といった問題に対応します。kubectl getとdescribeを使って調査し、修正案を提示します。まず読み取り専用で調査し、変更を加える前に確認します。

概要

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

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

  • どのLLMでも利用可能

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

  • 2個の同梱ファイル

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

  • オープンソース

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

インストール

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

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

Gateway API troubleshooting

Find out why a Gateway API object does not route, from the objects' status, 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.

Gateway API splits routing across roles, and each object reports what its controller made of it in status.conditions:

  • A GatewayClass (cluster-scoped) names a controllerName. The implementation whose controller claims that name accepts the class.
  • A Gateway uses a class and has listeners (name, port, protocol, optional hostname, TLS, allowedRoutes). A ListenerSet adds listeners to a Gateway from another object, if the Gateway's allowedListeners admits it.
  • Routes (HTTPRoute, GRPCRoute, TLSRoute, TCPRoute, UDPRoute) attach to a Gateway or one listener through parentRefs, and send traffic to backendRefs. A route reports its status per parent, under status.parents.
  • A ReferenceGrant in a namespace lets objects in another namespace refer to its objects (a route to a backend Service, a listener to a certificate).
  • A BackendTLSPolicy makes the Gateway use TLS to a backend Service.

This skill covers what the API says and works the same in every implementation. How the data plane behaves is the implementation's part.

The commands use placeholders: my-namespace, my-gateway, my-app (the route and its Service) and my-app.example.com. Replace them with the real names. The built-in view role cannot read Gateway API objects (the project ships no read role); if they are forbidden, say so and ask the user for them. Never read Secrets: not the TLS certificates that listeners refer to, not CA bundles in Secrets. A listener's status says whether its certificate resolves; that is enough.

When to use

  • A Gateway has no address, or kubectl get gateways shows PROGRAMMED Unknown or False.
  • A route exists but requests for its host or path get 404, or one listener (often https) does not answer while another works.
  • A route in another namespace, or a ListenerSet, does not attach to a shared Gateway.
  • Applying Gateway API objects or CRDs fails (no matches for kind, a version not served, the safe-upgrades admission policy).

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 class belongs to Envoy Gateway (gateway.envoyproxy.io/gatewayclass-controller), and the objects are Accepted but traffic still fails, or its own policies are involved: k8s-envoy-gateway-troubleshooting.
  • The class belongs to Istio (istio.io/gateway-controller): k8s-istio-troubleshooting. To Cilium (io.cilium/gateway-controller): k8s-cilium-troubleshooting.
  • Everything is Accepted and resolved, but the backend Service has no ready endpoints or its pods fail: k8s-network-troubleshooting, k8s-workload-troubleshooting.
  • The listener's certificate comes from cert-manager and is not issued: k8s-cert-manager-troubleshooting.
  • Applying a CRD or an object is refused by a webhook or an admission policy you did not expect: k8s-api-troubleshooting.

Investigate

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

1. See the classes, the Gateways and the routes.

bash
kubectl get gatewayclasses
kubectl get gateways -A
kubectl get httproutes,grpcroutes -A
kubectl get listenersets,referencegrants,backendtlspolicies -A

If a kind is unknown to the cluster, see step 6.

2. Read the GatewayClass: its controller and whether that controller accepted it.

bash
kubectl get gatewayclass my-class -o jsonpath='{.spec.controllerName}{"\n"}{range .status.conditions[*]}{.type}={.status} {.reason}: {.message}{"\n"}{end}'

3. Read the Gateway and each listener: Accepted and Programmed for the Gateway, then per listener Accepted, Programmed, ResolvedRefs, Conflicted and the number of attached routes.

bash
kubectl get gateway my-gateway -n my-namespace -o jsonpath='{range .status.conditions[*]}{.type}={.status} {.reason}: {.message}{"\n"}{end}{range .status.listeners[*]}{.name}{" routes="}{.attachedRoutes}{"\n"}{range .conditions[*]}{"  "}{.type}={.status} {.reason}: {.message}{"\n"}{end}{end}'
kubectl get gateway my-gateway -n my-namespace -o jsonpath='{range .spec.listeners[*]}{.name}{" "}{.protocol}{" "}{.port}{" "}{.hostname}{" allowedRoutes="}{.allowedRoutes}{" tls="}{.tls}{"\n"}{end}'

4. Read the route's status for each parent: Accepted (did it attach?) and ResolvedRefs (are its backends usable?). An empty status means no controller wrote anything for it.

bash
kubectl get httproute my-app -n my-namespace -o jsonpath='{range .status.parents[*]}{.parentRef}{"\n"}{range .conditions[*]}{"  "}{.type}={.status} {.reason}: {.message}{"\n"}{end}{end}'
kubectl get httproute my-app -n my-namespace -o jsonpath='{.spec.parentRefs}{"\n"}{.spec.hostnames}{"\n"}{range .spec.rules[*]}{.backendRefs}{"\n"}{end}'

5. Check what the route points at: the backend Services and their ports, and ReferenceGrants in the backend's namespace for a cross-namespace reference.

bash
kubectl get services -n my-namespace
kubectl get service my-app -n my-namespace -o jsonpath='{range .spec.ports[*]}{.name}{" "}{.port}{" "}{.appProtocol}{"\n"}{end}'
kubectl get referencegrants -n my-namespace -o yaml

6. Check the CRDs: which Gateway API version and channel is installed, and which API versions are served.

bash
kubectl api-resources --api-group=gateway.networking.k8s.io
kubectl get crd gateways.gateway.networking.k8s.io -o jsonpath='{.metadata.annotations.gateway\.networking\.k8s\.io/bundle-version}{" "}{.metadata.annotations.gateway\.networking\.k8s\.io/channel}{"\n"}'
kubectl get crd tlsroutes.gateway.networking.k8s.io -o jsonpath='{range .spec.versions[*]}{.name}{" served="}{.served}{" storage="}{.storage}{"\n"}{end}'
kubectl get validatingadmissionpolicies

7. Open the matching reference and follow its steps:

What you seeReference
A route not Accepted or with no status, ResolvedRefs False, ReferenceGrants, BackendTLSPolicy, GRPCRoute and TLSRoutereferences/routes.md
A GatewayClass or Gateway not Accepted or Programmed, listener conditions, TLS certificates, ListenerSets, CRD versions and channelsreferences/gateways-and-listeners.md

Read the results

Conditions and reasons are from the Gateway API 1.6 specification; the quoted messages are Envoy Gateway 1.9's. Other implementations use the same reasons with their own messages.

  • GatewayClass Accepted Unknown, reason Pending (Waiting for controller): no running controller claims its controllerName. A typo in the name, an implementation that is not installed or not running, or a class meant for another cluster. Every Gateway of the class then shows Accepted and Programmed Unknown, Pending, and gets no address.
  • GatewayClass Accepted False, InvalidParameters: its parametersRef points at an object that does not exist or is malformed.
  • Gateway Accepted False, ListenersNotValid (No listeners are valid: ...): every listener is invalid; read their conditions. When only some are invalid, the Gateway stays Accepted and Programmed and only those listeners fail.
  • Gateway Programmed False, AddressNotAssigned: the implementation could not give it an address, for example a LoadBalancer Service with no load balancer, or no valid listener to serve.
  • Listener ResolvedRefs False, InvalidCertificateRef (No valid secrets exist: certificate refs 0: Secret my-namespace/my-app-tls does not exist.): the TLS certificate the listener names does not exist or is not a valid TLS Secret. The listener is Programmed False and nothing serves its port. Do not read the Secret; the condition is the evidence.
  • Listener Conflicted True, ProtocolConflict or HostnameConflict: listeners on the same port disagree on protocol, or share a hostname.
  • Listener ResolvedRefs False, InvalidRouteKinds: allowedRoutes.kinds names a route kind the implementation does not support on that protocol.
  • Route Accepted False, NoMatchingParent (No listeners match this parent ref): the parent ref's sectionName or port matches no listener of the Gateway.
  • Route Accepted False, NotAllowedByListeners (No listeners included by this parent ref allowed this attachment.): the listener's allowedRoutes does not admit the route's namespace or kind. The default, which the API server fills in, is namespaces.from: Same: only routes from the Gateway's own namespace attach.
  • Route Accepted False, NoMatchingListenerHostname: the route's hostnames and the listener's hostname do not intersect.
  • A route with no status.parents at all: no controller considers itself responsible. The parentRefs name a Gateway that does not exist (a typo, the wrong namespace), or one whose class nobody accepts.
  • Route ResolvedRefs False, BackendNotFound or RefNotPermitted: the backend does not exist, or is in another namespace without a ReferenceGrant there.
  • Route Accepted and resolved, but requests still fail: the API side is done; look at the backend's endpoints and at the implementation (hand-offs above).

State the cause in one sentence, then the evidence you saw (the object, the condition, its reason and message, the spec fields that disagree), then the proposed fix.

Proposed fix

Show each fix to the user before running it: what it changes and how to undo it. Fix the object that is wrong, and prefer fixing it in its source (Git, a Helm chart), since a controller or a GitOps tool may set it back.

A route belongs to the team that publishes the app, so correcting a route's parentRefs, hostnames or backend is reversible and goes under "Ask first". A Gateway, its listeners and allowedRoutes, a GatewayClass, a ReferenceGrant and the CRDs are shared: changing them changes who can route what for every team on the Gateway. Never run those yourself; hand them to the Gateway's owners as proposed fixes. A GatewayClass's controllerName cannot be changed after it is created. Write each undo with the values you found.

Attach a route to the listener that exists (use the index of the parent ref you found):

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

bash
kubectl patch httproute my-app -n my-namespace --type=json -p '[{"op": "replace", "path": "/spec/parentRefs/0/sectionName", "value": "http"}]'
# Undo: kubectl patch httproute my-app -n my-namespace --type=json -p '[{"op": "replace", "path": "/spec/parentRefs/0/sectionName", "value": "web"}]'

Let a listener admit routes from a team's namespace as well as its own. A selector replaces Same, so it must also match the Gateway's namespace, or the routes already attached there are dropped; the kubernetes.io/metadata.name label is on every namespace. This changes who can attach routes to a shared Gateway, so the agent does not run it:

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

bash
kubectl patch gateway my-gateway -n my-namespace --type=json -p '[{"op": "replace", "path": "/spec/listeners/0/allowedRoutes", "value": {"namespaces": {"from": "Selector", "selector": {"matchExpressions": [{"key": "kubernetes.io/metadata.name", "operator": "In", "values": ["my-namespace", "my-other-namespace"]}]}}}}]'
# Undo: kubectl patch gateway my-gateway -n my-namespace --type=json -p '[{"op": "replace", "path": "/spec/listeners/0/allowedRoutes", "value": {"namespaces": {"from": "Same"}}}]'

Move a Gateway to the class whose controller runs. Its implementation then takes the Gateway over, so the agent does not run it:

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

bash
kubectl patch gateway my-gateway -n my-namespace --type=merge -p '{"spec": {"gatewayClassName": "my-working-class"}}'
# Undo: kubectl patch gateway my-gateway -n my-namespace --type=merge -p '{"spec": {"gatewayClassName": "my-class"}}'

A missing listener certificate is fixed by creating or issuing it (for example a cert-manager Certificate whose secretName is the Secret the listener names), never by reading or copying another Secret. Give the user the name and namespace from the listener's condition.

Sources

Checked against the Gateway API 1.6 specification and source (v1.6.3), and on a Kubernetes 1.37 kind cluster with Envoy Gateway 1.9.2 (Gateway API CRDs v1.6.1, experimental channel):

同梱ファイル

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

よくある質問

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

Kubernetes上のGateway APIオブジェクトで、実装にかかわらずルーティングできないときに使います。GatewayClassが"Waiting for controller"のまま、またはAcceptedにならない、Gatewayにアドレスが割り当てられない、あるいはPROGRAMMEDがUnknownまたはFalse("ListenersNotValid", "AddressNotAssigned")、ListenerがProgrammedにならない("InvalidCertificateRef", "ProtocolConflict", "InvalidRouteKinds", "RefNotPermitted")、HTTPRoute、GRPCRoute、TLSRouteがAcceptedにならない("NoMatchingParent", "NotAllowedByListeners", "NoMatchingListenerHostname")、またはステータスが表示されない、ResolvedRefsがFalse("BackendNotFound"、ReferenceGrantがない状態での"RefNotPermitted")、ListenerSets、BackendTLSPolicy、Gateway APIのCRDバージョンやチャネルの不一致といった問題...

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

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

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

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

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

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

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

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

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

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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