Running acd-deploy
Page not available in that version
The current page Running acd-deploy doesn't exist in version 1.6.2 of the documentation for this product.
Overview
acd-deploy is on the installation ISO, at its root, for example /mnt/esb3027/acd-deploy. Run it as root on the first server in the inventory, from the mounted ISO. It reaches every other machine over SSH. For its commands, options, files and exit status, see the acd-deploy reference.
You can drive it two ways, on the same files in /etc/acd/deploy:
- The terminal interface: run
acd-deploywith no arguments, in a terminal. It shows your machines and settings, marks every problem on the setting at fault, and applies your changes only after you confirm. - Commands:
acd-deploy init,plan,applyandbackup, for scripts and for editing the files by hand. They never prompt.
Editing the files by hand keeps working either way. To change what is installed, change the configuration and apply it. Do not change the release with helm directly: the next run replaces it with what the configuration says.
The Terminal Interface
/mnt/esb3027/acd-deploy
For a walkthrough with screenshots, see Using the Terminal Interface.
On opening, acd-deploy asks the servers which release the cluster runs, which takes a few seconds. It works out the task from the answer: a first install, a reconfigure of the same release, or an upgrade to the ISO’s newer release. On a first launch it changes nothing on disk: creating the configuration folder is the first step of the first apply.
The header shows:
- Config: the configuration folder, and badges such as
DRY RUN, orREAD-ONLYwhen anotheracd-deploysession is already editing this configuration. - Task: the task, and the next step, such as
fix 2 errors on Inventoryorreview the plan and apply on Apply. - Run: the run in progress, when there is one.
The tabs, along the bottom, are in the order you need them. Each shows its error count, or its warning count when it has no errors, and a ● when your draft changes it. The Apply tab counts the problems of every tab and lists each, with a few words on how to fix it.
| Tab | What it holds |
|---|---|
| Inventory | The machines in one pane, and the CDN Directors listed in external_directors in the other. Each machine shows whether acd-deploy can log in to it: key ok, password only, login denied or unreachable. Anything but key ok blocks the apply, because the run logs in without a password. The number of servers must be odd. See Inventory. |
| Settings | The environment (production or lab preset), the cluster address and other names, the backplane network, the MaxMind databases, and the TLS certificate and key. The certificate is checked against the cluster address here, before any run. See Site Settings. |
| Helm values | Every application setting, with where its value comes from: the chart, the preset, your override, or set by the deployment and locked. Only your overrides are written to values.override.yaml. A value of the wrong type is rejected as you enter it. See Application Settings. |
| Apply | The plan: the steps of a first install or an upgrade, every file it writes with the changes, then the errors, warnings and notes, and the playbook command it runs. |
| Backup | The backups, with a per-machine restore, a delete, and the PostgreSQL dump. See Backups and Restores. |
| Run | The run in progress, or the last run: its progress and output, in four views. Runs start from Apply and Backup. |
Switch tabs with Shift-H and Shift-L, or with < and >, which a footer under the tabs names on every tab. Jump straight to a tab with 1 to 6. Tab and Shift-Tab move between the panes of a tab, such as the machines and the CDN Directors on Inventory, and between the fields of a form. Press ? anywhere for every key that works where you are. The keys that matter most:
| Key | Action |
|---|---|
Shift-H Shift-L, or < > | Switch to the previous or next tab |
1 to 6 | Jump to a tab: Inventory, Settings, Helm values, Apply, Backup, Run. In a text box they are letters, and while a machine’s form is open, which takes every key, leave it with Esc first. |
Tab Shift-Tab | Move to the next or previous pane, or field in a form |
h j k l or the arrow keys | Move inside a pane, never to another; the same everywhere except in a text box, where only the arrows move |
Ctrl-D Ctrl-U, or J K | Scroll a page down or up, in a view that scrolls: the plan on Apply, a run’s output, and the help. Page Up and Page Down do the same where your terminal passes them through, and Home and End jump to the oldest and newest line of a run’s output. |
⏎ | Edit or open the selected row |
A | On the Apply tab, apply |
a | Add |
d | Delete; on the Apply tab, discard the draft, after asking |
U | On the Apply tab, uninstall the cluster so that you can install again. It uninstalls k3s from every machine and deletes every volume, the PostgreSQL databases too, and cannot be undone. The configuration and the backups stay. It asks you to type the cluster address first. |
/ | Filter, on the Inventory, Helm values and Backup tabs |
Esc | Back, or cancel |
y, n | Answer a confirmation. ⏎ never confirms. |
q | Quit. During a run it asks first; the run goes on without you. |
On the Inventory tab, s opens an SSH session on the selected machine and returns to the interface when you leave it, p pings it, and S installs your SSH key on a machine that accepts only a password: see Setting Up SSH Keys. v in a machine’s form shows its more advanced settings.
Colors
The interface uses your terminal’s colors and never relies on color alone: errors, warnings and the selected row also have their own symbols and styles. Set NO_COLOR to any non-empty value to turn color off, on every tab, including the output of a run:
NO_COLOR=1 /mnt/esb3027/acd-deploy
Changes, the Draft and Apply
Your changes go into a draft, kept on disk and readable only by root, so quitting or a lost connection keeps them. Nothing in /etc/acd/deploy changes until you apply. A confirmation that says Takes effect now, not through Apply marks the few actions that act at once: installing an SSH key, changing the environment, and everything on the Backup tab.
On the Apply tab, A opens the confirmation, unless an error is listed: errors block it, warnings do not. It says how many changes in how many files it will write, then runs the playbook; the plan above it lists the files and the command. On y, acd-deploy writes every changed file, or none if one cannot be written, and starts the run.
If a file in the draft was also changed outside acd-deploy, the Apply tab says so, and o shows the difference. There, o keeps your change, f takes the file as it is on disk, and d discards the whole draft. Esc decides later. acd-deploy checks again just before it writes, and refuses to overwrite a file changed since you confirmed. A draft from another release is discarded when acd-deploy opens, with a notice.
Following a Run
The run shows on the Run tab, which the interface switches to when the run starts. A run takes a while, depending on what it does: a typical install of a three-node cluster takes about 30 minutes, so wait for it to end before you use the cluster. The other tabs stay usable. Switch between the run’s views with [ and ]:
- Output: the run’s output, which also goes to
deploy.log. - Diagnostics: the failed steps, opened at the failing step when a run fails.
- Changes: what the run changed on each machine.
- Recap: every command
acd-deployran and every file it wrote in this session. It never shows a password. It is saved after every run in/etc/acd/deploy/recaps/;ssaves a copy elsewhere.
x asks, then stops the run before its next step. After the run ends, R runs it again, for example after you fix the cause of a failure.
Commands for Scripts
/mnt/esb3027/acd-deploy init prod # once, on the first server
/mnt/esb3027/acd-deploy plan # check the configuration and see what a run would do
/mnt/esb3027/acd-deploy apply # run it
init installs Ansible and creates /etc/acd/deploy with commented examples. Edit the files there, then run plan: it prints the same errors, warnings and notes the terminal interface shows, each with the setting at fault and how to fix it, and exits with status 1 when an error would make the run fail. apply runs the deployment. It does not run plan’s checks itself: the run’s own preflight stage checks the machines and settings before changing anything. See the acd-deploy reference.
What a Run Does
The first run installs; every later run re-applies your settings and changes only what differs. Running it again is safe, including after a failed run. A run checks each machine after changing its network, and on a running cluster changes them one at a time, but a wrong network setting can still cut a machine off, and the run then stops with [ACD-NODE-UNREACHABLE].
Each run goes through fixed stages:
| Stage | What it does | Changes anything? |
|---|---|---|
| Gather inputs | Reads every machine and works out the settings | No |
| Preflight | Checks the machines, the settings and, on a running cluster, the locked settings | No |
| Backup | Archives each machine’s configuration on the first server | Writes the backup only |
| Media | Copies what the other machines need from the ISO | Yes |
| Values | Writes values.yaml | Yes |
| Host network | Configures firewall zones, routing rules and kernel network settings, then verifies them | Yes |
| Cluster | Installs or upgrades k3s: the first server, then the other servers one at a time, then the agents | Yes |
| Platform | Installs or upgrades the cdn-platform release, loads the MaxMind databases, and runs the health check | Yes |
acd-deploy backup runs only the first and third stages. acd-deploy restore --postgres is not part of a run: see PostgreSQL Restore. --skip-tags preflight skips the second; use it only when you are sure a check is wrong for your site.
When a run stops on a problem it recognizes, its message starts with a code such as [ACD-TLS-HOSTNAME]. See Installation Troubleshooting.
Runs Survive a Lost Connection
A run continues on the first server as a system service, acd-deploy-run, so a dropped SSH session or a closed terminal does not stop it. Only one run goes at a time: another apply or backup refuses to start while one runs.
To follow the run again, log in to the first server and either open the terminal interface, which offers to follow the run it finds, or run:
/mnt/esb3027/acd-deploy apply --attach
It shows the run’s output from the start and exits with the run’s status. To stop a run, press Ctrl-C while following it, or x in the terminal interface: the run stops before its next step, and a step already running on a machine finishes there. A stopped run is safe to start again.
Dry Runs
/mnt/esb3027/acd-deploy apply --dry-run
A dry run runs only the gather-inputs, preflight and render-values stages, against a temporary copy of the configuration, and prints the values.yaml the cluster would receive. It changes nothing: not the configuration folder, not any machine, and it takes no backup. Use it to see whether the preflight checks pass, and what the Helm values would be, before a change. It exits with the playbook’s status.
Started with acd-deploy --dry-run, the terminal interface shows a DRY RUN badge, and the Apply tab’s confirmation dry runs your draft against a copy, leaving the draft in place. To apply for real from there, press r, Run for real, in the confirmation. It is off each time the confirmation opens.
What to Send Support
When the final health check fails, a run writes /etc/acd/deploy/support-bundle-acd.tar.gz: send it to AgileTV support. When a run stops before the health check, send deploy.log, decision-record.json and the probe/ folder from /etc/acd/deploy instead, and, if you used the terminal interface, the latest file in recaps/.