Locking your Bottlerocket nodes to a specific release is possible using the Bottlerocket Settings API.
A quick explanation of the apiclient
command used below:
Two settings are set: updates.version-lock
and updates.ignore-waves
.
updates.version-lock
: which version of Bottlerocket to lock to when apiclient
checks for updates.updates.ignore-waves
: ignore the update waves behavior and update the Bottlerocket node immediately.To create an SSM Command Document, follow the steps in the AWS Systems Manager User Guide: “Create an SSM document (console)”. Remember to select “YAML” in the “Content” box, since the SSM Command Document below is formatted in YAML.
The following SSM Command Document is referred to in this documentation as version-lock-bottlerocket-node
:
---
schemaVersion: "2.2"
description: "Lock a Bottlerocket host to a specific version via the Bottlerocket Settings API"
parameters:
TargetVersion:
type: "String"
description: "The target version of Bottlerocket to lock to (e.g. 1.12.0)"
mainSteps:
- name: "setTargetVersion"
action: "aws:runShellScript"
inputs:
timeoutSeconds: '20'
runCommand:
- "apiclient set updates.version-lock=\"{{ TargetVersion }}\" updates.ignore-waves=true"
You should now have the above SSM Command Document available in the SSM “Owned by me” tab in the “Documents” section of the SSM Console.
In order to apply a version lock using SSM, follow these steps:
version-lock-bottlerocket-node
SSM Command Document previously described.1.12.0
, not 1.12
).eks:cluster-name
as the tag key, with the tag value set to your cluster name.update-bottlerocket-node
SSM Command Document, described in the in-place update documentation.reboot-bottlerocket-node
SSM Command Document, described in the in-place update documentation.In order to remove a version lock using SSM, create and apply the following SSM Command Document to the Bottlerocket nodes you want to remove a Version Lock from (the SSM Command Document can be named version-unlock-bottlerocket-node
for example):
---
schemaVersion: "2.2"
description: "Remove a Version Lock from a Bottlerocket host via the Bottlerocket Settings API"
mainSteps:
- name: "unsetTargetVersion"
action: "aws:runShellScript"
inputs:
timeoutSeconds: '20'
runCommand:
- "apiclient set updates.version-lock=\"latest\" updates.ignore-waves=false"