Configure portal settings

TL;DR

Create a PortalEmailConfig, PortalTeam, and PortalCustomDomain that reference your Portal.

Prerequisites

This page is part of the Get started with Kong Operator and Dev Portal CRDs series.

Complete the previous page, Create a Dev Portal and publish content before completing this page.

You need a domain that you control for two purposes:

  • Email sending: the domain is registered with the portal’s email service so it can send notification emails to developers.
  • Custom portal URL: the hostname is mapped to your portal so developers can access it at a predictable address.

Export the following environment variables before running the steps in this guide:

export PORTAL_EMAIL_DOMAIN='YOUR_DOMAIN'
export PORTAL_FROM_EMAIL="noreply@${PORTAL_EMAIL_DOMAIN}"
export PORTAL_REPLY_TO_EMAIL="support@${PORTAL_EMAIL_DOMAIN}"
export PORTAL_HOSTNAME="portal.${PORTAL_EMAIL_DOMAIN}"

For more information, see Dev Portal custom domains.

Create a PortalTeam

PortalTeam creates a developer team and controls whether that team can own applications. For more background, see Dev Portal RBAC.

  1. Create the PortalTeam resource:

    echo '
    apiVersion: konnect.konghq.com/v1alpha1
    kind: PortalTeam
    metadata:
      name: operator-dev-portal-team
      namespace: kong
    spec:
      portalRef:
        type: namespacedRef
        namespacedRef:
          name: operator-dev-portal
      apiSpec:
        name: platform-team
        description: Team managed by Kong Operator
        canOwnApplications: Enabled
    ' | kubectl apply -f -
  2. Wait for the resource to be ready:

    kubectl wait portalteam/operator-dev-portal-team -n kong \
      --for=condition=Programmed=True \
      --timeout=10m

Create a PortalCustomDomain

PortalCustomDomain attaches a public hostname to the portal.

  1. Create the PortalCustomDomain resource:

    echo '
    apiVersion: konnect.konghq.com/v1alpha1
    kind: PortalCustomDomain
    metadata:
      name: operator-dev-portal-domain
      namespace: kong
    spec:
      portalRef:
        type: namespacedRef
        namespacedRef:
          name: operator-dev-portal
      apiSpec:
        enabled: Enabled
        hostname: '"$PORTAL_HOSTNAME"'
        ssl:
          type: standard
          standard:
            domainVerificationMethod: http
    ' | kubectl apply -f -
  2. Create a CNAME record in your DNS configuration that points to the automatically generated Dev Portal URL/. For more information, see Custom domains.

  3. Wait for the resource to be ready. This resource becomes Programmed only after HTTP domain ownership verification completes. Once the hostname is publicly reachable, run the following command:

    kubectl wait portalcustomdomain/operator-dev-portal-domain -n kong \
      --for=condition=Programmed=True \
      --timeout=10m

Create a PortalEmailConfig

PortalEmailConfig configures the sender information used by the portal.

  1. Create the PortalEmailConfig resource:

    echo '
    apiVersion: konnect.konghq.com/v1alpha1
    kind: PortalEmailConfig
    metadata:
      name: operator-dev-portal-email
      namespace: kong
    spec:
      portalRef:
        type: namespacedRef
        namespacedRef:
          name: operator-dev-portal
      apiSpec:
        domainName: '"$PORTAL_EMAIL_DOMAIN"'
        fromEmail: '"$PORTAL_FROM_EMAIL"'
        fromName: Operator Dev Portal
        replyToEmail: '"$PORTAL_REPLY_TO_EMAIL"'
    ' | kubectl apply -f -
  2. Wait for the resource to be ready:

    kubectl wait portalemailconfig/operator-dev-portal-email -n kong \
      --for=condition=Programmed=True \
      --timeout=10m

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!