Skip to content
Kong Logo | Kong Docs Logo
search
  • Docs
    • Explore the API Specs
      View all API Specs View all API Specs View all API Specs arrow image
    • Documentation
      API Specs
      Kong Gateway
      Lightweight, fast, and flexible cloud-native API gateway
      Kong Konnect
      Single platform for SaaS end-to-end connectivity
      Kong Mesh
      Enterprise service mesh based on Kuma and Envoy
      decK
      Helps manage Kong’s configuration in a declarative fashion
      Kong Ingress Controller
      Works inside a Kubernetes cluster and configures Kong to proxy traffic
      Kong Gateway Operator
      Manage your Kong deployments on Kubernetes using YAML Manifests
      Insomnia
      Collaborative API development platform
      Kuma
      Open-source distributed control plane with a bundled Envoy Proxy integration
  • Plugin Hub
    • Explore the Plugin Hub
      View all plugins View all plugins View all plugins arrow image
    • Functionality View all View all arrow image
      View all plugins
      Authentication's icon
      Authentication
      Protect your services with an authentication layer
      Security's icon
      Security
      Protect your services with additional security layer
      Traffic Control's icon
      Traffic Control
      Manage, throttle and restrict inbound and outbound API traffic
      Serverless's icon
      Serverless
      Invoke serverless functions in combination with other plugins
      Analytics & Monitoring's icon
      Analytics & Monitoring
      Visualize, inspect and monitor APIs and microservices traffic
      Transformations's icon
      Transformations
      Transform request and responses on the fly on Kong
      Logging's icon
      Logging
      Log request and response data using the best transport for your infrastructure
  • Support
  • Community
  • Kong Academy
Get a Demo Start Free Trial
decK
1.29.x (latest)
  • Home icon
  • decK
  • Guides
  • Best Practices
  • Best Practices when using decK
github-edit-pageEdit this page
report-issueReport an issue
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • Docs contribution guidelines
  • 1.29.x (latest)
  • 1.28.x
  • 1.27.x
  • 1.26.x
  • 1.25.x
  • 1.24.x
  • 1.23.x
  • 1.22.x
  • 1.21.x
  • 1.20.x
  • 1.19.x
  • 1.18.x
  • 1.17.x
  • 1.16.x
  • 1.15.x
  • 1.14.x
  • 1.13.x
  • 1.12.x
  • 1.11.x
  • 1.10.x
  • 1.9.x
  • 1.8.x
  • 1.7.x
  • pre-1.7
enterprise-switcher-icon Switch to OSS

Best Practices when using decK

  • Always ensure that you have one decK process running at any time. Multiple processes step on each other and can corrupt Kong’s configuration.
  • Do not mix up decK’s declarative configuration with cURL or any other script. Either manage the configuration with decK or manage it with your homegrown script. Mixing the two on the same dataset is cumbersome and error-prone.
  • If you have a very large installation, you can split out your configuration into smaller subsets. You can find more info for it in the guide to practicing distributed configuration.
  • Always use a pinned version of decK and Kong. Use a specific version of decK in production to achieve declarative configuration. If you upgrade to a new version of decK or Kong, please safely test the changes in a staging environment first.
  • decK does not manage encryption of sensitive information. The state file stores the private keys of your certificates and credentials of consumers in plaintext. Be careful in how and where you store this file to avoid any security breaches. Always store the sensitive information in an encrypted form and provide a plaintext version of it on a need-only basis.
  • If you have many consumers in your database, do not export or manage them using decK. Declarative configuration is only meant for entity configuration. It is not meant for end-user data, which can easily grow into hundreds of thousands or millions of records.
  • Always run a deck diff command before running a deck sync to ensure that the change is correct.
  • Adopt a CI-driven configuration practice.
  • Always secure Kong’s Admin API with a reliable authentication method.
  • Do not write the state file by hand to avoid errors. Use Kong’s Admin API to configure Kong for the first time, then export the configuration to a declarative configuration file. Any subsequent changes should be made by manually editing the file and pushing the change via CI. If you’re making a larger change, make the change in Kong first, then export the new file. Then you can diff the two state files to review the changes being made.
  • Configure a cronjob to run deck diff periodically to ensure that Kong’s database is in sync with the state file checking into your Git repositories. Trigger an alert if decK detects a drift in the configuration.
Thank you for your feedback.
Was this page useful?
Too much on your plate? close cta icon
More features, less infrastructure with Kong Konnect. 1M requests per month for free.
Try it for Free
  • Kong
    Powering the API world

    Increase developer productivity, security, and performance at scale with the unified platform for API management, service mesh, and ingress controller.

    • Products
      • Kong Konnect
      • Kong Gateway Enterprise
      • Kong Gateway
      • Kong Mesh
      • Kong Ingress Controller
      • Kong Insomnia
      • Product Updates
      • Get Started
    • Documentation
      • Kong Konnect Docs
      • Kong Gateway Docs
      • Kong Gateway Enterprise Docs
      • Kong Mesh Docs
      • Kong Insomnia Docs
      • Kong Konnect Plugin Hub
    • Open Source
      • Kong Gateway
      • Kuma
      • Insomnia
      • Kong Community
    • Company
      • About Kong
      • Customers
      • Careers
      • Press
      • Events
      • Contact
  • Terms• Privacy• Trust and Compliance
© Kong Inc. 2023