kubeslice / kubeslice/kubeslice-cli

Bug: Failed kubeslice-cli install leaves orphaned resources

Open
#101 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
26
Forks
27
PR merge metrics
No merged PRs in 30d

Description

### 📜 Description

When kubeslice-cli install fails (due to Ctrl+C/Cmd+ C, network issues, disk full, etc.), it leaves behind KIND clusters, Docker containers, and bound ports.
This makes the system slow/unusable and prevents retries without manual cleanup.

### 👟 Reproduction steps

1. Run the installation command:
```bash
kubeslice-cli install --profile full-demo
```
2. Let it run until it starts creating KIND clusters (around 20-30% completion)
3. Simulate a failure by either:
- Killing the process with `Ctrl+C`
- Disconnecting network temporarily
- Running out of disk space
- Any other interruption
4. Check what resources remain:
```bash
docker ps -a # Shows orphaned containers
kind get clusters # Shows orphaned KIND clusters
docker stats # Shows resource consumption
df -h # Shows disk usage
```
5. Try to run the command again - it will fail due to resource conflicts
6. Observe system becomes slow/unusable due to resource exhaustion

### 👍 Expected behavior

Failed installations should:
- Automatically clean up any resources that were created
- Return the system to its previous state
- Allow users to retry without manual intervention
- Provide clear error messages about what failed
- Handle interruptions gracefully

### 👎 Actual Behavior

* Orphaned KIND clusters & containers keep consuming resources
* Ports blocked → retries fail
* Manual cleanup required

### 🐚 Relevant log output

```shell

```

### Version

0.3.2 (Default)

### 🖥️ What operating system are you seeing the problem on?

MacOS

### ✅ Proposed Solution

* rack created resources during install
* implement panic recovery + rollback/cleanup
* add cleanup command for manual recovery

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find any similar issue

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start at the kubeslice-cli install entry point for the --profile full-demo flow and trace where KIND clusters, Docker containers, and ports are created. Reproduce an interruption around cluster creation, then verify that failed installs clean up created resources, report the failure clearly, and allow a retry without manual cleanup.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.