Skip to content
Kong Logo | Kong Docs Logo
search
  • We're Hiring!
  • Docs
    • Kong Gateway
    • Kong Konnect
    • Kong Mesh
    • Plugin Hub
    • decK
    • Kubernetes Ingress Controller
    • Insomnia
    • Kuma

    • Docs contribution guidelines
  • Plugin Hub
  • Support
  • Community
  • Kong Academy
Early Access
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Plugin Hub
  • decK
  • Kubernetes Ingress Controller
  • Insomnia
  • Kuma

  • Docs contribution guidelines
  • 1.17.x (latest)
  • 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
    • Terminology
    • Architecture
    • Compatibility Promise
    • Getting Started with decK
    • Backup and Restore
    • Configuration as Code and GitOps
    • Distributed Configuration
    • Best Practices
    • Using decK with Kong Gateway (Enterprise)
    • Run decK with Docker
    • Using Multiple Files to Store Configuration
    • De-duplicate Plugin Configuration
    • Set Up Object Defaults
    • Using environment variables with decK
    • deck completion
    • deck convert
    • deck diff
    • deck dump
    • deck ping
    • deck reset
    • deck sync
    • deck validate
    • deck version
    • deck konnect
    • deck konnect diff
    • deck konnect dump
    • deck konnect ping
    • deck konnect sync

github-edit-pageEdit this page

report-issueReport an issue

enterprise-switcher-iconSwitch to OSS

decK
1.9.x
  • Home
  • decK
  • Guides
  • Multi File State
  • Using Multiple Files to Store Configuration
You are browsing documentation for an outdated version. See the latest documentation here.

Using Multiple Files to Store Configuration

decK can construct a state by combining multiple JSON or YAML files inside a directory instead of a single file.

In most use cases, a single file will suffice, but you might want to use multiple files if:

  • You want to organize the files for each service. In this case, you can have one file per service, and keep the service, its associated routes, plugins, and other entities in that file.
  • You have a large configuration file and want to break it down into smaller digestible chunks.

You can specify an entire directory for decK to consume using the --state flag.

You can also specify multiple files using comma-separated syntax (--state file.yml,file2.yml,directory), or by using the flag many times (-s file.yml -s file2.yml -s directory)

Under the hood, decK combines the YAML/JSON files in a very dumb fashion, meaning it just concatenates the various arrays in the file together, before starting to process the state.

There is no automated way of generating multiple files using decK. You will have to export the entire configuration using the deck dump command and then split the configuration into different files as you see fit for your use case.

Please note that having the state split across different files is not same as distributed configuration.

Thank you for your feedback.
Was this page useful?
  • Kong
    THE CLOUD CONNECTIVITY COMPANY

    Kong powers reliable digital connections across APIs, hybrid and multi-cloud environments.

    • Company
    • Customers
    • Events
    • Investors
    • Careers Hiring!
    • Partners
    • Press
    • Contact
  • Products
    • Kong Konnect
    • Kong Gateway
    • Kong Mesh
    • Get Started
    • Pricing
  • Resources
    • eBooks
    • Webinars
    • Briefs
    • Blog
    • API Gateway
    • Microservices
  • Open Source
    • Install Kong Gateway
    • Kong Community
    • Kubernetes Ingress
    • Kuma
    • Insomnia
  • Solutions
    • Decentralize
    • Secure & Govern
    • Create a Dev Platform
    • API Gateway
    • Kubernetes
    • Service Mesh
Star
  • Terms•Privacy
© Kong Inc. 2023