コンテンツにスキップ
Kong Logo | Kong Docs Logo
  • ドキュメント
    • API仕様を確認する
      View all API Specs すべてのAPI仕様を表示 View all API Specs arrow image
    • ドキュメンテーション
      API Specs
      Kong Gateway
      軽量、高速、柔軟なクラウドネイティブAPIゲートウェイ
      Kong Konnect
      SaaSのエンドツーエンド接続のための単一プラットフォーム
      Kong AI Gateway
      GenAI インフラストラクチャ向けマルチ LLM AI Gateway
      Kong Mesh
      Kuma と Envoy をベースにしたエンタープライズサービスメッシュ
      decK
      Kongの構成を宣言型で管理する上で役立ちます
      Kong Ingress Controller
      Kubernetesクラスタ内で動作し、Kongをプロキシトラフィックに設定する
      Kong Gateway Operator
      YAMLマニフェストを使用してKubernetes上のKongデプロイメントを管理する
      Insomnia
      コラボレーティブAPI開発プラットフォーム
  • Plugin Hub
    • Plugin Hubを探索する
      View all plugins すべてのプラグインを表示 View all plugins arrow image
    • 機能性 すべて表示 View all arrow image
      すべてのプラグインを表示
      AI's icon
      AI
      マルチ LLM AI Gatewayプラグインを使用してAIトラフィックを管理、保護、制御する
      認証's icon
      認証
      認証レイヤーでサービスを保護する
      セキュリティ's icon
      セキュリティ
      追加のセキュリティレイヤーでサービスを保護する
      トラフィック制御's icon
      トラフィック制御
      インバウンドおよびアウトバウンドAPIトラフィックの管理、スロットル、制限
      サーバーレス's icon
      サーバーレス
      他のプラグインと組み合わせてサーバーレス関数を呼び出します
      分析と監視's icon
      分析と監視
      APIとマイクロサービストラフィックを視覚化、検査、監視
      変革's icon
      変革
      Kongでリクエストとレスポンスをその場で変換
      ログ記録's icon
      ログ記録
      インフラストラクチャに最適なトランスポートを使用して、リクエストと応答データをログに記録します
  • サポート
  • コミュニティ
  • Kongアカデミー
デモを見る 無料トライアルを開始
貢献ガイドライン
  • Home icon
  • Style guide and contribution guidelines
  • Documenting Kong-owned plugins
report-issue問題を報告する
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Kong AI Gateway
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • ドキュメント投稿ガイドライン
  • Contribution guidelines
  • Style guidelines
    • Style guide
    • Word choice and naming
    • Notes and other notices
    • Diagrams
    • Documenting user interfaces
    • Contribution templates
    • Plugin documentation
      • Documenting Kong-owned plugins
      • Documenting partner plugins
  • Markdown rules and formatting
    • Markdown rules
    • Reusable content
    • Variables
    • Single-sourced versions
    • Single-sourced plugins
    • Conditional rendering
  • Community
    • Welcome to the Kong Docs community
    • Community expectations
    • Hackathons
enterprise-switcher-icon 次に切り替える: OSS
On this pageOn this page
  • Prerequisites
  • Add a new plugin doc
  • Adding images
  • Adding plugin examples
    • OpenAI Example
  • Test and submit plugin
  • Custom plugins and documentation

このページは、まだ日本語ではご利用いただけません。翻訳中です。

Documenting Kong-owned plugins

Plugin documentation is posted on the Plugin Hub. All Kong plugin docs must follow a specific template.

Looking for instructions on submitting a partner plugin? See the Partner Plugins guide.

Prerequisites

  • You have a parallel plugin PR in one of the Kong source code repositories.
  • You plugin has description for every config parameter field in its Lua schema file.
  • You have set up a local clone of the docs repository.

Add a new plugin doc

  1. In your local clone of the docs repository, create a new branch for your plugin.

  2. Create a subdirectory for the plugin within the _app/_hub/kong-inc directory. For example, _app/_hub/kong-inc/your-plugin.

  3. Copy the contents of the /docs/templates/kong-plugin-template directory into your own plugin’s directory.

    You should now have a directory that looks like this:

     _app
       _hub
         kong-inc
           example-plugin
             how-to
               _index.md
             _changelog.md
             overview
               _index.md
             _metadata
               _index.yml
             versions.yml
    
  4. Populate the files in the directory with your own info:

    • _metadata/_index.yml: Sets the metadata for the plugin. Follow the instructions in the file to fill it out.

    • overview/_index.md: Introduction for your plugin. This is where you explain how the plugin works and why someone would want to use it.

    • _changelog.md: A changelog for your plugin. For the first entry, just note when the plugin was published.

    • how-to/_index.md: Markdown documentation on how to use the plugin. You can create any number of files in the how-to folder, e.g. how-to/_getting-started.md, how-to/_metrics.md, etc.

    • versions.yml: Set the Kong Gateway version that the plugin is introduced in. This will generate a doc for every subsequent gateway version, starting with the one you specify.

  5. Add an icon for your plugin into the /app/assets/images/icons/hub directory.

    Plugin icons are required for publication on the Kong plugin hub. Icons should be a PNG or SVG file, 120x120 pixels in size.

    The filename of your image should be kong-inc_plugin-name. For example, kong-inc_oas-validation.

  6. Create a basic example for your plugin in the plugin toolkit repository.

    This example will be validated against the plugin’s schema, so make sure to include all required configuration parameters.

Adding images

If you have any diagrams or screenshots that you want to add to your plugin documentation:

  1. Add to the images into the app/_assets/images/docs/plugins directory.

    Make sure that any screenshots follow the screenshot guidelines.

  2. Insert images into any of the markdown files for your plugin using the following format:

     ![Authentication flow diagram](/assets/images/docs/plugins/my-plugin-auth-flow.png)
     > *Figure 1: Diagram showing an OAuth2 authentication flow with Keycloak.*
    

Adding plugin examples

You can use plugin_example to easily define and format examples using the plugin.

The example accepts all plugin config, and you can configure it to output any combination of targets and formats that you need.

Possible targets:

  • service
  • route
  • consumer
  • consumer_group
  • global

Possible formats:

  • curl
  • konnect
  • yaml
  • kubernetes
  • terrafrom

Here’s an example of how to format plugin_example using OpenAI and AI Semantic Cache:

{% plugin_example %}
title: OpenAI Example
plugin: kong-inc/ai-semantic-cache
name: ai-semantic-cache
config:
  embeddings:
    auth:
      header_name: Authorization
      header_value: Bearer OPENAI_API_KEY
  model:
    provider: openai
    name: text-embedding-3-large
    options:
      upstream_url: https://api.openai.com/v1/embeddings
  vectordb:
    dimensions: 3072
    distance_metric: cosine
    strategy: redis
    threshold: 0.1
    redis:
      host: redis-stack.redis.svc.cluster.local
      port: 6379
targets:
  - route
formats:
  - curl
  - konnect
  - yaml
  - kubernetes
  - terraform
{% endplugin_example %}

And here’s how that example would render:

OpenAI Example

routeで有効にする
Kong Admin API
Konnect API
Kubernetes
Declarative (YAML)

次のリクエストを行います。

curl -X POST http://localhost:8001/routes/{routeName|Id}/plugins \
    --header "accept: application/json" \
    --header "Content-Type: application/json" \
    --data '
    {
  "name": "ai-semantic-cache",
  "config": {
    "embeddings": {
      "auth": {
        "header_name": "Authorization",
        "header_value": "Bearer OPENAI_API_KEY"
      }
    },
    "model": {
      "provider": "openai",
      "name": "text-embedding-3-large",
      "options": {
        "upstream_url": "https://api.openai.com/v1/embeddings"
      }
    },
    "vectordb": {
      "dimensions": 3072,
      "distance_metric": "cosine",
      "strategy": "redis",
      "threshold": 0.1,
      "redis": {
        "host": "redis-stack.redis.svc.cluster.local",
        "port": 6379
      }
    }
  }
}
    '
ROUTE_NAME IDを、このプラグイン構成が対象とするルートのid またはnameに置き換えてください。

独自のアクセストークン、リージョン、コントロールプレーン(CP)ID、ルートIDを代入して、次のリクエストをしてください。

curl -X POST \
https://{us|eu}.api.konghq.com/v2/control-planes/{controlPlaneId}/core-entities/routes/{routeId}/plugins \
    --header "accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer TOKEN" \
    --data '{"name":"ai-semantic-cache","config":{"embeddings":{"auth":{"header_name":"Authorization","header_value":"Bearer OPENAI_API_KEY"}},"model":{"provider":"openai","name":"text-embedding-3-large","options":{"upstream_url":"https://api.openai.com/v1/embeddings"}},"vectordb":{"dimensions":3072,"distance_metric":"cosine","strategy":"redis","threshold":0.1,"redis":{"host":"redis-stack.redis.svc.cluster.local","port":6379}}}}'

地域固有のURLと個人アクセストークンの詳細については、 Konnect API referenceをご参照ください。

まず、KongPlugin リソースを作成します:

echo "
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: ai-semantic-cache-example
plugin: ai-semantic-cache
config:
  embeddings:
    auth:
      header_name: Authorization
      header_value: Bearer OPENAI_API_KEY
  model:
    provider: openai
    name: text-embedding-3-large
    options:
      upstream_url: https://api.openai.com/v1/embeddings
  vectordb:
    dimensions: 3072
    distance_metric: cosine
    strategy: redis
    threshold: 0.1
    redis:
      host: redis-stack.redis.svc.cluster.local
      port: 6379
" | kubectl apply -f -

次に、次のようにingressに注釈を付けて、KongPluginリソースをイングレスに適用します。

kubectl annotate ingress INGRESS_NAME konghq.com/plugins=ai-semantic-cache-example

INGRESS_NAMEを、このプラグイン構成がターゲットとするイングレス名に置き換えます。 kubectl get ingressを実行すると、利用可能なイングレスを確認できます。

注: KongPluginリソースは一度だけ定義するだけで、ネームスペース内の任意のサービス、コンシューマー、またはルートに適用できます。プラグインをクラスター全体で利用可能にしたい場合は、KongPluginの代わりにKongClusterPluginとしてリソースを作成してください。

このセクションを宣言型構成ファイルに追加します。

plugins:
- name: ai-semantic-cache
  route: ROUTE_NAME|ID
  config:
    embeddings:
      auth:
        header_name: Authorization
        header_value: Bearer OPENAI_API_KEY
    model:
      provider: openai
      name: text-embedding-3-large
      options:
        upstream_url: https://api.openai.com/v1/embeddings
    vectordb:
      dimensions: 3072
      distance_metric: cosine
      strategy: redis
      threshold: 0.1
      redis:
        host: redis-stack.redis.svc.cluster.local
        port: 6379
ROUTE_NAME IDを、このプラグイン構成が対象とするルートのid またはnameに置き換えてください。

Test and submit plugin

  1. Run the docs site locally per the instructions in the docs README.

    You should find your Hub contribution listed at localhost:3000/hub.

  2. Once you are happy with your listing, push your branch to the GitHub repository:

     git push --set-upstream origin [name_of_your_new_branch]
    
  3. Make a pull request against the docs.konghq.com repository to add your documentation to the Plugin Hub.

The Kong docs team will review your PR, suggest improvements and adjustments as necessary, and once approved, will merge and deploy your Plugin Hub addition!

Custom plugins and documentation

If you want to write a custom plugin for your own needs, start by reading the Plugin Development Guide.

If you already wrote a plugin, and are thinking about making it available to the community, we strongly encourage you to host it on a publicly available repository (like GitHub), and distribute it via LuaRocks. A good resource on how to do so is the distribution section of the Plugin Development Guide.

To give visibility to your plugin, you can create a post in the Announcements category of Kong Nation.

If you’re interested in becoming a technical partner and publishing your plugin on the Kong Plugin Hub, please reach out to our Kong Partners team.

Thank you for your feedback.
Was this page useful?
情報が多すぎる場合 close cta icon
Kong Konnectを使用すると、より多くの機能とより少ないインフラストラクチャを実現できます。月額1Mリクエストが無料。
無料でお試しください
  • Kong
    APIの世界を動かす

    APIマネジメント、サービスメッシュ、イングレスコントローラーの統合プラットフォームにより、開発者の生産性、セキュリティ、パフォーマンスを大幅に向上します。

    • 製品
      • Kong Konnect
      • Kong Gateway Enterprise
      • Kong Gateway
      • Kong Mesh
      • Kong Ingress Controller
      • Kong Insomnia
      • 製品アップデート
      • 始める
    • ドキュメンテーション
      • Kong Konnectドキュメント
      • Kong Gatewayドキュメント
      • Kong Meshドキュメント
      • Kong Insomniaドキュメント
      • Kong Konnect Plugin Hub
    • オープンソース
      • Kong Gateway
      • Kuma
      • Insomnia
      • Kongコミュニティ
    • 会社概要
      • Kongについて
      • お客様
      • キャリア
      • プレス
      • イベント
      • お問い合わせ
  • 利用規約• プライバシー• 信頼とコンプライアンス
© Kong Inc. 2025