Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: Add k8s cmd to retrieve log archive #3993

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ See the [`settings.aws.*` reference](https://bottlerocket.dev/en/os/latest/#/api
### Logs

You can use `logdog` through the [admin container](#admin-container) to obtain an archive of log files from your Bottlerocket host.

For a list of what is collected, see the logdog [command list](sources/logdog/src/log_request.rs).

#### Generating logs

SSH to the Bottlerocket host or `apiclient exec admin bash` to access the admin container, then run:

```shell
Expand All @@ -471,18 +476,29 @@ logdog

This will write an archive of the logs to `/var/log/support/bottlerocket-logs.tar.gz`.
This archive is accessible from host containers at `/.bottlerocket/support`.
You can use SSH to retrieve the file.
Once you have exited from the Bottlerocket host, run a command like:

```shell
ssh -i YOUR_KEY_FILE \
ec2-user@YOUR_HOST \
"cat /.bottlerocket/support/bottlerocket-logs.tar.gz" > bottlerocket-logs.tar.gz
```
#### Fetching logs

(If your instance isn't accessible through SSH, you can use [SSH over SSM](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started-enable-ssh-connections.html).)
There are multiple methods to retrieve the generated log archive.

For a list of what is collected, see the logdog [command list](sources/logdog/src/log_request.rs).
- **Via SSH if already enabled**

Once you have exited from the Bottlerocket host, run a command like:

```shell
ssh -i YOUR_KEY_FILE \
ec2-user@YOUR_HOST \
"cat /.bottlerocket/support/bottlerocket-logs.tar.gz" > bottlerocket-logs.tar.gz
```

- **With `kubectl get` if running Kubernetes**

```shell
kubectl get --raw \
"/api/v1/nodes/NODE_NAME/proxy/logs/support/bottlerocket-logs.tar.gz" > bottlerocket-logs.tar.gz
```

- **Using [SSH over SSM](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started-enable-ssh-connections.html) if your instance isn't accessible through SSH or Kubernetes**

### Kdump Support

Expand Down