helm

Description

Specify a Helm chart (either in your repository or remote from a registry) to deploy. Refer to the Helm guide for usage instructions.
Below is the full schema reference. For an introduction to configuring Garden modules, please look at our Configuration guide.
The first section contains the complete YAML schema, and the second section describes each schema key.
helm modules also export values that are available in template strings. See the Outputs section below for details.

Complete YAML Schema

The values in the schema below are the default values.
1
# The schema version of this config (currently not used).
2
apiVersion: garden.io/v0
3
​
4
kind: Module
5
​
6
# The type of this module.
7
type:
8
​
9
# The name of this module.
10
name:
11
​
12
# Specify how to build the module. Note that plugins may define additional keys on this object.
13
build:
14
# A list of modules that must be built before this module is built.
15
dependencies:
16
- # Module name to build ahead of this module.
17
name:
18
​
19
# Specify one or more files or directories to copy from the built dependency to this module.
20
copy:
21
- # POSIX-style path or filename of the directory or file(s) to copy to the target.
22
source:
23
​
24
# POSIX-style path or filename to copy the directory or file(s), relative to the build directory.
25
# Defaults to to same as source path.
26
target: ''
27
​
28
# Maximum time in seconds to wait for build to finish.
29
timeout: 1200
30
​
31
# A description of the module.
32
description:
33
​
34
# Set this to `true` to disable the module. You can use this with conditional template strings to disable modules
35
# based on, for example, the current environment or other variables (e.g. `disabled: \${environment.name == "prod"}`).
36
# This can be handy when you only need certain modules for specific environments, e.g. only for development.
37
#
38
# Disabling a module means that any services, tasks and tests contained in it will not be deployed or run. It also
39
# means that the module is not built _unless_ it is declared as a build dependency by another enabled module (in which
40
# case building this module is necessary for the dependant to be built).
41
#
42
# If you disable the module, and its services, tasks or tests are referenced as _runtime_ dependencies, Garden will
43
# automatically ignore those dependency declarations. Note however that template strings referencing the module's
44
# service or task outputs (i.e. runtime outputs) will fail to resolve when the module is disabled, so you need to make
45
# sure to provide alternate values for those if you're using them, using conditional expressions.
46
disabled: false
47
​
48
# Specify a list of POSIX-style paths or globs that should be regarded as the source files for this module. Files that
49
# do *not* match these paths or globs are excluded when computing the version of the module, when responding to
50
# filesystem watch events, and when staging builds.
51
#
52
# Note that you can also _exclude_ files using the `exclude` field or by placing `.gardenignore` files in your source
53
# tree, which use the same format as `.gitignore` files. See the [Configuration Files
54
# guide](https://docs.garden.io/using-garden/configuration-overview#including-excluding-files-and-directories) for
55
# details.
56
#
57
# Also note that specifying an empty list here means _no sources_ should be included.
58
#
59
# If neither `include` nor `exclude` is set, and the module has local chart sources, Garden
60
# automatically sets `include` to: `["*", "charts/**/*", "templates/**/*"]`.
61
#
62
# If neither `include` nor `exclude` is set and the module specifies a remote chart, Garden
63
# automatically sets `Γ¬nclude` to `[]`.
64
include:
65
​
66
# Specify a list of POSIX-style paths or glob patterns that should be excluded from the module. Files that match these
67
# paths or globs are excluded when computing the version of the module, when responding to filesystem watch events,
68
# and when staging builds.
69
#
70
# Note that you can also explicitly _include_ files using the `include` field. If you also specify the `include`
71
# field, the files/patterns specified here are filtered from the files matched by `include`. See the [Configuration
72
# Files guide](https://docs.garden.io/using-garden/configuration-overview#including-excluding-files-and-directories)
73
# for details.
74
#
75
# Unlike the `modules.exclude` field in the project config, the filters here have _no effect_ on which files and
76
# directories are watched for changes. Use the project `modules.exclude` field to affect those, if you have large
77
# directories that should not be watched for changes.
78
exclude:
79
​
80
# A remote repository URL. Currently only supports git servers. Must contain a hash suffix pointing to a specific
81
# branch or tag, with the format: <git remote url>#<branch|tag>
82
#
83
# Garden will import the repository source code into this module, but read the module's config from the local
84
# garden.yml file.
85
repositoryUrl:
86
​
87
# When false, disables pushing this module to remote registries.
88
allowPublish: true
89
​
90
# A list of files to write to the module directory when resolving this module. This is useful to automatically
91
# generate (and template) any supporting files needed for the module.
92
generateFiles:
93
- # POSIX-style filename to read the source file contents from, relative to the path of the module (or the
94
# ModuleTemplate configuration file if one is being applied).
95
# This file may contain template strings, much like any other field in the configuration.
96
sourcePath:
97
​
98
# POSIX-style filename to write the resolved file contents to, relative to the path of the module source directory
99
# (for remote modules this means the root of the module repository, otherwise the directory of the module
100
# configuration).
101
#
102
# Note that any existing file with the same name will be overwritten. If the path contains one or more
103
# directories, they will be automatically created if missing.
104
targetPath:
105
​
106
# By default, Garden will attempt to resolve any Garden template strings in source files. Set this to false to
107
# skip resolving template strings. Note that this does not apply when setting the `value` field, since that's
108
# resolved earlier when parsing the configuration.
109
resolveTemplates: true
110
​
111
# The desired file contents as a string.
112
value:
113
​
114
# A map of variables scoped to this particular module. These are resolved before any other parts of the module
115
# configuration and take precedence over project-scoped variables. They may reference project-scoped variables, and
116
# generally use any template strings normally allowed when resolving modules.
117
variables:
118
​
119
# Specify a path (relative to the module root) to a file containing variables, that we apply on top of the
120
# module-level `variables` field.
121
#
122
# The format of the files is determined by the configured file's extension:
123
#
124
# * `.env` - Standard "dotenv" format, as defined by [dotenv](https://github.com/motdotla/dotenv#rules).
125
# * `.yaml`/`.yml` - YAML. The file must consist of a YAML document, which must be a map (dictionary). Keys may
126
# contain any value type.
127
# * `.json` - JSON. Must contain a single JSON _object_ (not an array).
128
#
129
# _NOTE: The default varfile format will change to YAML in Garden v0.13, since YAML allows for definition of nested
130
# objects and arrays._
131
#
132
# To use different module-level varfiles in different environments, you can template in the environment name
133
# to the varfile name, e.g. `varfile: "my-module.\$\{environment.name\}.env` (this assumes that the corresponding
134
# varfiles exist).
135
varfile:
136
​
137
# Whether to set the --atomic flag during installs and upgrades. Set to false if e.g. you want to see more information
138
# about failures and then manually roll back, instead of having Helm do it automatically on failure.
139
atomicInstall: true
140
​
141
# The name of another `helm` module to use as a base for this one. Use this to re-use a Helm chart across multiple
142
# services. For example, you might have an organization-wide base chart for certain types of services.
143
# If set, this module will by default inherit the following properties from the base module: `serviceResource`,
144
# `values`
145
# Each of those can be overridden in this module. They will be merged with a JSON Merge Patch (RFC 7396).
146
base:
147
​
148
# A valid Helm chart name or URI (same as you'd input to `helm install`). Required if the module doesn't contain the
149
# Helm chart itself.
150
chart:
151
​
152
# The path, relative to the module path, to the chart sources (i.e. where the Chart.yaml file is, if any). Not used
153
# when `base` is specified.
154
chartPath: .
155
​
156
# List of names of services that should be deployed before this chart.
157
dependencies: []
158
​
159
# Specifies which files or directories to sync to which paths inside the running containers of the service when it's
160
# in dev mode, and overrides for the container command and/or arguments.
161
#
162
# Note that `serviceResource` must also be specified to enable dev mode.
163
#
164
# Dev mode is enabled when running the `garden dev` command, and by setting the `--dev` flag on the `garden deploy`
165
# command.
166
#
167
# See the [Code Synchronization guide](https://docs.garden.io/guides/code-synchronization-dev-mode) for more
168
# information.
169
devMode:
170
# Override the default container arguments when in dev mode.
171
args:
172
​
173
# Override the default container command (i.e. entrypoint) when in dev mode.
174
command:
175
​
176
# Specify one or more source files or directories to automatically sync with the running container.
177
sync:
178
- # POSIX-style path of the directory to sync to the target, relative to the module's top-level directory. Must be
179
# a relative path. Defaults to the module's top-level directory if no value is provided.
180
source: .
181
​
182
# POSIX-style absolute path to sync the directory to inside the container. The root path (i.e. "/") is not
183
# allowed.
184
target:
185
​
186
# Specify a list of POSIX-style paths or glob patterns that should be excluded from the sync.
187
#
188
# `.git` directories and `.garden` directories are always ignored.
189
exclude:
190
​
191
# The sync mode to use for the given paths. See the [Dev Mode
192
# guide](https://docs.garden.io/guides/code-synchronization-dev-mode) for details.
193
mode: one-way-safe
194
​
195
# The default permission bits, specified as an octal, to set on files at the sync target. Defaults to 0600 (user
196
# read/write). See the [Mutagen docs](https://mutagen.io/documentation/synchronization/permissions#permissions)
197
# for more information.
198
defaultFileMode:
199
​
200
# The default permission bits, specified as an octal, to set on directories at the sync target. Defaults to 0700
201
# (user read/write). See the [Mutagen
202
# docs](https://mutagen.io/documentation/synchronization/permissions#permissions) for more information.
203
defaultDirectoryMode:
204
​
205
# Set the default owner of files and directories at the target. Specify either an integer ID or a string name.
206
# See the [Mutagen docs](https://mutagen.io/documentation/synchronization/permissions#owners-and-groups) for
207
# more information.
208
defaultOwner:
209
​
210
# Set the default group on files and directories at the target. Specify either an integer ID or a string name.
211
# See the [Mutagen docs](https://mutagen.io/documentation/synchronization/permissions#owners-and-groups) for
212
# more information.
213
defaultGroup:
214
​
215
# Optionally specify the name of a specific container to sync to. If not specified, the first container in the
216
# workload is used.
217
containerName:
218
​
219
# A valid Kubernetes namespace name. Must be a valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters,
220
# numbers and dashes, must start with a letter, and cannot end with a dash) and must not be longer than 63 characters.
221
namespace:
222
​
223
# Manually specify port forwards that Garden should set up when deploying in dev or watch mode. If specified, these
224
# override the auto-detection of forwardable ports, so you'll need to specify the full list of port forwards to
225
# create.
226
portForwards:
227
- # An identifier to describe the port forward.
228
name:
229
​
230
# The full resource kind and name to forward to, e.g. Service/my-service or Deployment/my-deployment. Note that
231
# Garden will not validate this ahead of attempting to start the port forward, so you need to make sure this is
232
# correctly set. The types of resources supported will match that of the `kubectl port-forward` CLI command.
233
resource:
234
​
235
# The port number on the remote resource to forward to.
236
targetPort:
237
​
238
# The _preferred_ local port to forward from. If none is set, a random port is chosen. If the specified port is
239
# not available, a warning is shown and a random port chosen instead.
240
localPort:
241
​
242
# Optionally override the release name used when installing (defaults to the module name).
243
releaseName:
244
​
245
# The repository URL to fetch the chart from.
246
repo:
247
​
248
# The Deployment, DaemonSet or StatefulSet or Pod that Garden should regard as the _Garden service_ in this module
249
# (not to be confused with Kubernetes Service resources).
250
#
251
# This can either reference a workload (i.e. a Deployment, DaemonSet or StatefulSet) via the `kind` and `name` fields,
252
# or a Pod via the `podSelector` field.
253
#
254
# Because a Helm chart can contain any number of Kubernetes resources, this needs to be specified for certain Garden
255
# features and commands to work, such as hot-reloading.
256
serviceResource:
257
# The type of Kubernetes resource to sync files to.
258
kind: Deployment
259
​
260
# The name of a container in the target. Specify this if the target contains more than one container and the main
261
# container is not the first container in the spec.
262
containerName:
263
​
264
# A map of string key/value labels to match on any Pods in the namespace. When specified, a random ready Pod with
265
# matching labels will be picked as a target, so make sure the labels will always match a specific Pod type.
266
podSelector:
267
​
268
# The name of the resource to sync to. If the chart contains a single resource of the specified Kind,
269
# this can be omitted.
270
#
271
# This can include a Helm template string, e.g. '{{ template "my-chart.fullname" . }}'.
272
# This allows you to easily match the dynamic names given by Helm. In most cases you should copy this
273
# directly from the template in question in order to match it. Note that you may need to add single quotes around
274
# the string for the YAML to be parsed correctly.
275
name:
276
​
277
# The Garden module that contains the sources for the container. This needs to be specified under `serviceResource`
278
# in order to enable hot-reloading and dev mode, but is not necessary for tasks and tests.
279
#
280
# Must be a `container` module, and for hot-reloading to work you must specify the `hotReload` field on the
281
# container module (not required for dev mode).
282
#
283
# _Note: If you specify a module here, you don't need to specify it additionally under `build.dependencies`._
284
containerModule:
285
​
286
# If specified, overrides the arguments for the main container when running in hot-reload mode.
287
hotReloadArgs:
288
​
289
# Set this to true if the chart should only be built, but not deployed as a service. Use this, for example, if the
290
# chart should only be used as a base for other modules.
291
skipDeploy: false
292
​
293
# The task definitions for this module.
294
tasks:
295
- # The name of the task.
296
name:
297
​
298
# A description of the task.
299
description:
300
​
301
# The names of any tasks that must be executed, and the names of any services that must be running, before this
302
# task is executed.
303
dependencies: []
304
​
305
# Set this to `true` to disable the task. You can use this with conditional template strings to enable/disable
306
# tasks based on, for example, the current environment or other variables (e.g. `enabled: \${environment.name !=
307
# "prod"}`). This can be handy when you only want certain tasks to run in specific environments, e.g. only for
308
# development.
309
#
310
# Disabling a task means that it will not be run, and will also be ignored if it is declared as a runtime
311
# dependency for another service, test or task.
312
#
313
# Note however that template strings referencing the task's outputs (i.e. runtime outputs) will fail to resolve
314
# when the task is disabled, so you need to make sure to provide alternate values for those if you're using them,
315
# using conditional expressions.
316
disabled: false
317
​
318
# Maximum duration (in seconds) of the task's execution.
319
timeout: null
320
​
321
# Set to false if you don't want the task's result to be cached. Use this if the task needs to be run any time
322
# your project (or one or more of the task's dependants) is deployed. Otherwise the task is only re-run when its
323
# version changes (i.e. the module or one of its dependencies is modified), or when you run `garden run task`.
324
cacheResult: true
325
​
326
# The command/entrypoint used to run the task inside the container.
327
command:
328
​
329
# The arguments to pass to the container used for execution.
330
args:
331
​
332
# Key/value map of environment variables. Keys must be valid POSIX environment variable names (must not start with
333
# `GARDEN`) and values must be primitives or references to secrets.
334
env: {}
335
​
336
# Specify artifacts to copy out of the container after the run. The artifacts are stored locally under
337
# the `.garden/artifacts` directory.
338
artifacts:
339
- # A POSIX-style path or glob to copy. Must be an absolute path. May contain wildcards.
340
source:
341
​
342
# A POSIX-style path to copy the artifacts to, relative to the project artifacts directory at
343
# `.garden/artifacts`.
344
target: .
345
​
346
# The Deployment, DaemonSet or StatefulSet or Pod that Garden should use to execute this task.
347
# If not specified, the `serviceResource` configured on the module will be used. If neither is specified,
348
# an error will be thrown.
349
#
350
# This can either reference a workload (i.e. a Deployment, DaemonSet or StatefulSet) via the `kind` and `name`
351
# fields, or a Pod via the `podSelector` field.
352
#
353
# The following pod spec fields from the service resource will be used (if present) when executing the task:
354
# * `affinity`
355
# * `automountServiceAccountToken`
356
# * `containers`
357
# * `dnsConfig`
358
# * `dnsPolicy`
359
# * `enableServiceLinks`
360
# * `hostAliases`
361
# * `hostIPC`
362
# * `hostNetwork`
363
# * `hostPID`
364
# * `hostname`
365
# * `imagePullSecrets`
366
# * `nodeName`
367
# * `nodeSelector`
368
# * `overhead`
369
# * `preemptionPolicy`
370
# * `priority`
371
# * `priorityClassName`
372
# * `runtimeClassName`
373
# * `schedulerName`
374
# * `securityContext`
375
# * `serviceAccount`
376
# * `serviceAccountName`
377
# * `shareProcessNamespace`
378
# * `subdomain`
379
# * `tolerations`
380
# * `topologySpreadConstraints`
381
# * `volumes`
382
resource:
383
# The type of Kubernetes resource to sync files to.
384
kind: Deployment
385
​
386
# The name of a container in the target. Specify this if the target contains more than one container and the
387
# main container is not the first container in the spec.
388
containerName:
389
​
390
# A map of string key/value labels to match on any Pods in the namespace. When specified, a random ready Pod
391
# with matching labels will be picked as a target, so make sure the labels will always match a specific Pod
392
# type.
393
podSelector:
394
​
395
# The name of the resource to sync to. If the chart contains a single resource of the specified Kind,
396
# this can be omitted.
397
#
398
# This can include a Helm template string, e.g. '{{ template "my-chart.fullname" . }}'.
399
# This allows you to easily match the dynamic names given by Helm. In most cases you should copy this
400
# directly from the template in question in order to match it. Note that you may need to add single quotes
401
# around
402
# the string for the YAML to be parsed correctly.
403
name:
404
​
405
# The Garden module that contains the sources for the container. This needs to be specified under
406
# `serviceResource` in order to enable hot-reloading and dev mode, but is not necessary for tasks and tests.
407
#
408
# Must be a `container` module, and for hot-reloading to work you must specify the `hotReload` field on the
409
# container module (not required for dev mode).
410
#
411
# _Note: If you specify a module here, you don't need to specify it additionally under `build.dependencies`._
412
containerModule:
413
​
414
# If specified, overrides the arguments for the main container when running in hot-reload mode.
415
hotReloadArgs:
416
​
417
# The test suite definitions for this module.
418
tests:
419
- # The name of the test.
420
name:
421
​
422
# The names of any services that must be running, and the names of any tasks that must be executed, before the
423
# test is run.
424
dependencies: []
425
​
426
# Set this to `true` to disable the test. You can use this with conditional template strings to
427
# enable/disable tests based on, for example, the current environment or other variables (e.g.
428
# `enabled: \${environment.name != "prod"}`). This is handy when you only want certain tests to run in
429
# specific environments, e.g. only during CI.
430
disabled: false
431
​
432
# Maximum duration (in seconds) of the test run.
433
timeout: null
434
​
435
# The command/entrypoint used to run the test inside the container.
436
command:
437
​
438
# The arguments to pass to the container used for testing.
439
args:
440
​
441
# Key/value map of environment variables. Keys must be valid POSIX environment variable names (must not start with
442
# `GARDEN`) and values must be primitives or references to secrets.
443
env: {}
444
​
445
# Specify artifacts to copy out of the container after the run. The artifacts are stored locally under
446
# the `.garden/artifacts` directory.
447
artifacts:
448
- # A POSIX-style path or glob to copy. Must be an absolute path. May contain wildcards.
449
source:
450
​
451
# A POSIX-style path to copy the artifacts to, relative to the project artifacts directory at
452
# `.garden/artifacts`.
453
target: .
454
​
455
# The Deployment, DaemonSet or StatefulSet or Pod that Garden should use to execute this test suite.
456
# If not specified, the `serviceResource` configured on the module will be used. If neither is specified,
457
# an error will be thrown.
458
#
459
# This can either reference a workload (i.e. a Deployment, DaemonSet or StatefulSet) via the `kind` and `name`
460
# fields, or a Pod via the `podSelector` field.
461
#
462
# The following pod spec fields from the service resource will be used (if present) when executing the test suite:
463
# * `affinity`
464
# * `automountServiceAccountToken`
465
# * `containers`
466
# * `dnsConfig`
467
# * `dnsPolicy`
468
# * `enableServiceLinks`
469
# * `hostAliases`
470
# * `hostIPC`
471
# * `hostNetwork`
472
# * `hostPID`
473
# * `hostname`
474
# * `imagePullSecrets`
475
# * `nodeName`
476
# * `nodeSelector`
477
# * `overhead`
478
# * `preemptionPolicy`
479
# * `priority`
480
# * `priorityClassName`
481
# * `runtimeClassName`
482
# * `schedulerName`
483
# * `securityContext`
484
# * `serviceAccount`
485
# * `serviceAccountName`
486
# * `shareProcessNamespace`
487
# * `subdomain`
488
# * `tolerations`
489
# * `topologySpreadConstraints`
490
# * `volumes`
491
resource:
492
# The type of Kubernetes resource to sync files to.
493
kind: Deployment
494
​
495
# The name of a container in the target. Specify this if the target contains more than one container and the
496
# main container is not the first container in the spec.
497
containerName:
498
​
499
# A map of string key/value labels to match on any Pods in the namespace. When specified, a random ready Pod
500
# with matching labels will be picked as a target, so make sure the labels will always match a specific Pod
501
# type.
502
podSelector:
503
​
504
# The name of the resource to sync to. If the chart contains a single resource of the specified Kind,
505
# this can be omitted.
506
#
507
# This can include a Helm template string, e.g. '{{ template "my-chart.fullname" . }}'.
508
# This allows you to easily match the dynamic names given by Helm. In most cases you should copy this
509
# directly from the template in question in order to match it. Note that you may need to add single quotes
510
# around
511
# the string for the YAML to be parsed correctly.
512
name:
513
​
514
# The Garden module that contains the sources for the container. This needs to be specified under
515
# `serviceResource` in order to enable hot-reloading and dev mode, but is not necessary for tasks and tests.
516
#
517
# Must be a `container` module, and for hot-reloading to work you must specify the `hotReload` field on the
518
# container module (not required for dev mode).
519
#
520
# _Note: If you specify a module here, you don't need to specify it additionally under `build.dependencies`._
521
containerModule:
522
​
523
# If specified, overrides the arguments for the main container when running in hot-reload mode.
524
hotReloadArgs:
525
​
526
# Time in seconds to wait for Helm to complete any individual Kubernetes operation (like Jobs for hooks).
527
timeout: 300
528
​
529
# The chart version to deploy.
530
version:
531
​
532
# Map of values to pass to Helm when rendering the templates. May include arrays and nested objects. When specified,
533
# these take precedence over the values in the `values.yaml` file (or the files specified in `valueFiles`).
534
values: {}
535
​
536
# Specify value files to use when rendering the Helm chart. These will take precedence over the `values.yaml` file
537
# bundled in the Helm chart, and should be specified in ascending order of precedence. Meaning, the last file in
538
# this list will have the highest precedence.
539
#
540
# If you _also_ specify keys under the `values` field, those will effectively be added as another file at the end
541
# of this list, so they will take precedence over other files listed here.
542
#
543
# Note that the paths here should be relative to the _module_ root, and the files should be contained in
544
# your module directory.
545
valueFiles: []
Copied!

Configuration Keys

apiVersion

The schema version of this config (currently not used).
Type
Allowed Values
Default
Required
string
"garden.io/v0"
"garden.io/v0"
Yes

kind

Type
Allowed Values
Default
Required
string
"Module"
"Module"
Yes

type

The type of this module.
Type
Required
string
Yes
Example:
1
type: "container"
Copied!

name

The name of this module.
Type
Required
string
Yes
Example:
1
name: "my-sweet-module"
Copied!

build

Specify how to build the module. Note that plugins may define additional keys on this object.
Type
Default
Required
object
{"dependencies":[]}
No

build.dependencies[]

​build > dependencies
A list of modules that must be built before this module is built.
Type
Default
Required
array[object]
[]
No
Example:
1
build:
2
...
3
dependencies:
4
- name: some-other-module-name
Copied!

build.dependencies[].name

​build > dependencies > name
Module name to build ahead of this module.
Type
Required
string
Yes

build.dependencies[].copy[]

​build > dependencies > copy
Specify one or more files or directories to copy from the built dependency to this module.
Type
Default
Required
array[object]
[]
No

build.dependencies[].copy[].source

​build > dependencies > copy > source
POSIX-style path or filename of the directory or file(s) to copy to the target.
Type
Required
posixPath
Yes

build.dependencies[].copy[].target

​build > dependencies > copy > target
POSIX-style path or filename to copy the directory or file(s), relative to the build directory. Defaults to to same as source path.
Type
Default
Required
posixPath
""
No

build.timeout

​build > timeout
Maximum time in seconds to wait for build to finish.
Type
Default
Required
number
1200
No

description

A description of the module.
Type
Required
string
No

disabled

Set this to true to disable the module. You can use this with conditional template strings to disable modules based on, for example, the current environment or other variables (e.g. disabled: \${environment.name == "prod"}). This can be handy when you only need certain modules for specific environments, e.g. only for development.
Disabling a module means that any services, tasks and tests contained in it will not be deployed or run. It also means that the module is not built unless it is declared as a build dependency by another enabled module (in which case building this module is necessary for the dependant to be built).
If you disable the module, and its services, tasks or tests are referenced as runtime dependencies, Garden will automatically ignore those dependency declarations. Note however that template strings referencing the module's service or task outputs (i.e. runtime outputs) will fail to resolve when the module is disabled, so you need to make sure to provide alternate values for those if you're using them, using conditional expressions.
Type
Default
Required
boolean
false
No

include[]

Specify a list of POSIX-style paths or globs that should be regarded as the source files for this module. Files that do not match these paths or globs are excluded when computing the version of the module, when responding to filesystem watch events, and when staging builds.
Note that you can also exclude files using the exclude field or by placing .gardenignore files in your source tree, which use the same format as .gitignore files. See the Configuration Files guide for details.
Also note that specifying an empty list here means no sources should be included.
If neither include nor exclude is set, and the module has local chart sources, Garden automatically sets include to: ["*", "charts/**/*", "templates/**/*"].
If neither include nor exclude is set and the module specifies a remote chart, Garden automatically sets Γ¬nclude to [].
Type
Required
array[posixPath]
No
Example:
1
include:
2
- Dockerfile
3
- my-app.js
Copied!

exclude[]

Specify a list of POSIX-style paths or glob patterns that should be excluded from the module. Files that match these paths or globs are excluded when computing the version of the module, when responding to filesystem watch events, and when staging builds.
Note that you can also explicitly include files using the include field. If you also specify the include field, the files/patterns specified here are filtered from the files matched by include. See the Configuration Files guide for details.
Unlike the modules.exclude field in the project config, the filters here have no effect on which files and directories are watched for changes. Use the project modules.exclude field to affect those, if you have large directories that should not be watched for changes.
Type
Required
array[posixPath]
No
Example:
1
exclude:
2
- tmp/**/*
3
- '*.log'
Copied!

repositoryUrl

A remote repository URL. Currently only supports git servers. Must contain a hash suffix pointing to a specific branch or tag, with the format: #<branch|tag>
Garden will import the repository source code into this module, but read the module's config from the local garden.yml file.
Type
Required
`gitUrl
string`
Example:
1
repositoryUrl: "git+https://github.com/org/repo.git#v2.0"
Copied!

allowPublish

When false, disables pushing this module to remote registries.
Type
Default
Required
boolean
true
No

generateFiles[]

A list of files to write to the module directory when resolving this module. This is useful to automatically generate (and template) any supporting files needed for the module.
Type
Default
Required
array[object]
[]
No

generateFiles[].sourcePath

​generateFiles > sourcePath
POSIX-style filename to read the source file contents from, relative to the path of the module (or the ModuleTemplate configuration file if one is being applied). This file may contain template strings, much like any other field in the configuration.
Type
Required
posixPath
No

generateFiles[].targetPath

​generateFiles > targetPath
POSIX-style filename to write the resolved file contents to, relative to the path of the module source directory (for remote modules this means the root of the module repository, otherwise the directory of the module configuration).
Note that any existing file with the same name will be overwritten. If the path contains one or more directories, they will be automatically created if missing.
Type
Required
posixPath
Yes

generateFiles[].resolveTemplates

​generateFiles > resolveTemplates
By default, Garden will attempt to resolve any Garden template strings in source files. Set this to false to skip resolving template strings. Note that this does not apply when setting the value field, since that's resolved earlier when parsing the configuration.
Type
Default
Required
boolean
true
No

generateFiles[].value

​generateFiles > value
The desired file contents as a string.
Type
Required
string
No

variables

A map of variables scoped to this particular module. These are resolved before any other parts of the module configuration and take precedence over project-scoped variables. They may reference project-scoped variables, and generally use any template strings normally allowed when resolving modules.
Type
Required
object
No

varfile

Specify a path (relative to the module root) to a file containing variables, that we apply on top of the module-level variables field.
The format of the files is determined by the configured file's extension:
  • .env - Standard "dotenv" format, as defined by dotenv.
  • .yaml/.yml - YAML. The file must consist of a YAML document, which must be a map (dictionary). Keys may contain any value type.
  • .json - JSON. Must contain a single JSON object (not an array).
NOTE: The default varfile format will change to YAML in Garden v0.13, since YAML allows for definition of nested objects and arrays.
To use different module-level varfiles in different environments, you can template in the environment name to the varfile name, e.g. varfile: "my-module.\$\{environment.name\}.env (this assumes that the corresponding varfiles exist).
Type
Required
posixPath
No
Example:
1
varfile: "my-module.env"
Copied!

atomicInstall

Whether to set the --atomic flag during installs and upgrades. Set to false if e.g. you want to see more information about failures and then manually roll back, instead of having Helm do it automatically on failure.
Type
Default
Required
boolean
true
No

base

The name of another helm module to use as a base for this one. Use this to re-use a Helm chart across multiple services. For example, you might have an organization-wide base chart for certain types of services. If set, this module will by default inherit the following properties from the base module: serviceResource, values Each of those can be overridden in this module. They will be merged with a JSON Merge Patch (RFC 7396).
Type
Required
string
No
Example:
1
base: "my-base-chart"
Copied!

chart

A valid Helm chart name or URI (same as you'd input to helm install). Required if the module doesn't contain the Helm chart itself.
Type
Required
string
No
Example:
1
chart: "ingress-nginx"
Copied!

chartPath

The path, relative to the module path, to the chart sources (i.e. where the Chart.yaml file is, if any). Not used when base is specified.
Type
Default
Required
posixPath
"."
No

dependencies[]

List of names of services that should be deployed before this chart.
Type
Default
Required
array[string]
[]
No

devMode

Specifies which files or directories to sync to which paths inside the running containers of the service when it's in dev mode, and overrides for the container command and/or arguments.
Note that serviceResource must also be specified to enable dev mode.
Dev mode is enabled when running the garden dev command, and by setting the --dev flag on the garden deploy command.
See the Code Synchronization guide for more information.
Type
Required
object
No

devMode.args[]

​devMode > args
Override the default container arguments when in dev mode.
Type
Required
array[string]
No

devMode.command[]

​devMode > command
Override the default container command (i.e. entrypoint) when in dev mode.
Type
Required
array[string]
No

devMode.sync[]

​devMode > sync
Specify one or more source files or directories to automatically sync with the running container.
Type
Required
array[object]
No

devMode.sync[].source

​devMode > sync > source
POSIX-style path of the directory to sync to the target, relative to the module's top-level directory. Must be a relative path. Defaults to the module's top-level directory if no value is provided.
Type
Default
Required
posixPath
"."
No
Example:
1
devMode:
2
...
3
sync:
4
- source: "src"
Copied!

devMode.sync[].target

​devMode > sync > target
POSIX-style absolute path to sync the directory to inside the container. The root path (i.e. "/") is not allowed.
Type
Required
posixPath
Yes
Example:
1
devMode:
2
...
3
sync:
4
- target: "/app/src"
Copied!

devMode.sync[].exclude[]

​devMode > sync > exclude
Specify a list of POSIX-style paths or glob patterns that should be excluded from the sync.
.git directories and .garden directories are always ignored.
Type
Required
array[posixPath]
No
Example:
1
devMode:
2
...
3
sync:
4
- exclude:
5
- dist/**/*
6
- '*.log'
Copied!

devMode.sync[].mode

​devMode > sync > mode
The sync mode to use for the given paths. See the Dev Mode guide for details.
Type
Allowed Values
Default
Required
string
"one-way", "one-way-safe", "one-way-replica", "one-way-reverse", "one-way-replica-reverse", "two-way", "two-way-safe", "two-way-resolved"
"one-way-safe"
Yes

devMode.sync[].defaultFileMode

​devMode > sync > defaultFileMode
The default permission bits, specified as an octal, to set on files at the sync target. Defaults to 0600 (user read/write). See the Mutagen docs for more information.
Type
Required
number
No

devMode.sync[].defaultDirectoryMode

​devMode > sync > defaultDirectoryMode
The default permission bits, specified as an octal, to set on directories at the sync target. Defaults to 0700 (user read/write). See the Mutagen docs for more information.
Type
Required
number
No

devMode.sync[].defaultOwner

​devMode > sync > defaultOwner
Set the default owner of files and directories at the target. Specify either an integer ID or a string name. See the Mutagen docs for more information.
Type
Required
`number
string`

devMode.sync[].defaultGroup

​devMode > sync > defaultGroup
Set the default group on files and directories at the target. Specify either an integer ID or a string name. See the Mutagen docs for more information.
Type
Required
`number
string`

devMode.containerName

​devMode > containerName
Optionally specify the name of a specific container to sync to. If not specified, the first container in the workload is used.
Type
Required
string
No

namespace

A valid Kubernetes namespace name. Must be a valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must start with a letter, and cannot end with a dash) and must not be longer than 63 characters.
Type
Required
string
No

portForwards[]

Manually specify port forwards that Garden should set up when deploying in dev or watch mode. If specified, these override the auto-detection of forwardable ports, so you'll need to specify the full list of port forwards to create.
Type
Required
array[object]
No

portForwards[].name

​portForwards > name
An identifier to describe the port forward.
Type
Required
string
No

portForwards[].resource

​portForwards > resource
The full resource kind and name to forward to, e.g. Service/my-service or Deployment/my-deployment. Note that Garden will not validate this ahead of attempting to start the port forward, so you need to make sure this is correctly set. The types of resources supported will match that of the kubectl port-forward CLI command.
Type
Required
string
Yes

portForwards[].targetPort

​portForwards > targetPort
The port number on the remote resource to forward to.
Type
Required
number
Yes

portForwards[].localPort

​portForwards > localPort
The preferred local port to forward from. If none is set, a random port is chosen. If the specified port is not available, a warning is shown and a random port chosen instead.
Type
Required
number
No

releaseName

Optionally override the release name used when installing (defaults to the module name).
Type
Required
string
No

repo

The repository URL to fetch the chart from.
Type
Required
string
No

serviceResource

The Deployment, DaemonSet or StatefulSet or Pod that Garden should regard as the Garden service in this module (not to be confused with Kubernetes Service resources).
This can either reference a workload (i.e. a Deployment, DaemonSet or StatefulSet) via the kind and name fields, or a Pod via the podSelector field.
Because a Helm chart can contain any number of Kubernetes resources, this needs to be specified for certain Garden features and commands to work, such as hot-reloading.
Type
Required
object
No

serviceResource.kind

​serviceResource > kind
The type of Kubernetes resource to sync files to.
Type
Allowed Values
Default
Required
string
"Deployment", "DaemonSet", "StatefulSet"
"Deployment"
Yes

serviceResource.containerName

​serviceResource > containerName
The name of a container in the target. Specify this if the target contains more than one container and the main container is not the first container in the spec.
Type
Required
string
No

serviceResource.podSelector

​serviceResource > podSelector
A map of string key/value labels to match on any Pods in the namespace. When specified, a random ready Pod with matching labels will be picked as a target, so make sure the labels will always match a specific Pod type.
Type
Required
object
No

serviceResource.name

​serviceResource > name
The name of the resource to sync to. If the chart contains a single resource of the specified Kind, this can be omitted.
This can include a Helm template string, e.g. '{{ template "my-chart.fullname" . }}'. This allows you to easily match the dynamic names given by Helm. In most cases you should copy this directly from the template in question in order to match it. Note that you may need to add single quotes around the string for the YAML to be parsed correctly.
Type
Required
string
No

serviceResource.containerModule

​serviceResource > containerModule
The Garden module that contains the sources for the container. This needs to be specified under serviceResource in order to enable hot-reloading and dev mode, but is not necessary for tasks and tests.
Must be a container module, and for hot-reloading to work you must specify the hotReload field on the container module (not required for dev mode).
Note: If you specify a module here, you don't need to specify it additionally under build.dependencies.
Type
Required
string
No
Example:
1
serviceResource:
2
...
3
containerModule: "my-container-module"
Copied!

serviceResource.hotReloadArgs[]

​serviceResource > hotReloadArgs
If specified, overrides the arguments for the main container when running in hot-reload mode.
Type
Required
array[string]
No
Example:
1
serviceResource:
2
...
3
hotReloadArgs:
4
- nodemon
5
- my-server.js
Copied!

skipDeploy

Set this to true if the chart should only be built, but not deployed as a service. Use this, for example, if the chart should only be used as a base for other modules.
Type
Default
Required
boolean
false
No

tasks[]

The task definitions for this module.
Type
Default
Required
array[object]
[]
No

tasks[].name

​tasks > name
The name of the task.
Type
Required
string
Yes

tasks[].description

​tasks > description
A description of the task.
Type
Required
string
No

tasks[].dependencies[]

​tasks > dependencies
The names of any tasks that must be executed, and the names of any services that must be running, before this task is executed.
Type
Default
Required
array[string]
[]
No

tasks[].disabled

​tasks > disabled
Set this to true to disable the task. You can use this with conditional template strings to enable/disable tasks based on, for example, the current environment or other variables (e.g. enabled: \${environment.name != "prod"}). This can be handy when you only want certain tasks to run in specific environments, e.g. only for development.
Disabling a task means that it will not be run, and will also be ignored if it is declared as a runtime dependency for another service, test or task.
Note however that template strings referencing the task's outputs (i.e. runtime outputs) will fail to resolve when the task is disabled, so you need to make sure to provide alternate values for those if you're using them, using conditional expressions.
Type
Default
Required
boolean
false
No

tasks[].timeout

​