このページは、まだ日本語ではご利用いただけません。翻訳中です。
旧バージョンのドキュメントを参照しています。 最新のドキュメントはこちらをご参照ください。
Kong Developer Portal
This guide shows how to deploy the Kong Developer Portal, a self-hosted portal that comes with Kong Gateway Enterprise. For new developer portal deployments, we recommend using the Kong Konnect developer portal.
Prerequisites
- Kong Gateway installed
- Kong’s Admin API is accessible over HTTP from your local machine
Installation
Kong Developer Portal is deployed as part of the kong-cp deployment as it needs access to the database for the Portal API to manage API specifications and content.
-
Update the
values-cp.yamlfile to enable Dev Portal by merging the following values into your existingvalues-cp.yamlfile.env: # Portal configuration # CHANGE THESE VALUES portal_gui_protocol: http portal_gui_host: portal.example.com portal_api_url: http://portalapi.example.com portal_session_conf: '{"cookie_name": "portal_session", "secret": "PORTAL_SUPER_SECRET", "storage": "kong", "cookie_secure": false, "cookie_domain":".example.com"}' # Enable Developer Portal enterprise: portal: enabled: true -
Update the portal hostname values in
values-cp.yaml.-
env.portal_gui_protocol: The protocol to use for the GUI, either HTTP or HTTPS -
env.portal_gui_host: The hostname that you’ll use to access the portal -
env.portal_api_url: The publicly accessible API URL for Dev Portal data -
env.portal_session_conf: Update the value insecretandcookie_domain
-
-
values-cp.yamlでportalセクションを設定します。example.comをカスタムドメイン名に置き換えます。 -
values-cp.yamlでportalapiセクションを設定します。example.comをカスタムドメイン名に置き換えます。 -
helm upgradeを実行してリリースを作成します。helm upgrade kong-cp kong/kong -n kong --values ./values-cp.yaml -
Fetch the
IngressIP address and update your DNS records to point at the Ingress address. You can configure DNS manually, or use a tool like external-dns to automate DNS configuration.Both
portalandportalapiare accessible using the sameLoadBalancer. Use the endpoint returned by the following command to configure bothportal.example.comandportalapi.example.com.kubectl get ingress -n kong kong-cp-kong-portal -o jsonpath='{range .status.loadBalancer.ingress[0]}{@.ip}{@.hostname}{end}'
Enable the Dev Portal
The Kong Developer Portal is not enabled by default in a new Kong Gateway installation. Use the Admin API to enable the portal. Make sure to change the domain, and Kong-Admin-Token values to match your installation.
curl -X PATCH http://admin.example.com/default/workspaces/default -d config.portal=true -H 'Kong-Admin-User: kong_admin' -H 'Kong-Admin-Token: YOUR_PASSWORD'
Testing
Visit http://portal.example.com/ in a browser. You will see a page that says “Built with Kong” with three sample OpenAPI specifications.
Troubleshooting
I can’t log in
If the screen refreshes but you are not logged in to the dev portal, check that cookie_domain is set correctly in values-cp.yaml. Cookies are set on the portal API domain by default. cookie_domain is required to allow the portal to read authentication cookies from the portal API.