kong-operator

module
v2.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Apache-2.0

README

Kong Operator

KGO logo

Kong Operator is a Kubernetes Operator that can manage your Kong Ingress Controller, Kong Gateway Data Planes, or both together when running on Kubernetes.

With Kong Operator, users can:

Current Features

The following features are considered supported:

  • Kong Gateway Deployment & Configuration Management using the Gateway API
  • Creation of Kong Gateways using the DataPlane API
  • Kong Gateways upgrades, downgrades and autoscaling
  • Creation of Kong Ingress Controller instances using the ControlPlane API
  • Hybrid Mode Attachment using the DataPlane API
  • Configuration and management of AIGateways (experimental feature)

See our Features Page for details on these capabilities.

API stability

The operator provides 2 APIs:

  • YAML / manifests API which users use to apply their manifests against Kubernetes clusters.
  • Go API through types exported under api/ and other exported packages.

This project:

  • Follows Kubernetes API versioning for the YAML API.
    • This is considered part of the user contract.
  • Tries to not break users implementing against operator's Go API but does not offer a non breaking guarantee.

Quick Start and documentation

If you are eager to start with the operator, you can visit the quick start section of the documentation. Alternatively, the complete docs provide a full and detailed description of how to thoroughly use this project.

Container images

Release images

Release builds can be found on Docker Hub in kong/kong-operator repository.

At the moment we're providing images for:

  • Linux amd64
  • Linux arm64
UBI-based images

For Red Hat certification and OpenShift, the operator can be built on top of UBI 9 minimal:

make docker.build.ubi

This is a separate target: make docker.build keeps producing the default distroless image. The UBI image runs as a non-root user, carries the labels required by preflight, and includes license files under /licenses.

To build the amd64 and arm64 variants with buildx:

docker buildx build --target ubi \
  --platform linux/amd64,linux/arm64 \
  --build-arg GOPATH=/go \
  --build-arg GOCACHE=/root/.cache/go-build \
  -t <registry>/<image>:<tag> --push .
main branch builds

Nightly pre-release builds of the main branch are available from the kong/nightly-kong-operator repository hosted on Docker Hub.

Development

Prerequisites

In order to build the operator you'll have to have Go installed on your machine. In order to do so, follow the instructions on its websitego-dev-site.

Build process

Building the operator should be as simple as running:

make build

This Makefile target will take care of everything from generating client side code, generating Kubernetes manifests, downloading the dependencies and the tools used in the build process and finally, it will build the binary.

After this step has finished successfully you should see the operator's binary bin/manager.

You can also run it directly via make run which will run the operator on your machine against the cluster that you have configured via your KUBECONFIG.

Adding new CRDs

Whenever you add a new CRD:

  • Ensure that it is included in project's PROJECT file. This is necessary for creation of a bundle for external hubs like Operator Hub's community operators.
  • Annotate the CRD and any new type it depends on with the right markers to make sure it will be included in the generated documentation. See the markers used in scripts/crds-generator for reference.

When you modify CRDs in config/crd/kong-operator/, run make verify.crd-breaking-changes to compare them against the base branch before opening or updating a PR. Override the comparison source with CRD_BREAKING_CHANGES_BASE_SHA or CRD_BREAKING_CHANGES_BASE_REF if you need to target a different baseline.

Install the nightly build

Every night a new container image is built from the main development branch.

It can be installed using the helm chart from the main repo:

helm upgrade --install kong-operator \
  kong/kong-operator \
  -n kong-system \
  --create-namespace \
  --set image.tag=nightly \
  --set image.repository=kong/nightly-kong-operator \
  --set env.ENABLE_CONTROLLER_KONNECT=true

[!NOTE] When using the nightly tag the operator version assumed is the one of the Chart.appversion, which is set to the latest release. If a specific version is required (e.g., to enable version-gated features) you can specify it by adding the --set image.effectiveSemver=<DESIRED_VERSION> argument.

Using the unreleased helm chart version

If you want to use the unreleased version of the operator helm chart, you can use the OCI nightly build of the chart:

helm upgrade --install kong-operator \
  --devel \
  oci://registry-1.docker.io/kong/nightly-kong-operator-chart \
  -n kong-system \
  --create-namespace \
  --set image.tag=nightly \
  --set image.repository=kong/nightly-kong-operator

Seeking Help

Please search through the posts on the discussions page as it's likely that another user has run into the same problem. If you don't find an answer, please feel free to post a question.

If you've found a bug, please open an issue.

For a feature request, please open an issue using the feature request template.

You can also talk to the developers behind Kong in the #kong channel on the Kubernetes Slack server.

Community Meetings

You can join bi-weekly meetups hosted by Kong to ask questions, provide feedback, or just to listen and hang out.

See the Online Meetups Page to sign up and receive meeting invites and Zoom links.

Directories

Path Synopsis
api
aiconfiguration/v1alpha1
Package v1alpha1 contains API Schema definitions for the aiconfiguration.konghq.com v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the aiconfiguration.konghq.com v1alpha1 API group.
aigateway/v1alpha1
Package v1alpha1 contains API Schema definitions for the aigateway.konghq.com v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the aigateway.konghq.com v1alpha1 API group.
common/v1alpha1
Package v1alpha1 contains API Schema definitions for the common v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the common v1alpha1 API group.
configuration/v1
Package v1 contains API Schema definitions for the konghq.com v1 API group.
Package v1 contains API Schema definitions for the konghq.com v1 API group.
configuration/v1alpha1
Package v1alpha1 contains API Schema definitions for the configuration.konghq.com v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the configuration.konghq.com v1alpha1 API group.
configuration/v1beta1
Package v1beta1 contains API Schema definitions for the configuration.konghq.com v1beta1 API group.
Package v1beta1 contains API Schema definitions for the configuration.konghq.com v1beta1 API group.
eventgateway/v1alpha1
Package v1alpha1 contains API Schema definitions for the eventgateway.konghq.com v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the eventgateway.konghq.com v1alpha1 API group.
gateway-operator/v1alpha1
Package v1alpha1 contains API Schema definitions for the gateway-operator.konghq.com v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the gateway-operator.konghq.com v1alpha1 API group.
gateway-operator/v1beta1
Package v1beta1 contains API Schema definitions for the gateway-operator.konghq.com v1beta1 API group.
Package v1beta1 contains API Schema definitions for the gateway-operator.konghq.com v1beta1 API group.
gateway-operator/v2beta1
Package v2beta1 contains API Schema definitions for the gateway-operator.konghq.com v2beta1 API group.
Package v2beta1 contains API Schema definitions for the gateway-operator.konghq.com v2beta1 API group.
incubator
Package incubator contains API Schema definitions for the incubator.ingress-controller.konghq.com API group.
Package incubator contains API Schema definitions for the incubator.ingress-controller.konghq.com API group.
incubator/v1alpha1
Package v1alpha1 contains API Schema definitions for the incubator.ingress-controller.konghq.com v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the incubator.ingress-controller.konghq.com v1alpha1 API group.
konnect/v1alpha1
Package v1alpha1 contains API Schema definitions for the konnect.konghq.com v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the konnect.konghq.com v1alpha1 API group.
konnect/v1alpha2
Package v1alpha2 contains API Schema definitions for the konnect.konghq.com v1alpha2 API group.
Package v1alpha2 contains API Schema definitions for the konnect.konghq.com v1alpha2 API group.
mcp/v1alpha1
Package v1alpha1 contains API Schema definitions for the mcp.konghq.com v1alpha1 API group.
Package v1alpha1 contains API Schema definitions for the mcp.konghq.com v1alpha1 API group.
controller
aigateway/onpremconfig
Package onpremconfig holds the reconcilers for the AI Gateway configuration entities (AIGatewayModel, and its sibling kinds) that feed the on-prem AI Gateway control plane instances with configuration.
Package onpremconfig holds the reconcilers for the AI Gateway configuration entities (AIGatewayModel, and its sibling kinds) that feed the on-prem AI Gateway control plane instances with configuration.
crdschema
Package crdschema contains a controller that rebuilds the shared SSA TypeConverterProvider whenever a relevant CustomResourceDefinition changes.
Package crdschema contains a controller that rebuilds the shared SSA TypeConverterProvider whenever a relevant CustomResourceDefinition changes.
gwadmin
Package gwadmin contains the controller deploying gw-admin, the on-prem control plane of the data planes that do not use Konnect, and managing its certificates.
Package gwadmin contains the controller deploying gw-admin, the on-prem control plane of the data planes that do not use Konnect, and managing its certificates.
pkg/dataplane
Package dataplane contains the DataPlane reconciliation logic shared by the specialized DataPlane controllers (AIGatewayDataPlane, KegDataPlane).
Package dataplane contains the DataPlane reconciliation logic shared by the specialized DataPlane controllers (AIGatewayDataPlane, KegDataPlane).
pkg/ssa
Package ssa provides helpers for Server-Side Apply (SSA) workflows, including TypeConverter initialisation, diff-before-apply, and structured-merge-diff-based object merging.
Package ssa provides helpers for Server-Side Apply (SSA) workflows, including TypeConverter initialisation, diff-before-apply, and structured-merge-diff-based object merging.
hack
cleanup command
This script cleans up orphaned GKE clusters and Konnect runtime groups that were created by the e2e tests (caued by e.g.
This script cleans up orphaned GKE clusters and Konnect runtime groups that were created by the e2e tests (caued by e.g.
generators/chainsaw-eventgateway-cross-namespace command
Command chainsaw-eventgateway-cross-namespace generates the chainsaw suite test/e2e/chainsaw/eventgateway-cross-namespace: for each Event Gateway resource, a test against a KonnectEventGateway and one against an OnPremEventGateway, checking each cross-namespace reference of the resource (an axis) in the scenarios of the other *_cross-namespace tests:
Command chainsaw-eventgateway-cross-namespace generates the chainsaw suite test/e2e/chainsaw/eventgateway-cross-namespace: for each Event Gateway resource, a test against a KonnectEventGateway and one against an OnPremEventGateway, checking each cross-namespace reference of the resource (an axis) in the scenarios of the other *_cross-namespace tests:
ingress-controller
internal/admission/validation/consumers/credentials
Package credentials includes validators for the credentials provided for KongConsumers.
Package credentials includes validators for the credentials provided for KongConsumers.
internal/controllers/configuration
Package configuration contains Kubernetes controllers responsible for configuration.konghq.com grouped API types.
Package configuration contains Kubernetes controllers responsible for configuration.konghq.com grouped API types.
internal/dataplane
Package dataplane provides functionality for communicating with and providing configuration to backend dataplane APIs.
Package dataplane provides functionality for communicating with and providing configuration to backend dataplane APIs.
internal/manager
Package manager implements the controller manager for all controllers
Package manager implements the controller manager for all controllers
internal/store
Code generated by hack/generators/cache-stores/main.go; DO NOT EDIT.
Code generated by hack/generators/cache-stores/main.go; DO NOT EDIT.
pkg/manager/instances
Package instances provides a generic registry able to run multiple long-running instances (e.g.
Package instances provides a generic registry able to run multiple long-running instances (e.g.
test/kongintegration
Package kongintegration contains integration tests that require a Kong instance to be running, but do not require a Kubernetes cluster nor full Kong Ingress Controller deployment.
Package kongintegration contains integration tests that require a Kong instance to be running, but do not require a Kubernetes cluster nor full Kong Ingress Controller deployment.
internal
gwadmin/gwadminapi
Package gwadminapi is the client of the gw-admin API, the control plane of an on-prem Event Gateway (OnPremEventGateway).
Package gwadminapi is the client of the gw-admin API, the control plane of an on-prem Event Gateway (OnPremEventGateway).
gwadmin/gwadminsync
Package gwadminsync brings the gw-admin pods of a GWAdmin in line with what a controller wants them to serve.
Package gwadminsync brings the gw-admin pods of a GWAdmin in line with what a controller wants them to serve.
gwadmin/gwadminsync/gwadminsynctest
Package gwadminsynctest provides a GWAdmin ready to be reached by a gwadminsync.Syncer, as the GWAdmin controller provisions it, for the tests of the controllers that push to gw-admin.
Package gwadminsynctest provides a GWAdmin ready to be reached by a gwadminsync.Syncer, as the GWAdmin controller provisions it, for the tests of the controllers that push to gw-admin.
utils/configstoresync
Package configstoresync holds pure helpers shared by the KonnectConfigStoreSync controller and the conflict field indexer: store key derivation, entry resolution, value building and hashing.
Package configstoresync holds pure helpers shared by the KonnectConfigStoreSync controller and the conflict field indexer: store key derivation, entry resolution, value building and hashing.
utils/gwadminref
Package gwadminref follows the reference of an OnPremEventGateway to its GWAdmin: it finds the gateways of a GWAdmin, tells whether a gateway is allowed to use a GWAdmin in another namespace, and names the API Service, the operator Secrets the GWAdmin controller provisions, and the values the data planes carry to tell which certificate authorities they were rolled out with.
Package gwadminref follows the reference of an OnPremEventGateway to its GWAdmin: it finds the gateways of a GWAdmin, tells whether a gateway is allowed to use a GWAdmin in another namespace, and names the API Service, the operator Secrets the GWAdmin controller provisions, and the values the data planes carry to tell which certificate authorities they were rolled out with.
utils/gwadminref/gwadminreftest
Package gwadminreftest builds the objects the tests of the references to a GWAdmin need.
Package gwadminreftest builds the objects the tests of the references to a GWAdmin need.
utils/konnectendpoint
Package konnectendpoint renders the endpoint values Konnect returns for a control plane into the forms Kong consumers accept.
Package konnectendpoint renders the endpoint values Konnect returns for a control plane into the forms Kong consumers accept.
utils/konnectpagination
Package konnectpagination contains helpers to page through Konnect list endpoints.
Package konnectpagination contains helpers to page through Konnect list endpoints.
utils/pki
Package pki contains helpers to issue and inspect the certificates the operator manages, shared by the controllers that issue and renew them.
Package pki contains helpers to issue and inspect the certificates the operator manages, shared by the controllers that issue and renew them.
modules
cli
manager/metadata
Package metadata includes metadata variables for logging and reporting.
Package metadata includes metadata variables for logging and reporting.
pkg
clientset/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
clientset/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
clientset/typed/configuration/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/typed/configuration/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
clientset/typed/configuration/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/typed/configuration/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
clientset/typed/configuration/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/typed/configuration/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
clientset/typed/gateway-operator/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/typed/gateway-operator/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
clientset/typed/gateway-operator/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/typed/gateway-operator/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
clientset/typed/gateway-operator/v2beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/typed/gateway-operator/v2beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
clientset/typed/incubator/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/typed/incubator/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
clientset/typed/konnect/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/typed/konnect/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
clientset/typed/konnect/v1alpha2
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/typed/konnect/v1alpha2/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
multiinstance/aigateway
Package aigateway is able to dynamically run multiple on-prem AI Gateway control plane instances and manage their lifecycle.
Package aigateway is able to dynamically run multiple on-prem AI Gateway control plane instances and manage their lifecycle.
scripts
apitypes-funcs command
crds-generator command
This script is responsible for generating CRDs.
This script is responsible for generating CRDs.
e2e
helpers/kcfg
Package kcfg (Kubernetes configuration) is a single source of truth for common Kubernetes configuration used by tests - CRDs, RBAC, namespaces, etc.
Package kcfg (Kubernetes configuration) is a single source of truth for common Kubernetes configuration used by tests - CRDs, RBAC, namespaces, etc.
helpers/referencegrant
Package referencegrant provides test helpers for exercising code against both ReferenceGrant API versions.
Package referencegrant provides test helpers for exercising code against both ReferenceGrant API versions.
runtimeintegration/aigateway/containers
Package containers provides test containers for the AI Gateway contract tests, modeled on the Kong test containers in ingress-controller/test/kongintegration/containers.
Package containers provides test containers for the AI Gateway contract tests, modeled on the Kong test containers in ingress-controller/test/kongintegration/containers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL