2019-08-26 11:09:54 +00:00
|
|
|
---
|
2020-02-06 23:45:31 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: volume_mount Stanza - Job Specification
|
|
|
|
sidebar_title: volume_mount
|
2019-08-26 11:09:54 +00:00
|
|
|
description: |-
|
2020-02-06 23:45:31 +00:00
|
|
|
The "volume_mount" stanza allows the task to specify where a group "volume"
|
|
|
|
should be mounted.
|
2019-08-26 11:09:54 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# `volume_mount` Stanza
|
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
<Placement groups={['job', 'group', 'task', 'volume_mount']} />
|
2019-08-26 11:09:54 +00:00
|
|
|
|
2019-09-12 20:13:04 +00:00
|
|
|
The `volume_mount` stanza allows the task to specify how a group
|
|
|
|
[`volume`][volume] should be mounted into the task.
|
2019-08-26 11:09:54 +00:00
|
|
|
|
|
|
|
```hcl
|
|
|
|
job "docs" {
|
|
|
|
group "example" {
|
|
|
|
volume "certs" {
|
|
|
|
type = "host"
|
|
|
|
read_only = true
|
2019-10-23 19:28:53 +00:00
|
|
|
source = "ca-certificates"
|
2019-08-26 11:09:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
task "example" {
|
|
|
|
volume_mount {
|
2019-09-12 20:08:18 +00:00
|
|
|
volume = "certs"
|
2019-08-26 11:09:54 +00:00
|
|
|
destination = "/etc/ssl/certs"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
The Nomad client will make the volumes available to tasks according to this
|
2019-08-28 18:09:42 +00:00
|
|
|
configuration, and it will fail the allocation if the client configuration
|
|
|
|
updates to remove a volume that it depends on.
|
2019-08-26 11:09:54 +00:00
|
|
|
|
|
|
|
## `volume_mount` Parameters
|
|
|
|
|
2019-09-12 20:08:18 +00:00
|
|
|
- `volume` `(string: "")` - Specifies the group volume that the mount is going
|
2019-08-26 11:09:54 +00:00
|
|
|
to access.
|
|
|
|
|
|
|
|
- `destination` `(string: "")` - Specifies where the volume should be mounted
|
2020-05-08 15:14:16 +00:00
|
|
|
inside the task's allocation.
|
2019-08-26 11:09:54 +00:00
|
|
|
|
|
|
|
- `read_only` `(bool: false)` - When a group volume is writeable, you may
|
2019-09-12 20:13:04 +00:00
|
|
|
specify that it is `read_only` on a per mount level using the `read_only`
|
|
|
|
option here.
|
2019-08-26 11:09:54 +00:00
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
[volume]: /docs/job-specification/volume 'Nomad volume Job Specification'
|