bottlerocket-os / bottlerocket-os/bottlerocket

Pre-load files onto snapshot

Open
#4,579 1 comment 1 reaction 0 assignees View on GitHub
type/enhancement
Dominant language
Rust
Stars
9.7k
Forks
586
Avg merge
1d 18h
Merged PRs (30d)
12

Description

**What I'd like:**

I have some files that i want to pre-load onto an EBS snapshot of the Bottlerocket data disk. All nodes should have the files and I would like to mount them using a hostPath into the pods.

My naive thinking was to adapt the https://github.com/aws-samples/bottlerocket-images-cache/blob/main/snapshot.sh code:

```
CMDID=$(aws ssm send-command --instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunShellScript" \
--comment "Sync files" \
--parameters commands="
set -euxo pipefail

yum install -y awscli

mkdir -p /local/files
aws s3 sync --no-progress \
s3://$BUCKET/files/ \
/local/files

" \
--query "Command.CommandId" --output text)

aws ssm wait command-executed --command-id "$CMDID" --instance-id "$INSTANCE_ID" > /dev/null
```

However the files are gone when i boot from the created snapshot. I am assuming that `/local` gets wiped during boot on the nodes. I did also try `/var`.

Help would be much appreciated 🙏

**Any alternatives you've considered:**

Going back to AL2023

Contributor guide

Open the contributing guide

Research direction

Start with the linked snapshot.sh flow and the AWS SSM command shown in the issue. Trace how /local and /var are handled during Bottlerocket boot, then reproduce the EBS snapshot workflow and verify whether files remain available for hostPath mounts. Done means the supported approach or required implementation is clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, kubernetes, linux, shell
Domain
cloud, infrastructure, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.