https://github.com/embik/kubectl-switch-ws
A kubectl plugin to quickly switch kcp workspaces
https://github.com/embik/kubectl-switch-ws
kcp kubectl kubectl-plugins kubernetes
Last synced: 6 months ago
JSON representation
A kubectl plugin to quickly switch kcp workspaces
- Host: GitHub
- URL: https://github.com/embik/kubectl-switch-ws
- Owner: embik
- License: apache-2.0
- Created: 2024-05-16T09:18:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-17T11:01:19.000Z (about 1 year ago)
- Last Synced: 2025-03-30T17:46:04.880Z (6 months ago)
- Topics: kcp, kubectl, kubectl-plugins, kubernetes
- Language: Shell
- Homepage:
- Size: 262 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kubectl-switch-ws
A `kubectl` plugin to quickly switch kcp workspaces interactively.
## Installation
### Prequisites
To run this `kubectl` plugin you need:
- Bash
- [fzf](https://github.com/junegunn/fzf)
- [kubectl-workspace](https://github.com/kcp-dev/kcp/tree/main/cli/cmd/kubectl-workspace) ([Installation instructions](https://docs.kcp.io/kcp/main/setup/kubectl-plugin/))### Krew
This installation method requires [krew](https://krew.sigs.k8s.io/) installed.
Add the [krew index](https://github.com/embik/krew-index) and synchronize the local copy of it:
```
$ kubectl krew index add embik https://github.com/embik/krew-index.git
$ kubectl krew update
```kubectl-switch-ws can now be installed with the following command:
```
$ kubectl krew install embik/switch-ws
```### Manual
Copy [kubectl-switch\_ws](./kubectl-switch_ws) into our `$PATH` (e.g. `~/bin` or `~/.local/bin`, depending on your system setup).
## Usage
Run `kubectl switch-ws` to start the interactive workspace switcher. Navigate the list of child workspaces in the current workspace and press enter to switch to a specific workspace.
Use the pseudo element `..` to go up one level to the parent workspace.
Use `[exit]` or press ESC when you have reached the workspace you intended to navigate to.