Host Containers

How to interact with a Bottlerocket node through Host Containers

Prerequisites

Interacting With a Bottlerocket Node Through Host Containers

Run the following command to enter an SSM session on the node:

aws ssm start-session --target INSTANCE_ID

Replace INSTANCE_ID with the instance ID you picked earlier.

Entering the SSM session will place you in the control container.

You should see output similar to the following:

          Welcome to Bottlerocket's control container!
    ╱╲
   ╱┄┄╲   This container gives you access to the Bottlerocket API,
   │▗▖│   which in turn lets you inspect and configure the system.
  ╱│  │╲  You'll probably want to use the `apiclient` tool for that;
  │╰╮╭╯│  for example, to inspect the system:
    ╹╹
             apiclient -u /settings

You can run `apiclient --help` for usage details, and check the main
Bottlerocket documentation for descriptions of all settings and examples of
changing them.

If you need to debug the system further, you can use the admin container.  The
admin container has more debugging tools installed and allows you to get root
access to the host.  The easiest way to get started is like this, which enables
and enters the admin container using apiclient:

   enter-admin-container

You can also access the admin container through SSH if you have network access.
Just enable the container like this, then SSH to the host:

   enable-admin-container

You can disable the admin container like this:

   disable-admin-container

[ssm-user@control]$

Use apiclient to get the Bottlerocket host Message Of The Day (MOTD):

apiclient get settings.motd

You should see output similar to the following:

{
  "settings": {
    "motd": "Hello from eksctl!"
  }
}

Exploring the Admin Container

From the control container, you can enter the admin container:

enter-admin-container

Then, check the /etc/os-release file contents from the Bottlerocket host filesystem, mounted at /.bottlerocket/rootfs/. You should see something similar to the following:

[root@admin]# cat /.bottlerocket/rootfs/etc/os-release
NAME=Bottlerocket
ID=bottlerocket
VERSION="1.26.1 (aws-k8s-1.31)"
PRETTY_NAME="Bottlerocket OS 1.26.1 (aws-k8s-1.31)"
VARIANT_ID=aws-k8s-1.31
VERSION_ID=1.26.1
BUILD_ID=6ef1139f
HOME_URL="https://github.com/bottlerocket-os/bottlerocket"
SUPPORT_URL="https://github.com/bottlerocket-os/bottlerocket/discussions"
BUG_REPORT_URL="https://github.com/bottlerocket-os/bottlerocket/issues"
  
[root@admin]# cat /.bottlerocket/rootfs/etc/os-release
NAME=Bottlerocket
ID=bottlerocket
VERSION="1.26.1 (aws-ecs-2)"
PRETTY_NAME="Bottlerocket OS 1.26.1 (aws-ecs-2)"
VARIANT_ID=aws-ecs-2
VERSION_ID=1.26.1
BUILD_ID=32e9bb46
HOME_URL="https://github.com/bottlerocket-os/bottlerocket"
SUPPORT_URL="https://github.com/bottlerocket-os/bottlerocket/discussions"
BUG_REPORT_URL="https://github.com/bottlerocket-os/bottlerocket/issues"
  

Congratulations! You have successfully navigated a Bottlerocket system through the control and admin containers.


See a problem with this page? File an issue. All feedback is appreciated.
You can also directly contribute a change to the source file of this page on GitHub.