Snapshot Insight is a CLI tool designed to explore Kubernetes etcd snapshots without requiring a full cluster restoration. It allows you to:
- Restore etcd snapshots into a standalone Docker container.
- Start a kube-apiserver connected to the restored etcd snapshot with no authentication.
- Clean up all resources after exploration.
- Quick Restoration: Restore etcd snapshots directly into a container.
- Standalone Exploration: Run a kube-apiserver in standalone mode to access cluster resources.
- Lightweight Cleanup: Remove all temporary containers and files with a single command.
- Docker installed and running.
- Go 1.18 or later installed.
-
Clone the repository:
git clone https://github.com/supporttools/snapshot-insight.git cd snapshot-insight
-
Build the project:
go build -o snapshot-insight ./cmd/snapshot-insight
-
Run the CLI tool:
./snapshot-insight
Restores an etcd snapshot into a Docker container.
./snapshot-insight restore <path-to-snapshot>
Starts a kube-apiserver connected to the restored etcd container.
./snapshot-insight start
Stops and removes the etcd and kube-apiserver containers.
./snapshot-insight cleanup
Run unit tests with:
go test ./...
run.sh
: Automates restoring an etcd snapshot and starting the kube-apiserver.teardown.sh
: Cleans up all resources created during runtime.
Contributions are welcome! Feel free to submit issues or pull requests.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Matthew Mattox
# Restore an etcd snapshot
./snapshot-insight restore /path/to/snapshot.db
# Start kube-apiserver
./snapshot-insight start
# Explore resources using kubectl
kubectl --server=http://localhost:6443 get pods
# Clean up resources
./snapshot-insight cleanup