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.

Command usage

Usage:
  deck file kong2kic [flags]

Flags:
      --class-name string    Value to use for "kubernetes.io/ingress.class" ObjectMeta.Annotations and for
                             		"parentRefs.name" in the case of HTTPRoute. (default "kong")
  -f, --format string        Output file format: json or yaml. (default "yaml")
  -h, --help                 help for kong2kic
      --ingress              Use Kubernetes Ingress API manifests instead of Gateway API manifests.
      --kic-version string   Generate manifests for KIC v3 or v2. Possible values are 2 or 3. (default "3")
  -o, --output-file string   Output file to write. Use - to write to stdout. (default "-")
  -s, --state string         decK file to process. Use - to read from stdin. (default "-")

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!