MCPcopy Index your code
hub / github.com/Kong/kong-operator

github.com/Kong/kong-operator @v2.2.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.2 ↗ · + Follow
12,702 symbols 59,676 edges 1,888 files 7,226 documented · 57%
What it actually does AI analysis from the code graph — generated when you open this
loading…
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

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.

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.

Extension points exported contracts — how you extend this code

Controller (Interface)
----------------------------------------------------------------------------- Controller Manager - Controller Definition [44 …
modules/manager/controller_setup.go
WatchableEntityType (Interface)
WatchableEntityType is a constraint that represents all Konnect-related entity types that can be watched. [46 implementers]
controller/konnect/watch.go
DeepCopier (Interface)
DeepCopier is a type contraint which allows enforcing DeepCopy() *T method on objects. [591 implementers]
controller/dataplane/owned_finalizer_controller.go
Extendable (Interface)
Extendable is an interface that provides access to the extensions of an object. [6 implementers]
controller/pkg/extensions/apply.go
ConditionsAware (Interface)
ConditionsAware is a CRD that has Conditions. [57 implementers]
pkg/utils/kubernetes/status.go
ObjectWithControlPlaneRef (Interface)
ObjectWithControlPlaneRef is an interface for objects that have a ControlPlaneRef and support deepcopy and condition set [15 …
test/crdsvalidation/common/constraints.go
Reconciler (Interface)
Reconciler represents a reconciler. [22 implementers]
test/envtest/controller.go
ObjectSupportingAdoption (Interface)
ObjectSupportingAdoption defines the interface of types supporting adoption. [22 implementers]
test/helpers/deploy/deploy_resources.go

Core symbols most depended-on inside this repo

Run
called by 1897
ingress-controller/pkg/manager/multiinstance/manager.go
Logf
called by 906
test/envtest/assert.go
Create
called by 659
pkg/clientset/typed/configuration/v1/kongplugin.go
Get
called by 629
scripts/cli-arguments-docs-gen/main.go
CommonObjectMeta
called by 628
test/crdsvalidation/common/common.go
Add
called by 522
ingress-controller/internal/dataplane/translator/subtranslator/ingress.go
Error
called by 509
controller/konnect/ops/errors.go
GetKonnectID
called by 501
controller/konnect/ops/ops_kongpluginbinding.go

Shape

Function 5,527
Method 5,102
Struct 1,440
Interface 320
TypeAlias 258
FuncType 55

Languages

Go100%

Modules by API surface

api/configuration/v1alpha1/zz_generated.deepcopy.go582 symbols
api/konnect/v1alpha1/zz_generated.deepcopy.go278 symbols
api/configuration/v1alpha1/zz_generated_funcs.go203 symbols
crd-from-oas/pkg/generator/generator.go186 symbols
api/configuration/v1alpha1/schema_types.go182 symbols
crd-from-oas/pkg/generator/generator_test.go115 symbols
api/gateway-operator/v1beta1/zz_generated.deepcopy.go100 symbols
api/gateway-operator/v2beta1/zz_generated.deepcopy.go98 symbols
api/configuration/v1alpha1/schema_types_test.go90 symbols
ingress-controller/internal/store/store.go80 symbols
ingress-controller/internal/dataplane/translator/subtranslator/httproute.go70 symbols
api/konnect/v1alpha2/zz_generated.deepcopy.go68 symbols

Datastores touched

hasura_dataDatabase · 1 repos

For agents

$ claude mcp add kong-operator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact