diff --git a/README.md b/README.md index 626145a..1745a94 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,65 @@ # Duplik8s +🚧 Work in progress! + --- **Duplicate** 🔁 kubectl plugin to duplicate resources in a Kubernetes cluster. +

+ Latest Release + Build Status +

+ --- ![](./docs/demo.gif) +`duplik8s` allows you to easily duplicate Kubernetes pods with overridden commands and configurations. +This is useful for testing, debugging, and development purposes. + +As you might have guessed, `duplik8s` shines when used in combination with the +amazing [k9s](https://github.com/derailed/k9s) ✨. +Check out the installation instructions below to easily load it as a k9s plugin. + ## Installation ### Install with Go ```sh -$ go install github.com/Telemaco019/duplik8s@latest +$ go install github.com/telemaco019/duplik8s/cmd@latest ``` +### Use as k9s plugin +After installing `duplik8s`, you can add it to your k9s plugins by adding the following to +your `$XDG_CONFIG_HOME/k9s/plugins.yml` file. + +After reloading k9s, you should be able to duplicate Pods with `Ctrl-T`. + +```yaml +# $XDG_CONFIG_HOME/k9s/plugins.yaml +plugins: + duplik8s: + shortCut: Ctrl-T + description: Duplicate Pod + scopes: + - po + command: kubectl + background: true + args: + - duplicate + - pod + - $NAME + - -n + - $NAMESPACE + - --context + - $CONTEXT +``` + +On MacOS, you can find the `plugins.yml` file at `~/Library/Application Support/k9s/plugins.yaml`. + +For more information on k9s plugins, you can refer to the [official documentation](https://k9scli.io/topics/plugins). ## Examples @@ -26,3 +69,10 @@ Duplicate a Pod: $ kubectl duplicate pod my-pod ``` + +--- + +## License + +This project is licensed under the Apache License. See the [LICENSE](./LICENSE) file for details. + diff --git a/docs/demo.gif b/docs/demo.gif index e571f36..d3de935 100644 Binary files a/docs/demo.gif and b/docs/demo.gif differ diff --git a/docs/demo.tape b/docs/demo.tape index a8ed314..a38575b 100644 --- a/docs/demo.tape +++ b/docs/demo.tape @@ -8,10 +8,12 @@ Type "k9s" Enter Sleep 3s Ctrl+T -Sleep 5s +Sleep 3s Type "j" -Sleep 2s +Sleep 3s Type "s" Sleep 1s +Type "ls" +Enter +Sleep 2s Type "exit" -Sleep 5s diff --git a/cmd/kubectl-duplicate.go b/kubectl-duplicate/kubectl-duplicate.go similarity index 100% rename from cmd/kubectl-duplicate.go rename to kubectl-duplicate/kubectl-duplicate.go