Garden 0.12.7 is out!
Along with a few bug fixes and performance improvements, this release includes a major new Garden feature: Templated modules.
Templated Modules
You can now create customized templates for modules or sets of modules, and render them using templated modules.
These templates allow you to define your own schemas and abstractions that are translated at runtime to one or more modules.
Module templates can include any supporting files (such as Kubernetes manifests, common configuration files, Dockerfiles etc.).
For example, you could set up a module template that generates a container
module and an accompanying kubernetes
module, where the image built by the container
module is used by the kubernetes
module:
kind: ModuleTemplate
name: k8s-container
inputsSchemaPath: module-templates.json
modules:
- type: container
name: ${parent.name}-image
description: ${parent.name} image
- type: kubernetes
name: ${parent.name}-manifests
build:
dependencies: ["${parent.name}-image"]
files: [.manifests.yml]
generateFiles:
- sourcePath: manifests.yml
targetPath: .manifests.yml
This template would then be used as follows:
kind: Module
type: templated
template: k8s-container
name: my-service
inputs:
containerPort: 8080
servicePort: 80
See the templated-k8s-container
example project for more context on the snippets above.
Module templates can be reused across your project (or projects), which may greatly reduce the amount of configuration needed to add a module or a set of modules to your project.
When used well, module templates can:
- Greatly reduce repetition in your configuration.
- Help keep your configuration consistent across modules.
- Simplify maintenance.
See our Module Templates guide for details.
Faster Remote Source Resolution
We now resolve remote sources in parallel, which speeds up the initialization of projects with several remote sources.
Acknowledgements
Big thanks to @RetWolf and @wyrie for their contributions to this release, and as always, many thanks to everyone who has filed issues and given us feedback!
Changelog
Features
- core: add ModuleTemplates and templated modules (3c60e61a)
Improvements
- core: resolve remote sources in parallel (#2097) (1e3dce0f)
- template: return partially resolved conditionals unchanged (d30b8567)
Bug Fixes
- cli: error in tools command when defaultNamespace=null on an env (27af1fdd)
- cli: bad error message when --env namespace is set on some commands (cd41a1f5)
- cli: update docs for microk8s commands (7249ab69)
- cli: update microk8s commands (6b5cff6c)
- core: omit dependencyResults from events (a0d38339)
- enterprise: fix batch sizing logic (da367308)