Skip to content

Commit b8d08b7

Browse files
LukeButtersclaude
andcommitted
Fix markdownlint violations in machine-policies.mdx
CI lints the full content of any touched file, not just the diff, so this pre-existing lint debt (missing blank lines around headings/lists/ fences, missing image alt text, bold-as-heading, hard tabs, trailing whitespace, a stale link fragment) was blocking this PR. Converts bold pseudo-headings to real headings and adds descriptive alt text to images based on surrounding context. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 554b460 commit b8d08b7

1 file changed

Lines changed: 55 additions & 44 deletions

File tree

src/pages/docs/infrastructure/deployment-targets/machine-policies.mdx

Lines changed: 55 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ You can access the machine policies by navigating to **Infrastructure ➜ Machin
2121
[Getting Started - Machine Policies](https://www.youtube.com/watch?v=uEjXuPttRO4)
2222

2323
## Default machine policy
24+
2425
By default, Octopus Deploy comes with a default configured machine policy with the following rules:
2526
:::figure
26-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-default-policy.png)
27+
![Default machine policy settings](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-default-policy.png)
2728
:::
2829

2930
This machine policy cannot be deleted however it can be edited and any new deployment targets without an explicitly assigned machine policy will use the default one. Other machine policies will also inherit the bash/powershell scripts used for health checking from the default policy unless they have one explicitly set.
@@ -44,13 +45,12 @@ A *healthy* deployment target completes a health check without any errors or war
4445
You can review the health status of you deployment targets by navigating to **Infrastructure ➜ Deployment Targets**.
4546

4647
:::figure
47-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-deployment-target-overview.png)
48+
![Deployment targets overview showing health status](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-deployment-target-overview.png)
4849
:::
4950

50-
5151
### Health check step
5252

53-
It's also possible to run a health check as part of a deployment or runbook using the built-in [health check step](/docs/projects/built-in-step-templates/health-check).
53+
It's also possible to run a health check as part of a deployment or runbook using the built-in [health check step](/docs/projects/built-in-step-templates/health-check).
5454

5555
This step allows a deployment target that was created in the currently executing deployment to be confirmed as healthy and then added to the running deployment for subsequent steps.
5656

@@ -64,15 +64,16 @@ After creating a new Tentacle or SSH Target, Octopus Deploy will automatically s
6464
2. Click the ... overflow menu and select **Check Health**. If you have multiple deployment targets that support health checking it will start health checks for each of them.
6565

6666
:::figure
67-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-check-health.png)
67+
![Check Health option in the deployment targets overflow menu](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-check-health.png)
6868
:::
6969

7070
However if you would like to check the health of a single deployment target you can do the following:
71+
7172
1. Select the deployment target you would like to health check.
7273
2. Click on the **Connectivity** tab then click on the **Check Health** button on the top right of the page.
7374

7475
:::figure
75-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-deployment-target-connectivity.png)
76+
![Check Health button on the deployment target Connectivity tab](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-deployment-target-connectivity.png)
7677
:::
7778

7879
The first time you complete a health check on a Tentacle or SSH Target, you will see health warnings and that Calamari needs to be installed.
@@ -85,99 +86,106 @@ Octopus will automatically push the latest version of Calamari with your first d
8586
2. Click the ... overflow menu and select **Upgrade Calamari on Deployment Targets**.
8687

8788
:::figure
88-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-update-calamari.png)
89+
![Upgrade Calamari on Deployment Targets option in the overflow menu](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-update-calamari.png)
8990
:::
9091

9192
Like with the health check if you would rather just update Calamari on a single deployment target you can achieve this by:
93+
9294
1. Select the deployment target you would like to update Calamari on.
9395
2. Click on the **Connectivity** tab then click on the **Update Calamari** button.
9496

9597
## Health check configuration
98+
9699
### Health check schedule type
100+
97101
A health check can be scheduled in the following ways:
98102

99-
**Never**
103+
#### Never
100104

101105
No automatic health checks will be scheduled, when this option is selected. Manual health checks can still be run when desired.
102106
:::figure
103-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-never.png)
107+
![Health check schedule set to Never](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-never.png)
104108
:::
105109

106-
**Interval**
110+
#### Interval
107111

108112
A health check will be scheduled after every X duration(X = days/hours/minutes)
109113
:::figure
110-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-interval.png)
114+
![Health check schedule set to Interval](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-interval.png)
111115
:::
112116

113-
**Cron expression**
117+
#### Cron expression
114118

115119
A health check will be scheduled in accordance to the valid cron expression. You can also choose the timezone the cron expression should adhere to.
116120
:::figure
117-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-cron.png)
121+
![Health check schedule set to Cron expression](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-cron.png)
118122
:::
119123

120124
### Health check type
125+
121126
You can configure health checks to run scripts on Tentacle or SSH deployment targets, or just check that a connection can be established with the Tentacle or SSH deployment targets.
122127

123-
**Run health check script**
128+
#### Run health check script
124129

125130
Machine policies allow the configuration of custom health check scripts for Tentacle and SSH deployment targets. While we do not expose the full underlying script that runs during health checks, we give you an entry point to inject your own custom scripts.
126131
:::figure
127-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-type-script.png)
132+
![Health check type set to Run health check scripts](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-type-script.png)
128133
:::
129-
By default, machine policies will inherit the script from the default machine policy if one has not been defined. For more details on providing a custom script see the section [Custom health check script](#custom-health-check-script)
134+
By default, machine policies will inherit the script from the default machine policy if one has not been defined. For more details on providing a custom script see the section [Custom health check script](#custom-health-check-scripts)
130135

131-
**Connection test**
136+
#### Connection test
132137

133138
The health check will only perform a basic connection test to see if the deployment target is reachable. This option is recommended if you are using the raw scripting feature.
134139
:::figure
135-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-type-connection.png)
140+
![Health check type set to Only perform connection test](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-health-check-type-connection.png)
136141
:::
137142

138143
### Machine behavior during health checks
144+
139145
This setting controls what the expected behavior of machines should be during a health check.
140146

141-
**Unavailable causes health checks to fail**
147+
#### Unavailable causes health checks to fail
142148

143149
If a machine is unavailable during an attempted health check it will cause the check to be failed.
144150
:::figure
145-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-health-check-default.png)
151+
![Unavailable deployment targets causing health checks to fail](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-health-check-default.png)
146152
:::
147153

148-
**Ignore machines that are unavailable during health checks**
154+
#### Ignore machines that are unavailable during health checks
149155

150156
By default, health checks fail if any deployment targets are unavailable during the health check. Machine policies offer an option to ignore machines if they are unavailable during a health check:
151157

152158
:::figure
153-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-health-check-ignore.png)
159+
![Option to ignore unavailable machines during health checks](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-health-check-ignore.png)
154160
:::
155161

156162
By selecting **Unavailable machines will not cause health checks to fail,** any deployment targets that Octopus cannot contact during a health check will be skipped and the health check marked as successful. If the target is contactable but encounters an error or warning, the usual health check behavior will proceed (i.e., a warning will be reported or the health check will fail with an error).
157163

158164
### Custom health check script \{#custom-health-check-scripts}
165+
159166
When the selected health check type is "Run health check scripts" you can provide script(s) that will execute during the health check.
160167

161-
**Default PowerShell health check script**
168+
#### Default PowerShell health check script
162169

163170
Here is the default custom health check script for PowerShell that checks disk space:
164171

165172
```powershell
166173
$freeDiskSpaceThreshold = 5GB
167174
Try {
168-
Get-WmiObject win32_LogicalDisk -ErrorAction Stop | ? { ($_.DriveType -eq 3) -and ($_.FreeSpace -ne $null)} | % { CheckDriveCapacity @{Name =$_.DeviceId; FreeSpace=$_.FreeSpace} }
175+
Get-WmiObject win32_LogicalDisk -ErrorAction Stop | ? { ($_.DriveType -eq 3) -and ($_.FreeSpace -ne $null)} | % { CheckDriveCapacity @{Name =$_.DeviceId; FreeSpace=$_.FreeSpace} }
169176
} Catch [System.Runtime.InteropServices.COMException] {
170-
Get-WmiObject win32_Volume | ? { ($_.DriveType -eq 3) -and ($_.FreeSpace -ne $null) -and ($_.DriveLetter -ne $null)} | % { CheckDriveCapacity @{Name =$_.DriveLetter; FreeSpace=$_.FreeSpace} }
171-
Get-WmiObject Win32_MappedLogicalDisk | ? { ($_.FreeSpace -ne $null) -and ($_.DeviceId -ne $null)} | % { CheckDriveCapacity @{Name =$_.DeviceId; FreeSpace=$_.FreeSpace} }
177+
Get-WmiObject win32_Volume | ? { ($_.DriveType -eq 3) -and ($_.FreeSpace -ne $null) -and ($_.DriveLetter -ne $null)} | % { CheckDriveCapacity @{Name =$_.DriveLetter; FreeSpace=$_.FreeSpace} }
178+
Get-WmiObject Win32_MappedLogicalDisk | ? { ($_.FreeSpace -ne $null) -and ($_.DeviceId -ne $null)} | % { CheckDriveCapacity @{Name =$_.DeviceId; FreeSpace=$_.FreeSpace} }
172179
}
173180
```
181+
174182
The function *CheckDriveCapacity* informs you about how much space is available on your deployment target's local hard disk and will write a warning if the free disk space is less than this threshold. You can add additional PowerShell to this script to customize your health checks as you wish, modify or remove the disk space checking altogether. It's entirely up to you! Just remember, you can copy and paste the original script above *back* into your machine policy if you run into any problems and wish to get back to the default behavior.
175183

176-
**Set the status**
184+
#### Set the status
177185

178186
A health check script can set the status of a target by returning a non-zero exit code or by writing a service message during the health check. PowerShell based deployment targets can use *Write-Warning*, *Write-Error* and *Fail-HealthCheck* to convey a healthy with warnings or unhealthy status:
179187

180-
**PowerShell health check service messages**
188+
#### PowerShell health check service messages
181189

182190
```powershell
183191
# For setting a health status of Healthy with Warnings:
@@ -191,7 +199,7 @@ Bash targets do not include a disk space check by default like PowerShell target
191199

192200
Bash deployment targets can use *echo\_warning*, *echo\_error* and *fail\_healthcheck* to convey a *healthy with warnings* or *unhealthy* status:
193201

194-
**Bash Health Check Service Messages**
202+
#### Bash Health Check Service Messages
195203

196204
```bash
197205
# For setting a health status of Healthy with Warnings:
@@ -209,7 +217,7 @@ When using a custom health check script, the script execution through Calamari i
209217

210218
## Configure how Calamari, Tentacle and Kubernetes agents are updated \{#configure-machine-updates}
211219

212-
Brand new Tentacle, Kubernetes agent and SSH endpoints require the installation of Calamari to perform a deployment. Also, if Calamari is updated, the Octopus Server will push the update to Tentacle, Kubernetes agent and SSH endpoints.
220+
Brand new Tentacle, Kubernetes agent and SSH endpoints require the installation of Calamari to perform a deployment. Also, if Calamari is updated, the Octopus Server will push the update to Tentacle, Kubernetes agent and SSH endpoints.
213221
When there is a Tentacle or Kubernetes agent update, Octopus can automatically update Tentacle and Kubernetes agent endpoints. Machine policies allow the customization of when Calamari, Tentacle and Kubernetes agent updates occur.
214222

215223
:::figure
@@ -221,7 +229,7 @@ By default, Calamari will be installed or updated when a machine is involved in
221229
- the first time a machine is added to Octopus and then subsequently when it is involved in a deployment.
222230
- any time Octopus detects Calamari is out of date (after health checks for example).
223231

224-
Tentacle and Kubernetes agents can be toggled to manually or automatically update. If **Automatically** is selected, Octopus will start a task to update Tentacles and Kubernetes agents whenever Octopus detects that there is a pending Tentacle or Kubernetes agents upgrade (after health checks for example).
232+
Tentacle and Kubernetes agents can be toggled to manually or automatically update. If **Automatically** is selected, Octopus will start a task to update Tentacles and Kubernetes agents whenever Octopus detects that there is a pending Tentacle or Kubernetes agents upgrade (after health checks for example).
225233

226234
Conversely, Octopus will not automatically update Tentacle or Kubernetes agents but instead will display a prompt to begin a Tentacle and Kubernetes agents update on the Deployment Targets and Environments screens.
227235

@@ -251,30 +259,31 @@ You can configure whether Octopus Deploy should re-attempt failed communications
251259

252260
- With this setting **Enabled**, if a network error occurs, Octopus will re-attempt communication with the Tentacle for the amount of time configured. However, continued network errors will cause a failure.
253261

254-
255262
:::div{.warning}
256263
Using this setting with a Tentacle that runs on ephemeral storage will introduce the possibility that a script could run twice. For example, when running Tentacle in Docker without a mount. It is recommended to run Tentacle on a persistent file system.
257264
:::
258265

259266
### Retry durations
267+
260268
You can configure the amount of time allowed for Octopus to re-attempt failed communication with Tentacle. There are two duration configurations available:
261269

262270
- **Deployment or Runbook Run**
263-
- **Health Check**
271+
- **Health Check**
264272

265273
:::figure
266-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-tentacle-error-recovery-retry-duration.png)
274+
![Retry duration settings for deployment, runbook run and health check](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-tentacle-error-recovery-retry-duration.png)
267275
:::
268276

269277
### Step Retries and execution timeouts
278+
270279
If you would like to retry a particular step within the deployment process for other types of temporary or transient errors, that can be [configured separately](/docs/projects/steps/conditions/#retries-and-execution-timeouts).
271280

272281
## Automatically delete machines
273282

274283
Machine policies can be configured to automatically remove unavailable machines after a time period. When a health check runs, Octopus detects if machines are unavailable (cannot be contacted). When the **Automatically delete unavailable machines** option is set, Octopus checks how long a machine has been unavailable. If the specified time period has elapsed, the machine is permanently deleted from Octopus.
275284

276285
:::figure
277-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-clean-up-unavailable.png)
286+
![Automatically delete unavailable machines setting](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-clean-up-unavailable.png)
278287
:::
279288

280289
## Package cache retention policy
@@ -286,7 +295,7 @@ Configurable machine package cache retention was introduced in **Octopus 2025.3*
286295
The machine package cache retention policy ensures that packages are periodically removed from the machine cache. This is handled by Octopus by default, but can be configured per machine policy as required.
287296

288297
:::figure
289-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-package-cache-retention.png)
298+
![Package cache retention policy settings](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-package-cache-retention.png)
290299
:::
291300

292301
## Machine connectivity configuration
@@ -299,48 +308,50 @@ For Tentacles, [Retry Durations](#recover-from-communication-errors) should be u
299308

300309
Machine policies define rules for how long to wait for a connection to be established to a Tentacle or SSH target as well as how it should retry the connection if the initial attempts do not succeed.
301310
:::figure
302-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-timeout-retries.png)
311+
![Connection timeout and retry settings](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-timeout-retries.png)
303312
:::
304313

305-
**Connect timeout**
314+
#### Connect timeout
306315

307316
How long in hours/minutes/seconds to wait for a Listening Tentacle or SSH target respond to a connection before timing out. Depending on what operating system the machine is running could potentially mean the timeout is shorter than expected.
308317

309-
**Retry attempts**
318+
#### Retry attempts
310319

311320
How many times the connection to the Listening Tentacle or SSH target should be retried before failing the health check.
312321

313-
**Retry wait interval**
322+
#### Retry wait interval
314323

315324
How long to wait between connection retries.
316325

317-
**Retry time limit**
326+
#### Retry time limit
318327

319328
Maximum time limit for how long retries can be attempted for.
320329
For example, if you have the following configuration:
330+
321331
- Retry time limit: 1 minute.
322332
- Retry attempts: 4.
323333
- Retry interval: 30 seconds.
324334

325335
In this scenario only a maximum of 2 retries could be attempted before reaching the time limit.
326336

327337
### Polling request queue timeout
338+
328339
This setting controls how long Octopus Deploy will wait before cancelling a task in a polling Tentacle's queue. For more details on what the Polling Tentacle queue is see the documentation on [Tentacle communication modes](/docs/infrastructure/deployment-targets/tentacle/tentacle-communication#polling-tentacles)
329340
:::figure
330-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-polling-queue.png)
341+
![Polling request queue timeout setting](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-polling-queue.png)
331342
:::
332343

333344
## Assign machine policies to machines
334345

335346
Assign a machine policy to a machine by selecting a machine from the *Deployment Targets* or *Workers* screen and using the *Policy* drop down to select the machine policy:
336347

337348
:::figure
338-
![](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-assign-policy.png)
349+
![Assigning a machine policy to a deployment target](/docs/img/infrastructure/deployment-targets/machine-policies/machine-policies-connectivity-assign-policy.png)
339350
:::
340351

341352
Machine policy can also be set from the command line by using the --policy argument:
342353

343-
**Setting machine policy**
354+
### Setting machine policy
344355

345356
```powershell
346357
Tentacle.exe register-with --instance "Tentacle" --server "http://YOUR_OCTOPUS" --apiKey="API-YOUR_API_KEY" --role "web-server" --environment "Staging" --comms-style TentaclePassive --policy "Transient machines"

0 commit comments

Comments
 (0)