https://github.com/Kong/kubernetes-configuration.git
This repository holds the API definitions for Kong's Kubernetes configuration.
api/ directory contains Go types that are the source for generatingpkg/clientset: Go clientsets for users who want to interactconfig/crd: Kubernetes CRDs for all supported [channels]test/ directory contains Go teststest/crdsvalidation directory contains Go tests whichtest/unit directory contains Go unit tests for generated Go typesdocs/ directory contains generated API reference markdown filesThis repository supports multiple channels of CRDs. Each channel is an independent collection
of CRDs that is meant to be used by a designated product or project. Manifests for each channel
are stored in a separate directory under config/crd/<channel> (each has a generated kustomize.yaml file as well).
The following channels are supported:
ingress-controller - CRDs for Kong Ingress Controlleringress-controller-incubator - experimental CRDs for Kong Ingress Controllergateway-operator - CRDs for Kong Gateway OperatorIn order to install the CRDs from this repo, you can use the following command, replacing
<channel> with one of the supported channel names.
kustomize build github.com/kong/kubernetes-configuration/config/crd/<channel> | kubectl apply -f -
Optionally you can specify the ref to use via the ?ref=<tag> query parameter.
For example, to install the CRDs for the Kong Ingress Controller, you can run:
kustomize build github.com/kong/kubernetes-configuration/config/crd/ingress-controller | kubectl apply -f -
To install the CRDs from kubernetes-configuration v1.2.0 tag for the Kong Gateway Operator, you can run:
kustomize build github.com/kong/kubernetes-configuration/config/crd/gateway-operator\?ref=v1.2.0 | kubectl apply --server-side -f -
In order to run code generation in this repo you can use make generate.
When you add a new CRD make sure to
+kong:channels marker to specify the channels that the CRD should be published to.test/unittest/crdsvalidationGetItems() []T helper to be generated for your type,Releases are driven by changes in the VERSION file.
This file contains 2 lines:
1.0.0).latest for latest, anything else is not marked as latest).
To release a new version:
VERSION file with said version and whether the version should be marked as latest.The [release_on_version_change.yaml]
workflow will be triggered when a commit changing the VERSION file is pushed to the main branch.
Releases created with this approach will be marked as latest
| Name | Applies to | Meaning |
|---|---|---|
+kong:channels | Types | Any root object type annotated with this marker will be included in a CRD channel passed as a marker value (e.g. +kong:channels=ingress-controller;gateway-operator will include the CRD both in ingress-controller and gateway-operator channels). |
+apireference:kgo:exclude | Fields | Any field annotated with this marker will be excluded from the KGO's generated CRDs reference. |
+apireference:kgo:include | Types | Any type annotated with this marker will be included in the KGO's generated CRDs reference. |
+apireference:kic:exclude | Fields | Any type annotated with this marker will be excluded from the KIC's generated CRDs reference. |
+apireference:kic:include | Types | Any type annotated with this marker will be included in the KIC's generated CRDs reference. |
Channels are used to group CRDs into logical sets that are meant to be used by a specific product or project. API reference markers are used to control which types and fields are included in the generated API reference documentation. While the channels are enough to be defined on a root object type, the API reference markers need to be defined on each type or field that should be included/excluded in the generated API reference documentation.
Currently, we don't have a way to automatically generate API reference documentation based only on channels, so we need separate markers for this purpose.