deck file kong2kic

Uses: decK
Related Documentation
Related Resources

The kong2kic command converts a Kong Gateway declarative configuration file in to Kubernetes CRDs that can be used with the Kong Ingress Controller.

kong2kic generates Gateway API HTTPRoute resources by default. If you’re using ingress resources, you can specify the --ingress flag.

Consumers, Consumer Groups, Plugins, and other supported Kong entities are converted to the related Kong prefixed resources, such as KongConsumer.

deck file kong2kic -s kong.yaml -o k8s.yaml

The following table details how Kong configuration entities are mapped to Kubernetes manifests:

decK entity

K8s entity

Service Service with annotations and KongIngress for upstream section
Route Ingress (Ingress API) or HTTPRoute (Gateway API) with annotations
Global Plugin KongClusterPlugin
Plugin KongPlugin
Auth Plugins (key-auth, hmac-auth, jwt, basic-auth, oauth2, acl, mtls-auth) KongPlugin and Secret with credentials section in KongConsumer
Upstream KongIngress or kongUpstreamPolicy
Consumer KongConsumer
ConsumerGroup KongConsumerGroup
Certificate kubernetes.io/tls Secret
CA Certificate generic Secret

Configuration options

The table below shows the most commonly used configuration options. For a complete list, run deck file kong2kic --help.

Flag

Description

Default

--class-name Value to use for "kubernetes.io/ingress.class" (ingress) and for "parentRefs.name" (HTTPRoute). kong
--format Output file format: json or yaml. yaml
--ingress Use Kubernetes Ingress API manifests instead of Gateway API manifests. N/A
--kic-version Generate manifests for KIC v3 or v2. Possible values are 2 or 3. 3

kong2kic conversion example

Let’s see an example of how the following decK state file is converted to Ingress API Kubernetes manifests and Gateway API Kubernetes manifests.

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!