### Setup regular integration test namespace Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/TESTING.md Demonstrates the setup for a regular integration test, which involves creating a dedicated Kubernetes namespace using `helpers.Setup`. This namespace is automatically cleaned up after the test finishes. ```go ns, cleaner := helpers.Setup(ctx, t, env) ``` -------------------------------- ### Install KongServiceFacade CRD Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/FEATURE_GATES.md Command to install the KongServiceFacade CRD from the incubator package. ```shell kubectl apply -k 'https://github.com/Kong/kubernetes-ingress-controller/config/crd/incubator?ref=main' ``` -------------------------------- ### Example Ingress Resource Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/FEATURE_GATES.md An Ingress resource demonstrating multiple paths pointing to different backend services. ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: example spec: ingressClassName: kong rules: - host: "ingress.example" http: paths: - path: /one pathType: Prefix backend: service: name: red port: number: 80 - path: /two pathType: Prefix backend: service: name: red port: number: 80 - path: /three pathType: Prefix backend: service: name: blue port: number: 80 ``` -------------------------------- ### Install Gateway API CRDs (GA/Beta) Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/README.md Installs Kubernetes resources for Gateway API versions that have graduated to GA or beta, including GatewayClass, Gateway, HTTPRoute, and ReferenceGrant. ```shell kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/standard-install.yaml ``` -------------------------------- ### Install Kong Ingress Controller with Helm Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/README.md Installs the Kong Ingress Controller using Helm. Ensure you have Helm v3 installed and configured for your Kubernetes cluster. ```shell helm install kong --namespace kong --create-namespace --repo https://charts.konghq.com ingress ``` -------------------------------- ### Run dbless integration tests with custom flags Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/TESTING.md Execute dbless integration tests using `make` and pass custom flags to `go test` via `GOTESTFLAGS`. This example demonstrates running a specific test for faster feedback. ```bash make test.integration.dbless GOTESTFLAGS="-count 1 -run TestUDPRouteEssentials" ``` -------------------------------- ### Manually run envtest tests Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/TESTING.md Manually execute envtest-based tests after setting up the environment. This involves sourcing the envtest setup and then running go test with specific tags. ```bash eval $(./bin/setup-envtest use -p env) go test -v -count 1 -tags envtest ./pkg/to/test ``` -------------------------------- ### Install Gateway API CRDs (Experimental) Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/README.md Installs Kubernetes resources for experimental Gateway API features, such as TCPRoute and UDPRoute. ```shell kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.0.0/experimental-install.yaml ``` -------------------------------- ### Setup isolated integration test with additional watch namespace Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/TESTING.md Configure an isolated integration test to deploy the Kong addon and specify additional namespaces for the controller manager to watch. This is done using `featureSetup` with `ControllerManagerOptAdditionalWatchNamespace`. ```go WithSetup("deploy kong addon into cluster", featureSetup( help.ControllerManagerOptAdditionalWatchNamespace("my-additional-namespace"), )). ... ``` -------------------------------- ### Create KongServiceFacade Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/FEATURE_GATES.md Use this to create a KongServiceFacade pointing to a specific Kubernetes service and port. Ensure the CRD is installed and the feature gate is enabled. ```shell kubectl apply -f - <&1 > /dev/null & kubectl port-forward svc/kong-proxy -n kong 8000:80 2>&1 > /dev/null & kubectl port-forward deploy/ingress-kong -n kong 8444:8444 2>&1 > /dev/null & kubectl proxy --port=8002 2>&1 > /dev/null & export POD_NAME=`kubectl get po -n kong -o json | jq ".items[] | .metadata.name" -r | grep ingress` export POD_NAMESPACE=kong go run -tags gcp ./internal/cmd/main.go \ --kubeconfig ~/.kube/config \ --publish-service=kong/kong-proxy \ --apiserver-host=http://localhost:8002 \ --kong-admin-url https://localhost:8444 \ --kong-admin-tls-skip-verify true ``` -------------------------------- ### Run envtest with setup-envtest Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/TESTING.md Use the setup-envtest tool to prepare the environment for running envtest-based tests. This command exports necessary environment variables. ```bash ./bin/setup-envtest use -p env export KUBEBUILDER_ASSETS='/Users/username/Library/Application Support/io.kubebuilder.envtest/k8s/1.27.1-darwin-arm64' ``` -------------------------------- ### Build Raw Server Binary Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/CONTRIBUTING.md Build a raw server binary for the Kong Ingress Controller using the provided Makefile. ```console make build ``` -------------------------------- ### Build Local Container Image Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/CONTRIBUTING.md Build a local container image for the Kong Ingress Controller. Set the TAG and REGISTRY environment variables as needed. ```console TAG=DEV REGISTRY=docker.example.com/registry make container ``` -------------------------------- ### Get namespace for isolated integration test Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/TESTING.md Retrieves the Kubernetes namespace specifically allocated for an isolated integration test. This namespace is managed by the `e2e-framework` and is unique to the test's `Feature`. ```go namespace := GetNamespaceForT(ctx, t) ``` -------------------------------- ### Create Ingress with KongServiceFacade Backend Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/FEATURE_GATES.md Define a netv1.Ingress resource that uses a previously created KongServiceFacade as its backend. The KongServiceFacade must reside in the same namespace as the Ingress. ```shell kubectl apply -f - < ``` -------------------------------- ### Configure Ingress Class via Environment Variable Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/cli-arguments.md Set the ingress class using the CONTROLLER_INGRESS_CLASS environment variable instead of the --ingress-class CLI flag. ```bash CONTROLLER_INGRESS_CLASS=kong-foobar ``` -------------------------------- ### Thread-Safe Reference Counted String Index Implementation Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/keps/0008-unreferenced-object-filtration.md Provides a thread-safe implementation of a reference counting index for strings, suitable for managing Kubernetes object references. It includes methods for inserting, deleting, and querying reference counts. ```go package main import ( "sync" ) // ReferenceCountedStringIndex is a reference counting index of strings where the // implementations must be threadsafe. type ReferenceCountedStringIndex interface { // Insert increases the reference count for each provided entry by 1 Insert(entries ...string) // Delete decreases the reference count for each provided entry by 1 Delete(entries ...string) // ReferenceCount provides the current reference count for a provided entry ReferenceCount(entry string) (referenceCount int) // Len provides the total number of references currently being tracked Len() int } // NewReferenceCountedStringIndex provides a new ReferenceCountedStringIndex func NewReferenceCountedStringIndex() ReferenceCountedStringIndex { return &index{ index: make(map[string]int), lock: sync.RWMutex{}, } } type index struct { index map[string]int lock sync.RWMutex } func (s *index) Insert(entries ...string) { s.lock.Lock() defer s.lock.Unlock() for _, entry := range entries { s.index[entry]++ } } func (s *index) Delete(entries ...string) { s.lock.Lock() defer s.lock.Unlock() for _, entry := range entries { if s.index[entry] == 1 || s.index[entry] == 0 { delete(s.index, entry) } else { s.index[entry]-- } } } func (s *index) ReferenceCount(entry string) int { s.lock.RLock() defer s.lock.RUnlock() return s.index[entry] } func (s *index) Len() int { s.lock.RLock() defer s.lock.RUnlock() return len(s.index) } ``` -------------------------------- ### KongPlugin with Literal Values Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/keps/0010-dynamic-plugin-configuration.md Use this to define a KongPlugin with directly provided literal configuration values, including overrides. ```yaml apiVersion: configuration.konghq.com/v1 kind: KongPlugin metadata: name: plugin-one config: bar: hello-world configFrom: - name: foo value: 100 - name: bar value: goodbye-world # override value found in config.bar - name: widget value: object: values: supported ``` -------------------------------- ### Lint Codebase Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/CONTRIBUTING.md Run the linter to check the codebase for potential issues. Passing this check is required by the CI pipeline. ```console make lint ``` -------------------------------- ### Run isolated integration tests with custom flags Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/TESTING.md Executes dbless isolated integration tests while passing custom flags to the underlying go test command. ```makefile make test.integration.isolated.dbless GOTESTFLAGS="-count 1 -run TestUDPRouteEssentials" ``` -------------------------------- ### KongPlugin with Secret Key References Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/keps/0010-dynamic-plugin-configuration.md Configure a KongPlugin by referencing a key from a Secret. This is suitable for sensitive configuration values. The 'optional' field can be set to true to prevent errors if the secret does not exist. ```yaml apiVersion: configuration.konghq.com/v1 kind: KongPlugin metadata: name: plugin-one config: bar: hello-world configFrom: - name: FOO valueFrom: secretKeyRef: name: my-secret key: foo optional: true type: number ``` -------------------------------- ### ObjectName Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Represents the name of a Kubernetes object. ```APIDOC ## ObjectName ### Description ObjectName refers to the name of a Kubernetes object. Object names can have a variety of forms, including RFC1123 subdomains, RFC 1123 labels, or RFC 1035 labels. ### Underlying Type string ``` -------------------------------- ### Run isolated integration tests with E2E framework labels Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/TESTING.md Filters isolated integration tests using specific E2E framework labels. ```makefile make test.integration.isolated.dbless E2E_FRAMEWORK_FLAGS="-labels=kind=UDPRoute,example=true" ``` -------------------------------- ### Pull Nightly Build of KIC Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/README.md Pulls the latest nightly pre-release build of the Kong Ingress Controller from Docker Hub. This build contains unreleased features for upcoming releases. ```shell docker pull kong/nightly-ingress-controller:nightly ``` -------------------------------- ### UDPIngressSpec Configuration Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines the desired state of a UDPIngress resource, utilizing port-based routing rules. ```APIDOC ## UDPIngressSpec ### Description Defines the desired state of UDPIngress. ### Parameters - **rules** (UDPIngressRule array) - Required - A list of rules used to configure the Ingress. ## UDPIngressRule ### Description Represents a rule to apply against incoming requests wherein no Host matching is available for request routing, only the port is used to match requests. ### Parameters - **port** (integer) - Required - Port indicates the port for the Kong proxy to accept incoming traffic on. - **backend** (IngressBackend) - Required - Backend defines the Kubernetes service which accepts traffic from the listening Port. ``` -------------------------------- ### NamespacedConfigPatch Configuration Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines a JSON patch structure to inject secret values into KongClusterPlugin configurations. ```APIDOC ## NamespacedConfigPatch ### Description Represents a JSON patch to add values from secrets to KongClusterPlugin configuration. ### Fields - **path** (string) - The JSON path to apply the patch. - **valueFrom** (NamespacedConfigSource) - Reference to a secret key containing the value. ``` -------------------------------- ### ObjectReference Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines a reference to a Kubernetes object. ```APIDOC ## ObjectReference ### Description ObjectReference defines reference of a kubernetes object. ### Fields - **group** (string) - Group defines the API group of the referred object. - **kind** (string) - Kind defines the kind of the referred object. - **namespace** (string) - Empty namespace means the same namespace of the owning object. - **name** (string) - Name defines the name of the referred object. ``` -------------------------------- ### Map Host Ports to Kong Ingress Container Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/CONTRIBUTING.md Patch the ingress-kong deployment in KIND to map host ports to the Kong Ingress Controller's container ports. This ensures traffic is correctly routed. ```bash # mapping host ports to a kong ingress container port kubectl patch -n kong deploy ingress-kong -p '{"spec": {"template": {"spec": {"containers":[{"name": "proxy", "ports": [{"containerPort": 8000, "hostPort": 8000, "name": "proxy", "protocol": "TCP"}, {"containerPort": 8443, "hostPort": 8443, "name": "proxy-ssl", "protocol": "TCP"}]}]}}}}' ``` -------------------------------- ### KongUpstreamStickySessions Configuration Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Configures sticky sessions for Kong upstream, ensuring client requests are consistently routed to the same backend target using cookies. ```APIDOC ## KongUpstreamStickySessions ### Description KongUpstreamStickySessions defines the sticky session configuration for Kong upstream. Sticky sessions ensure that requests from the same client are routed to the same backend target. This is achieved using cookies and requires Kong Enterprise Gateway. ### Fields - **cookie** (string) - Cookie is the name of the cookie to use for sticky sessions. Kong will generate this cookie if it doesn't exist in the request. - **cookiePath** (string) - CookiePath is the path to set in the cookie. ``` -------------------------------- ### configuration.konghq.com/v1beta1 - KongConsumerGroup Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Schema for the KongConsumerGroup API, used for managing consumer groups in Kong. ```APIDOC ## configuration.konghq.com/v1beta1 - KongConsumerGroup ### Description KongConsumerGroup is the Schema for the kongconsumergroups API. ### Fields - **apiVersion** (string) - `configuration.konghq.com/v1beta1` - **kind** (string) - `KongConsumerGroup` - **metadata** ([ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#objectmeta-v1-meta)) - Refer to Kubernetes API documentation for fields of `metadata`. - **spec** ([KongConsumerGroupSpec](#kongconsumergroupspec)) - ``` -------------------------------- ### KongServiceFacadeBackend Type Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/incubator-api-reference.md Represents a reference to a Kubernetes Service used as a backend for KongServiceFacade. ```APIDOC ## KongServiceFacadeBackend ### Description KongServiceFacadeBackend is a reference to a Kubernetes Service that is used as a backend for a Kong Service Facade. ### Fields | Field | Description | | --- | --- | | `name` _string_ | Name is the name of the referenced Kubernetes Service. | | `port` _integer_ | Port is the port of the referenced Kubernetes Service. | ``` -------------------------------- ### KongServiceFacadeSpec Type Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/incubator-api-reference.md Defines the desired state for a KongServiceFacade resource. ```APIDOC ## KongServiceFacadeSpec ### Description KongServiceFacadeSpec defines the desired state of KongServiceFacade. ### Fields | Field | Description | | --- | --- | | `backendRef` _[KongServiceFacadeBackend](#kongservicefacadebackend)_ | Backend is a reference to a Kubernetes Service that is used as a backend for this Kong Service Facade. | ``` -------------------------------- ### KongServiceFacade API Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/incubator-api-reference.md Defines the structure and fields for the KongServiceFacade custom resource. ```APIDOC ## KongServiceFacade ### Description KongServiceFacade allows creating separate Kong Services for a single Kubernetes Service. It can be used as Kubernetes Ingress' backend (via its path's `backend.resource` field). It's designed to enable creating two "virtual" Services in Kong that will point to the same Kubernetes Service, but will have different configuration (e.g. different set of plugins, different load balancing algorithm, etc.).

