Skip to content

Commit e27fe93

Browse files
authored
Merge pull request #19 from yeazelm/getting_logs
Add fetching logs example to README
2 parents ac6ae1e + 1c19357 commit e27fe93

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Bottlerocket Bootstrap Container
22

3-
This is the bootstrap container for the [Bottlerocket](https://github.com/bottlerocket-os/bottlerocket) operating system.
4-
This container image allows the user to provide their own script to run bootstrap commands to setup their own configuration during runtime.
3+
This is the bootstrap container for the [Bottlerocket](https://github.com/bottlerocket-os/bottlerocket) operating system.
4+
This container image allows the user to provide their own script to run bootstrap commands to setup their own configuration during runtime.
55

66
## Using the Container Image
77

8-
For more information on settings, please refer to the [Bottlerocket Documentation](https://bottlerocket.dev/) in order to configure your files.
8+
For more information on settings, please refer to the [Bottlerocket Documentation](https://bottlerocket.dev/) in order to configure your files.
99
The automatically updated bootstrap container source will be used by default, if source is not specified in the configuration.
1010
To use default container image, create a TOML file with the following configurations.
1111

@@ -18,15 +18,16 @@ user-data="user-base64-encoded-bootstrap-script"
1818
```
1919

2020
Below is the configuration to use the custom source.
21+
2122
```toml
2223
[settings.bootstrap-containers.myscript]
2324
source="<URI to ECR Repository for this Bootstrap Container>"
2425
mode="once"
2526
user-data="user-base64-encoded-bootstrap-script"
2627
```
2728

28-
Afterwards, create the Bottlerocket instance using the TOML file.
29-
The settings that you changed within the user's bootstrap script should be seen within the bottlerocket instance.
29+
Afterwards, create the Bottlerocket instance using the TOML file.
30+
The settings that you changed within the user's bootstrap script should be seen within the bottlerocket instance.
3031

3132
### Example Walkthrough
3233

@@ -54,7 +55,7 @@ echo "User-data script executed."
5455

5556
The user-data script needs to be base64 encoded. Encode the script in base64.
5657

57-
Next, create a TOML file with the necessary settings to use the bootstrap container.
58+
Next, create a TOML file with the necessary settings to use the bootstrap container.
5859
Replace <URI to ECR Repository for this Bootstrap Container> with the actual URI of the ECR repository.
5960

6061
For example, the TOML file should look like the below if you base64 the given user-data:
@@ -65,6 +66,14 @@ mode = "once"
6566
user-data = "IyEvdXNyL2Jpbi9lbnYgc2gKc2V0IC1ldW8gcGlwZWZhaWwKCiMgQ3JlYXRlIHRoZSBkaXJlY3RvcnkKbWtkaXIgLXAgL3Zhci9saWIvbXlfZGlyZWN0b3J5CgojIFNldCBBUEkgY2xpZW50IGNvbmZpZ3VyYXRpb25zCmFwaWNsaWVudCBzZXQgLS1qc29uICd7InNldHRpbmdzIjogeyJvY2ktZGVmYXVsdHMiOiB7InJlc291cmNlLWxpbWl0cyI6IHsibWF4LW9wZW4tZmlsZXMiOiB7InNvZnQtbGltaXQiOiA0Mjk0OTY3Mjk2LCAiaGFyZC1saW1pdCI6IDg1ODk5MzQ1OTJ9fX19fScKCiMgTG9hZCBrZXJuZWwgbW9kdWxlCmlmIGNvbW1hbmQgLXYgbW9kcHJvYmUgPiAvZGV2L251bGwgMj4mMTsgdGhlbgogIG1vZHByb2JlIGR1bW15CmZpCgplY2hvICJVc2VyLWRhdGEgc2NyaXB0IGV4ZWN1dGVkLiIK"
6667
```
6768

68-
Afterwards, you can run the Bottlerocket instance using the TOML file and the user-data configurations will be applied.
69-
Once the instance is up and running, you can verify that the bootstrap process completed successfully.
69+
Afterwards, you can run the Bottlerocket instance using the TOML file and the user-data configurations will be applied.
70+
Once the instance is up and running, you can verify that the bootstrap process completed successfully.
71+
72+
#### Checking logs
73+
7074
You can check the logs of the bootstrap container using the apiclient tool from the admin container.
75+
To check the logs of the `bear` container above, you can run the following commmand from the [control container](https://github.com/bottlerocket-os/bottlerocket-control-container) (assuming the [admin container](https://github.com/bottlerocket-os/bottlerocket-admin-container) is enabled):
76+
77+
```bash
78+
apiclient exec admin journalctl -D /.bottlerocket/rootfs/var/log/journal/ -u bootstrap-containers@bear
79+
```

0 commit comments

Comments
 (0)