Create a Dev Portal and publish content
Create a Portal, attach a published PortalPage, and apply a PortalCustomization.
Prerequisites
Series Prerequisites
This page is part of the Get started with Kong Operator and Dev Portal CRDs series.
Complete the previous page, Install Kong Operator for Dev Portal before completing this page.
Kong Konnect
If you don’t have a Konnect account, you can get started quickly with our onboarding wizard.
- The following Konnect items are required to complete this tutorial:
- Personal access token (PAT): Create a new personal access token by opening the Konnect PAT page and selecting Generate Token.
-
Set the personal access token as an environment variable:
export KONNECT_TOKEN='YOUR KONNECT TOKEN'Copied!
Create a KonnectAPIAuthConfiguration resource
kubectl create namespace kong --dry-run=client -o yaml | kubectl apply -f -
echo '
kind: KonnectAPIAuthConfiguration
apiVersion: konnect.konghq.com/v1alpha1
metadata:
name: konnect-api-auth
namespace: kong
spec:
type: token
token: "'$KONNECT_TOKEN'"
serverURL: us.api.konghq.com
' | kubectl apply -f -Create the Portal
The Portal represents the Dev Portal itself in Konnect and provides the parent object for pages, customizations, teams, and sign-in settings. For more information, see the Dev Portal overview.
-
Create the
Portalresource:echo ' apiVersion: konnect.konghq.com/v1alpha1 kind: Portal metadata: name: operator-dev-portal namespace: kong spec: konnect: authRef: name: konnect-api-auth apiSpec: name: operator-dev-portal displayName: Operator Dev Portal description: Developer portal managed by Kong Operator authenticationEnabled: Enabled defaultPageVisibility: public defaultAPIVisibility: private ' | kubectl apply -f -Copied! -
Wait for the resource to be ready:
kubectl wait portal/operator-dev-portal -n kong \ --for=condition=Programmed=True \ --timeout=10mCopied!
Create a PortalPage
The PortalPage adds published content to the portal. For more information, see Dev Portal pages and content.
-
Create the
PortalPageresource:echo ' apiVersion: konnect.konghq.com/v1alpha1 kind: PortalPage metadata: name: operator-dev-portal-getting-started namespace: kong spec: portalRef: type: namespacedRef namespacedRef: name: operator-dev-portal apiSpec: title: Getting Started slug: getting-started description: Landing page for the developer portal content: | # Getting Started Welcome to the developer portal managed by Kong Operator. status: published visibility: public ' | kubectl apply -f -Copied! -
Wait for the resource to be ready:
kubectl wait portalpage/operator-dev-portal-getting-started -n kong \ --for=condition=Programmed=True \ --timeout=10mCopied!
Create a PortalCustomization
The PortalCustomization lets you change the portal’s layout, navigation, and branding. For more information, see Dev Portal customizations.
-
Create the
PortalCustomizationresource:echo ' apiVersion: konnect.konghq.com/v1alpha1 kind: PortalCustomization metadata: name: operator-dev-portal-customization namespace: kong spec: portalRef: type: namespacedRef namespacedRef: name: operator-dev-portal apiSpec: css: | body { background-color: #f6f7fb; } ' | kubectl apply -f -Copied! -
Wait for the resource to be ready:
kubectl wait portalcustomization/operator-dev-portal-customization -n kong \ --for=condition=Programmed=True \ --timeout=10mCopied!