KongServiceFacade requires `kubernetes.io/ingress.class` annotation with a value matching the ingressClass of the Kong Ingress Controller (`kong` by default) to be reconciled. ### Fields | Field | Description | | --- | --- | | `apiVersion` _string_ | `incubator.ingress-controller.konghq.com/v1alpha1` | | `kind` _string_ | `KongServiceFacade` | | `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | | `spec` _[KongServiceFacadeSpec](#kongservicefacadespec)_ | | ``` -------------------------------- ### Run E2E tests with specific test name Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/TESTING.md Executes end-to-end tests with custom go test flags and a specific test name filter. ```makefile make test.e2e GOTESTFLAGS="-count 1" E2E_TEST_RUN=TestDeployAllInOneDBLESS ``` -------------------------------- ### TCPIngressSpec Configuration Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines the desired state of a TCPIngress resource, including routing rules and TLS configurations. ```APIDOC ## TCPIngressSpec ### Description Defines the desired state of TCPIngress. ### Parameters - **rules** (IngressRule array) - Required - A list of rules used to configure the Ingress. - **tls** (IngressTLS array) - Optional - TLS configuration. The mapping of SNIs to TLS cert-key pair defined here will be used for HTTP Ingress rules as well. ``` -------------------------------- ### KongIngressRoute Configuration Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines the configuration schema for KongIngressRoute, which manages route-specific settings like methods, headers, and buffering. ```APIDOC ## KongIngressRoute ### Description Contains KongIngress route configuration. Note: This is deprecated; use Ingress annotations instead. ### Parameters #### Request Body - **methods** (string array) - Optional - List of HTTP methods that match this Route. - **headers** (object) - Optional - Map of header names to lists of values for route matching. - **protocols** (array) - Optional - Array of allowed protocols. - **regex_priority** (integer) - Optional - Priority for regex route resolution. - **strip_path** (boolean) - Optional - Whether to strip the matching prefix from the upstream request URL. - **preserve_host** (boolean) - Optional - Whether to use the request Host header in the upstream request. - **https_redirect_status_code** (integer) - Optional - Status code for protocol mismatch redirects. - **path_handling** (string) - Optional - Controls path combination logic. - **snis** (string array) - Optional - List of SNIs for stream routing. - **request_buffering** (boolean) - Optional - Enable request body buffering. - **response_buffering** (boolean) - Optional - Enable response body buffering. ``` -------------------------------- ### KongPlugin with Value Interpolation Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/keps/0010-dynamic-plugin-configuration.md Use value interpolation to construct dynamic configuration values by referencing previously defined values from Secrets or ConfigMaps. This is useful for creating connection strings or other composite values. ```yaml apiVersion: configuration.konghq.com/v1 kind: KongPlugin metadata: name: plugin-one config: bar: hello-world configFrom: - name: DB_USERNAME valueFrom: secretKeyRef: name: my-secret key: username - name: DB_PASSWORD valueFrom: secretKeyRef: name: my-secret key: password - name: DB_OPTIONS valueFrom: secretKeyRef: name: my-config-map key: options - name: DB_URL value: db://$(DB_USERNAME):$(DB_PASSWORD)@dbhost?$(DB_OPTIONS) ``` -------------------------------- ### KongIngressService Configuration Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines the configuration schema for KongIngressService, which manages upstream service settings like timeouts and retries. ```APIDOC ## KongIngressService ### Description Contains KongIngress service configuration. Note: This is deprecated; use Service annotations instead. ### Parameters #### Request Body - **protocol** (string) - Optional - Protocol used to communicate with the upstream. - **path** (string) - Optional - Path used in requests to the upstream server. - **retries** (integer) - Optional - Number of retries upon proxy failure. - **connect_timeout** (integer) - Optional - Connection timeout in milliseconds. - **read_timeout** (integer) - Optional - Read timeout in milliseconds. - **write_timeout** (integer) - Optional - Write timeout in milliseconds. ``` -------------------------------- ### Supporting Types Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Definitions for supporting types used within the KongPlugin CRD. ```APIDOC ## ConfigPatch ### Description Represents a JSON patch (RFC6902) to add values from a Secret to the generated configuration. ### Fields - **path** (string) - JSON-Pointer (RFC6901) referencing a location in the configuration - **valueFrom** (ConfigSource) - Reference to a secret key ## ConfigSource ### Description Wrapper around SecretValueFromSource for referencing secrets. ### Fields - **secretKeyRef** (SecretValueFromSource) - Specifies the name and key of a secret ``` -------------------------------- ### KongIngressUpstream Configuration Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines the upstream load balancing configuration for KongIngress, including hashing algorithms and health check settings. ```APIDOC ## KongIngressUpstream ### Description KongIngressUpstream contains the subset of Kong Upstream fields supported by the Kong Kubernetes Ingress Controller. ### Fields - **host_header** (string) - The hostname to be used as Host header when proxying requests. - **algorithm** (string) - Load balancing algorithm: "round-robin", "consistent-hashing", "least-connections", "latency". - **slots** (integer) - Number of slots in the load balancer algorithm. - **healthchecks** (Healthcheck) - Health check configurations. - **hash_on** (string) - Hashing input: "none", "consumer", "ip", "header", "cookie", "path", "query_arg", "uri_capture". - **hash_fallback** (string) - Fallback hashing input: "none", "consumer", "ip", "header", "cookie". - **hash_on_header** (string) - Header name for hash input when hash_on is "header". - **hash_fallback_header** (string) - Header name for hash input when hash_fallback is "header". - **hash_on_cookie** (string) - Cookie name for hash input. - **hash_on_cookie_path** (string) - Cookie path for response headers. - **hash_on_query_arg** (string) - Query string parameter for hash input. - **hash_fallback_query_arg** (string) - Fallback query string parameter. - **hash_on_uri_capture** (string) - Capture group name for hash input. - **hash_fallback_uri_capture** (string) - Fallback capture group name. ``` -------------------------------- ### KongUpstreamHash Specification Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines how to calculate hash for consistent-hashing load balancing. ```APIDOC ## KongUpstreamHash ### Description Defines how to calculate hash for consistent-hashing load balancing algorithm. Only one field must be set. ### Parameters #### Request Body - **input** (HashInput) - Optional - Predefined input (ip, consumer, path, none). - **header** (string) - Optional - Header name to use as hash input. - **cookie** (string) - Optional - Cookie name to use as hash input. - **cookiePath** (string) - Optional - Cookie path to set in response headers. - **queryArg** (string) - Optional - Query argument name to use as hash input. - **uriCapture** (string) - Optional - URI capture group name to use as hash input. ``` -------------------------------- ### KongVaultSpec Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines the specification for a custom Kong vault used for storing secrets. ```APIDOC ## KongVaultSpec ### Description KongVaultSpec defines specification of a custom Kong vault. ### Fields - **backend** (string) - Backend is the type of the backend storing the secrets in the vault. The supported backends of Kong is listed here: https://docs.konghq.com/gateway/latest/kong-enterprise/secrets-management/backends/ - **prefix** (string) - Prefix is the prefix of vault URI for referencing values in the vault. It is immutable after created. - **description** (string) - Description is the additional information about the vault. - **config** ([JSON](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#json-v1-apiextensions-k8s-io)) - Config is the configuration of the vault. Varies for different backends. - **tags** ([Tags](#tags)) - Tags are the tags associated to the vault for grouping and filtering. - **controlPlaneRef** ([ControlPlaneRef](#controlplaneref)) - ControlPlaneRef is a reference to a Konnect ControlPlane this KongVault is associated with. ``` -------------------------------- ### KongLicense CRD Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Stores a Kong enterprise license for managed Kong gateway instances. ```APIDOC ## KongLicense ### Description KongLicense stores a Kong enterprise license to apply to managed Kong gateway instances. ### Kind KongLicense ### API Version configuration.konghq.com/v1alpha1 ### Spec - `rawLicenseString` (string) - RawLicenseString is a string with the raw content of the license. - `enabled` (boolean) - Enabled is set to true to let controllers (like KIC or KGO) to reconcile it. Default value is true to apply the license by default. ``` -------------------------------- ### IngressRule Specification Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines the structure for IngressRule, which handles incoming request matching based on SNI and port. ```APIDOC ## IngressRule ### Description IngressRule represents a rule to apply against incoming requests. Matching is performed based on an (optional) SNI and port. ### Parameters #### Request Body - **host** (string) - Optional - Fully qualified domain name of a network host. If not specified, port-based TCP routing is performed. - **port** (integer) - Required - The port on which to accept TCP or TLS over TCP sessions. - **backend** (IngressBackend) - Optional - Defines the referenced service endpoint to which traffic is forwarded. ``` -------------------------------- ### KongPlugin CRD Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md The KongPlugin resource defines how a specific Kong plugin is configured and applied within the Kubernetes cluster. ```APIDOC ## KongPlugin ### Description KongPlugin is the Schema for the kongplugins API, used to configure plugins in Kong via Kubernetes resources. ### Parameters #### Request Body - **apiVersion** (string) - Required - configuration.konghq.com/v1 - **kind** (string) - Required - KongPlugin - **metadata** (ObjectMeta) - Required - Kubernetes metadata - **consumerRef** (string) - Optional - Reference to a particular consumer - **disabled** (boolean) - Optional - Whether the plugin is disabled - **config** (JSON) - Optional - Plugin configuration (mutually exclusive with configFrom) - **configFrom** (ConfigSource) - Optional - Reference to a secret containing configuration (mutually exclusive with config) - **configPatches** (ConfigPatch array) - Optional - JSON patches to the configuration - **plugin** (string) - Required - Name of the plugin - **run_on** (string) - Optional - Node execution configuration - **protocols** (KongProtocol array) - Optional - Protocols to run on - **ordering** (PluginOrdering) - Optional - Plugin execution order (Kong Enterprise only) - **instance_name** (string) - Optional - Custom name for the plugin instance ``` -------------------------------- ### KongUpstreamPolicySpec Configuration Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Specifies the load balancing and health check configurations for a Kong upstream. ```APIDOC ## KongUpstreamPolicySpec ### Description KongUpstreamPolicySpec contains the specification for KongUpstreamPolicy. ### Fields - **algorithm** (string) - Algorithm is the load balancing algorithm to use. Accepted values are: "round-robin", "consistent-hashing", "least-connections", "latency", "sticky-sessions" - **slots** (integer) - Slots is the number of slots in the load balancer algorithm. If not set, the default value in Kong for the algorithm is used. - **hashOn** (KongUpstreamHash) - HashOn defines how to calculate hash for consistent-hashing or sticky-sessions load balancing algorithm. Algorithm must be set to "consistent-hashing" or "sticky-sessions" for this field to have effect. - **hashOnFallback** (KongUpstreamHash) - HashOnFallback defines how to calculate hash for consistent-hashing load balancing algorithm if the primary hash function fails. Algorithm must be set to "consistent-hashing" for this field to have effect. - **healthchecks** (KongUpstreamHealthcheck) - Healthchecks defines the health check configurations in Kong. - **stickySessions** (KongUpstreamStickySessions) - StickySessions defines the sticky session configuration for the upstream. When enabled, clients will be routed to the same backend target based on a cookie. This requires Kong Enterprise Gateway and setting `hash_on` to `none`. ``` -------------------------------- ### NamespacedSecretValueFromSource Configuration Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines the source reference for a secret value including namespace, name, and key. ```APIDOC ## NamespacedSecretValueFromSource ### Description Represents the source of a secret value specifying the secret namespace. ### Fields - **namespace** (string) - The namespace containing the secret. - **name** (string) - The secret containing the key. - **key** (string) - The key containing the value. ``` -------------------------------- ### KongConsumerGroupSpec Specification Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines the desired state of a KongConsumerGroup. ```APIDOC ## KongConsumerGroupSpec ### Description KongConsumerGroupSpec defines the desired state of KongConsumerGroup. ### Parameters #### Request Body - **name** (string) - Optional - Name of the ConsumerGroup in Kong. - **controlPlaneRef** (ControlPlaneRef) - Optional - Reference to a ControlPlane associated with this group. - **tags** (Tags) - Optional - Set of tags applied to the ConsumerGroup. ``` -------------------------------- ### IngressClassParameters CRD Source: https://github.com/kong/kubernetes-ingress-controller/blob/main/docs/api-reference.md Defines parameters for IngressClass, allowing customization of KIC behavior. ```APIDOC ## IngressClassParameters ### Description IngressClassParameters is the Schema for the IngressClassParameters API. ### Kind IngressClassParameters ### API Version configuration.konghq.com/v1alpha1 ### Spec #### IngressClassParametersSpec - `serviceUpstream` (boolean) - Offload load-balancing to kube-proxy or sidecar. - `enableLegacyRegexDetection` (boolean) - EnableLegacyRegexDetection automatically detects if ImplementationSpecific Ingress paths are regular expression paths using the legacy 2.x heuristic. The controller adds the "~" prefix to those paths if the Kong version is 3.0 or higher. ```