Skip to content

SupportTools/snapshot-insight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snapshot Insight

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.

Features

  • 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.

Getting Started

Prerequisites

  • Docker installed and running.
  • Go 1.18 or later installed.

Installation

  1. Clone the repository:

    git clone https://github.com/supporttools/snapshot-insight.git
    cd snapshot-insight
  2. Build the project:

    go build -o snapshot-insight ./cmd/snapshot-insight
  3. Run the CLI tool:

    ./snapshot-insight

Usage

Commands

Restore

Restores an etcd snapshot into a Docker container.

./snapshot-insight restore <path-to-snapshot>

Start

Starts a kube-apiserver connected to the restored etcd container.

./snapshot-insight start

Cleanup

Stops and removes the etcd and kube-apiserver containers.

./snapshot-insight cleanup

Development

Running Tests

Run unit tests with:

go test ./...

Scripts

  • run.sh: Automates restoring an etcd snapshot and starting the kube-apiserver.
  • teardown.sh: Cleans up all resources created during runtime.

Contributing

Contributions are welcome! Feel free to submit issues or pull requests.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Author

Matthew Mattox


Example

# 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages