kube-context

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

README

kube-context

kube-context demo kube-context is a simple and easy-to-use CLI tool written in Go, which allows you to choose a Kubernetes config in a user-friendly way. It simplifies the process of switching between Kubernetes contexts by providing a menu-driven interface to list, select and switch between Kubernetes contexts.

Installation

Homebrew

Please note that kube-context requires the gcc package to be installed, so please install it with your favorite package manager.

brew tap DB-Vincent/kube-context https://github.com/DB-Vincent/kube-context
brew install DB-Vincent/kube-context/kube-context
Manual
Linux
export LATEST_VERSION=$(curl --silent "https://api.github.com/repos/DB-Vincent/kube-context/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
mkdir /tmp/kube-context
wget -qO- https://github.com/DB-Vincent/kube-context/releases/download/$LATEST_VERSION/kube-context_Linux_x86_64.tar.gz | tar xvz -C /tmp/kube-context
mv /tmp/kube-context/kube-context ~/.local/bin/kube-context
rm -rf /tmp/kube-context
chmod +x ~/.local/bin/kube-context

You should now be able to execute the kube-context command and switch between contexts.

Windows
$LATEST_VERSION = ((Invoke-WebRequest -Uri https://api.github.com/repos/DB-Vincent/go-aws-mfa/releases/latest).Content | ConvertFrom-JSON).tag_name
Invoke-WebRequest -Uri https://github.com/DB-Vincent/kube-context/releases/download/$LATEST_VERSION/kube-context_Windows_x86_64.zip -OutFile ~\Downloads\kube-context.zip
Expand-Archive ~\Downloads\kube-context.zip -DestinationPath ~\Downloads\kube-context
Move-Item -Path ~\Downloads\kube-context -Destination ~/Documents/

You can now execute ~\Documents\kube-context\kube-context.exe to run the kube-context command. In order to execute the command without ~\Documents\kube-context\, add the ~\Documents\kube-context\ path to your environment variables.

Usage

To use kube-context, simply run the kube-context command in your terminal: kube-context

This will display a list of available Kubernetes contexts, which you can select from using the arrow keys and Enter key.

Once you have selected a context, kube-context will switch your current context to the one you selected.

Renaming a context

kube-context-rename

Setting a default namespace

kube-context-rename

Contributing

If you want to contribute to kube-context, you can fork the repository and make your changes. Once you are done with your changes, create a pull request and we will review your changes.

License

kube-context is licensed under the GNU GPLv3 license.

Documentation

Overview

* kube-context * * Copyright (C) 2023 Vincent De Borger * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.

Directories

Path Synopsis
* kube-context * * Copyright (C) 2023 Vincent De Borger * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version.
* kube-context * * Copyright (C) 2023 Vincent De Borger * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version.
* kube-context * * Copyright (C) 2023 Vincent De Borger * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version.
* kube-context * * Copyright (C) 2023 Vincent De Borger * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL