Create API Authentication

TL;DR

Define a KonnectAPIAuthConfiguration to provide credentials and a KonnectExtension to connect your cluster to a Konnect Control Plane.

Prerequisites

This page is part of the Get Started with the Kong Gateway Operator series.

Complete the previous page, Install Kong Operator before completing this page.

Create a KonnectAPIAuthConfiguration object

Depending on your preferences, you can create a KonnectAPIAuthConfiguration object with the token specified directly in the spec or as a reference to a Kubernetes Secret. In the CRD, the serverURL should be set to the Konnect API url in the region where your account is located.

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 -

Validate

Run the following command to verify that the authentication configuration was created successfully:

kubectl get konnectapiauthconfiguration konnect-api-auth -n kong
Something wrong?

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!