Getting Started
Architecture
Concepts
References
Flow Templates
Overview
Flow Templates provide a powerful way to standardize and simplify the process of creating flows in your Kardinal deployments. They allow DevOps engineers or senior developers to define reusable configurations that can be easily applied by other team members.
Key Features
- Standardization: Enforce best practices and consistent configurations across your team.
- Customization: Allow for parameterized values that can be adjusted per flow.
- Flexibility: Support for various template types to suit different deployment needs.
- Integration: Seamlessly works with Kardinal's existing flow creation process.
Template Types
- Default: Uses the configuration specified in the manifest without modifications.
- Custom: User-defined templates that can override or extend the base manifest configuration.
Creating a Template
Templates are defined using YAML and can include overrides to the base manifest and parameterized values.
Basic Structure
Guidelines
- Use descriptive names and provide detailed descriptions.
- Use parameterized values (e.g.,
${parameter:-default}
) for customizable fields. - Only use annotations with the
kardinal.dev.service
suffix. - Ensure
metadata.name
is present and corresponds to a valid service.
Using Templates
Via the CLI
Example:
Via the UI
- Choose a template when creating a flow.
- Customize parameterized arguments or use default values.
- Review and submit the flow creation request.
Template Management
Create a Template
List Templates
Delete a Template
Best Practices
- Use parameters for values likely to change between uses.
- Store templates in version control.
- Test templates before making them available to the team.
- Regularly review and update templates to ensure compatibility with current deployments.
Example Template
Here's an example of a template for a PostgreSQL service with seeded data:
To use this template:
Where postgres-args.yaml
might contain:
Advanced Features
You can use the kardinal.dev.service/shared
annotation and set it to true
on a service if you want the service to be shared amongst
different flows. Kardinal will make sure a shared
version of the service is spun up and then deleted when all flows depending on the shared
version are deleted
Example:
Note that this annotation can also be used on the base manifest if we want sharing to be enabled on all flows and not just the ones using a template.
If sharing is enabled on the base manifest you can disable it on a flow using a template by setting the value of the annotation to "false"
.