Skip to content

Commit 3acb983

Browse files
weltekialexellis
authored andcommitted
Add instructions for ZFS storage
Add instructions for installing actuated with ZFS storage for VMs. Update the installation page to use tabs to make a clear distinction between different installation and configuration options. Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent 58d50df commit 3acb983

File tree

2 files changed

+101
-44
lines changed

2 files changed

+101
-44
lines changed

docs/install-agent.md

Lines changed: 98 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ If you missed it in the "Provision a Server" page, we recommend you use Ubuntu 2
4646
> Setting up an ARM64 agent? Wherever you see `agent` in a command, change it to: `agent-arm64`. So instead of `agent keygen` you'd run `agent-arm64 keygen`.
4747
4848
Install [arkade](https://github.com/alexellis/arkade) using the command below, or download it from the [releases page](https://github.com/alexellis/arkade/releases).
49-
49+
5050
Download the latest agent and install the binary to `/usr/local/bin/`:
5151
5252
```bash
@@ -65,21 +65,47 @@ If you missed it in the "Provision a Server" page, we recommend you use Ubuntu 2
6565
6666
**For best performance**, a dedicated drive, volume or partition is required to store the filesystems for running VMs. If you do not have a volume or extra drive attached, then you can shrink the root partition, and use the resulting free space.
6767
68-
```bash
69-
(
70-
cd agent
71-
VM_DEV=/dev/nvme0n2 sudo -E ./install.sh
72-
)
73-
```
68+
Two storage backends are supported. By default the agent uses device mapper. Alternatively the agent can use ZFS volumes within a ZFS pool.
7469
75-
If you do not have additional storage available at this time, the installer will generate a loopback filesystem for you.
70+
=== "Devmapper (recommended)"
7671
77-
```bash
78-
(
79-
cd agent
80-
sudo -E ./install.sh
81-
)
82-
```
72+
```bash
73+
(
74+
cd agent
75+
VM_DEV=/dev/nvme0n2 sudo -E ./install.sh
76+
)
77+
```
78+
79+
If you do not have additional storage available at this time you can omit the `VM_DEV` variable and the installer will generate a loopback filesystem for you.
80+
81+
```bash
82+
(
83+
cd agent
84+
sudo -E ./install.sh
85+
)
86+
```
87+
88+
=== "ZFS"
89+
90+
```bash
91+
(
92+
cd agent
93+
VM_DEV=/dev/nvme0n2 STORAGE=zfs sudo -E ./install.sh
94+
)
95+
```
96+
97+
The install script will create a ZFS pool and dataset for you. If you want to manually setup ZFS or use an existing ZFS pool or dataset see [ZFS Configuration](#installation-options).
98+
99+
If you do not have additional storage available at this time you can omit the `VM_DEV` variable and the installer will generate a loopback filesystem for you.
100+
101+
```bash
102+
(
103+
cd agent
104+
STORAGE=zfs sudo -E ./install.sh
105+
)
106+
```
107+
108+
The disk space allocated to job runners can be configured by setting the `BASE_SIZE` environment variable. The default is `30GB`.
83109
84110
3. Generate your enrollment file
85111
@@ -107,54 +133,66 @@ If you missed it in the "Provision a Server" page, we recommend you use Ubuntu 2
107133

108134
Any bootstrap tokens sent to the agent are further encrypted with the agent's public key.
109135
110-
For hosts with public IPs, you will need to use the built-in TLS provisioning with Let's Encrypt. For hosts behind a firewall, NAT or in a private datacenter, you can use inlets to create a secure tunnel to the agent.
136+
For hosts with public IPs, you will need to use the built-in TLS provisioning with Let's Encrypt. For hosts behind a firewall, NAT or in a private datacenter, you can [use inlets](/expose-agent/) to create a secure tunnel to the agent.
111137

112138
We're considering other models for after the pilot, for instance GitHub's own API has the runner make an outbound connection and uses long-polling.
113139

114-
These steps are for hosts with public IP addresses, if you want to [use inlets](/expose-agent/), jump to the end of this step.
140+
=== "Expose the agent on the Internet with HTTPS"
115141

116-
The easiest way to configure everything is to run as root. The --user flag can be used to run under a custom user account, however sudo access is still required for actuated.
142+
The easiest way to configure everything is to run as root. The --user flag can be used to run under a custom user account, however sudo access is still required for actuated.
117143

118-
For an *x86_64* server, run:
144+
For an *x86_64* server, run:
119145

120-
```bash
121-
DOMAIN=agent1.example.com
146+
```bash
147+
DOMAIN=agent1.example.com
148+
# Replace with "zfs" if you opted for ZFS storage in the installation script.
149+
STORAGE=devmapper
122150
123-
sudo -E agent install-service \
124-
--letsencrypt-domain $DOMAIN \
125-
--letsencrypt-email webmaster@$DOMAIN
126-
```
151+
sudo -E agent install-service \
152+
--letsencrypt-domain $DOMAIN \
153+
--letsencrypt-email webmaster@$DOMAIN \
154+
--storage $STORAGE
155+
```
127156

128-
For an *Arm* server, run:
157+
For an *Arm* server, run:
129158

130-
```bash
131-
DOMAIN=agent1.example.com
159+
```bash
160+
DOMAIN=agent1.example.com
161+
# Replace with "zfs" if you opted for ZFS storage in the installation script.
162+
STORAGE=devmapper
132163
133-
sudo -E agent-arm64 install-service \
134-
--letsencrypt-domain $DOMAIN \
135-
--letsencrypt-email webmaster@$DOMAIN
136-
```
137-
138-
> Note the different binary name: `agent-arm64`
164+
sudo -E agent-arm64 install-service \
165+
--letsencrypt-domain $DOMAIN \
166+
--letsencrypt-email webmaster@$DOMAIN \
167+
--storage $STORAGE
168+
```
169+
170+
> Note the different binary name: `agent-arm64`
171+
172+
=== "Run the agent from a private network"
173+
174+
For an Actuated Agent behind an [inlets tunnel](https://inlets.dev), do not include the `--letsencrypt-*` flags, and instead add `--listen-addr "127.0.0.1:"`. See [expose the agent with HTTPS](/expose-agent/) for instructions on how the setup inlets.
175+
176+
The easiest way to configure everything is to run as root. The --user flag can be used to run under a custom user account, however sudo access is still required for actuated
177+
178+
```bash
179+
# Replace with "zfs" if you opted for ZFS storage in the installation script.
180+
STORAGE=devmapper
181+
182+
sudo -E agent install-service \
183+
--listen-addr "127.0.0.1:" \
184+
--storage $STORAGE
185+
```
139186

140187
If you need to make changes you can run the command again, or edit `/etc/default/actuated`.
141188

142189
Check the service's status with:
143-
190+
144191
```bash
145192
sudo systemctl status actuated
146193
sudo journalctl -u actuated --since today -f
147194
```
148195
149-
For an Actuated Agent behind a firewall, or on a private network, do not include the `--letsencrypt-*` flags, and instead add `--listen-addr "127.0.0.1:"`. Then read [expose the agent with HTTPS](/expose-agent/) for details on our private peering option or how to setup an [inlets tunnel](https://inlets.dev/).
150-
151-
For example (with inlets):
152-
153-
```bash
154-
sudo -E agent install-service \
155-
--listen-addr "127.0.0.1:"
156-
```
157-
158196
5. Check that the control-plane is accessible
159197
160198
```bash
@@ -171,6 +209,23 @@ If you missed it in the "Provision a Server" page, we recommend you use Ubuntu 2
171209
172210
Once you've run our test build, you need to run the steps for systemd mentioned above.
173211

212+
### Installation options
213+
214+
215+
216+
| ENV | Description | Default |
217+
| --- | ----------- | ------- |
218+
| ZPOOL | Name of the ZFS pool to use or create for ZFS storage. | `actuated_zpool` |
219+
| ZFS_DATASET | Name of the ZFS dataset to use or create for ZFS . | `${ZPOOL}/snapshots}` |
220+
221+
The install script will automatically try to create a ZFS pool and dataset if you have opted for ZFS storage in the installation script and they do not already exist.
222+
223+
If you have an existing pool or dataset that you want to use or if you want to create them manually you can configure the script to use them
224+
225+
```sh
226+
STORAGE=zfs ZPOOL=mypool ZFS_DATASET=mypool/actuated sudo ./install.sh
227+
```
228+
174229
## Next steps
175230

176231
You can now start your first build and see it run on your actuated agent.

mkdocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ extra:
5353

5454
plugins:
5555
- search
56-
56+
5757
markdown_extensions:
5858
- attr_list
5959
- tables
@@ -81,6 +81,8 @@ markdown_extensions:
8181
- pymdownx.mark
8282
- pymdownx.smartsymbols
8383
- pymdownx.superfences
84+
- pymdownx.tabbed:
85+
alternate_style: true
8486
- pymdownx.tasklist:
8587
custom_checkbox: true
8688
- pymdownx.tilde

0 commit comments

Comments
 (0)