Skip to main content
Version: Next

Flow Configurations

Learn how to efficiently structure and manage your flow configurations, ensuring they fit seamlessly into your API Consumption Gateway setup.

By organizing flows, quotas, and path parameters in a clear, maintainable way, you gain direct control over traffic handling, performance optimization, and security enforcement, all through familiar YAML syntax.

Folder Structure

To configure flows, several YAML files must be placed in the correct directories. The folder structure should look like this:

├── quotas
├── flows
├── path_params
├── certs
│ ├── mtls
│ └── tls
├── gateway_config.yaml
├── metrics.yaml

Each folder or file serves a specific purpose in the flow configuration system:

  • gateway_config.yaml: Central configuration file where you define mTLS settings, domain configurations, and other key settings.
  • metrics.yaml: Defines the metrics for API traffic and system performance monitoring.
  • quotas/: Contains YAML files that define API quotas, allowing for rate-limiting and consumption control.
  • path_params/: Holds path parameters that help manage dynamic endpoints by consolidating multiple URL patterns.
  • flows/: Contains the flow YAML files, which define how requests and responses are processed through various processors, filters, and quotas.
  • certs/mtls/: Stores certificates used for Mutual TLS (mTLS) configurations between Lunar.dev Gateway and secure upstream services.
  • certs/tls/: Holds certificates for general TLS encryption to secure communication between clients and the Lunar.dev Gateway.

Once the YAML files are set up, you need to load the flows into the Lunar.dev API Consumption Gateway. Here's how to do it using Docker and Kubernetes.

note

File names for Lunar's YAML configurations don't need to follow a specific convention (e.g., quota.yaml). As long as the file is placed in the correct folder, Lunar will automatically detect and apply it.

Loading Flows in Docker

To load flows in a Docker environment, use the following command:

docker exec lunar-proxy load_flows

This command loads the flows defined in the YAML files into the running Lunar.dev API Consumption Gateway container.

Loading Flows in Kubernetes

For Kubernetes environments, use the following command:

kubectl exec <lunar-proxy-pod-name> -- load_flows

This command loads the flow configuration into the Lunar Gateway running in your Kubernetes cluster.

CTRL + M