PermalinkKong Developer Portal
This guide shows how to deploy the Kong Developer Portal, a self-hosted portal that comes with Kong Gateway. For new developer portal deployments, we recommend using the Konnect Cloud developer portal.
PermalinkPrerequisites
- Kong Gateway installed
- Kong’s Admin API is accessible over HTTP from your local machine
PermalinkInstallation
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.yaml
file to enable Dev Portal by merging the following values into your existingvalues-cp.yaml
file.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 HTTPSenv.portal_gui_host
: The hostname that you’ll use to access the portalenv.portal_api_url
: The publicly accessible API URL for Dev Portal dataenv.portal_session_conf
: Update the value insecret
andcookie_domain
-
Configure the
portal
section invalues-cp.yaml
. Replaceexample.com
with your custom domain name. -
Configure the
portalapi
section invalues-cp.yaml
. Replaceexample.com
with your custom domain name. -
Run
helm upgrade
to update the release.helm upgrade kong-cp kong/kong -n kong --values ./values-cp.yaml
-
Fetch the
Ingress
IP 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
portal
andportalapi
are accessible using the sameLoadBalancer
. Use the endpoint returned by the following command to configure bothportal.example.com
andportalapi.example.com
.kubectl get ingress -n kong kong-cp-kong-portal -o jsonpath='{range .status.loadBalancer.ingress[0]}{@.ip}{@.hostname}{end}'
PermalinkEnable 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'
PermalinkTesting
Visit http://portal.example.com/ in a browser. You will see a page that says “Built with Kong” with three sample OpenAPI specifications.
PermalinkTroubleshooting
PermalinkI 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.