Skip to content

Latest commit

 

History

History
105 lines (72 loc) · 3.51 KB

README.md

File metadata and controls

105 lines (72 loc) · 3.51 KB

kubenswin

Windows Version of the powerful tool kubens

      Usage
        kubenswin                        : current namespace
        kubenswin ls                     : list the namespaces in the current context
        kubenswin set <name>             : switch to another namespace in the current context
        kubenswin help                   : display usage

Also Try

Tests

OS Success
Windows 10 Yes
Windows 2012 R2 Yes
Windows 2016 N/A
Windows 7 N/A
Windows 2008 R2 N/A

Note N/A = Haven't tested yet

Prerequisites

Chocolatey

You can install the kubectl client via Chocolatey. This is the recommended way based on the kubernetes.io docs.

$ choco install kubernetes-cli

Usage

$ kubenswin ls
* default
kube-public
kube-system
sandbox

$ kubenswin set sandbox
Context "minikube" modified.
Active namespace is sandbox in context minikube

$ kubenswin
sandbox

Installation

You will need to ensure you put kubenswin.exe in a directory in your $PATH. To see what directories you can put it in use the following command.

In a Windows Command Prompt

$ echo %PATH%

In a Powershell Command Prompt

PS> Get-ChildItem Env:

Things to Note

kubenswin for Windows is actually a powershell script that was converted using PS2EXE-GUI. I have saved the copy of PS2EXE-GUI that I used in this repo.

This allows users and developers to use different methods of kubenswin for Windows. For example, if you want just to use the Powershell script or convert it to a PowerShell module, you can do that. By default, I provide the .exe because that is useful to me. However, feel free to use it anyway you like and please CONTRIBUTE with new features and funtionaility.

How to Contribute

I'd love for anyone to contribute. Please read the CONTRIBUTING.md document for more information.

How to compile

Prerequisites to compile

  • Windows 10 or higher
  • PS2EXE-GUI
  • Powershell 4.0 or higher (I used 5.0)

Open a Powershell command with Run as administrator

$ git clone https://github.com/thomasliddledba/kubenswin.git <working directory>
$ cd <working directory>/kubenswin
$ ./PS2EXE-GUI/ps2exe.ps1 -inputfile kubenswin.ps1 -output bin/kubenswin.exe

Thanks

  • Markus Scholtes - PS2EXE-GUI
  • Ingo Karstein - PS2EXE
  • Jon Mosco - Late night discussion about doing this weekend project. Check out kube-ps1 by Jon! Maybe a Windows version????
  • Ahmet Alp Balkan - kubectx - Writing the inital code for kubens and giving me the idea to extend to Windows for us Windows guys based on this Issue #29