PSKubeCtx is a utility to manage and switch between kubectl contexts, inspired by kubectx.
PSKubeCtx provides the following cmdlets to manage your kubectl context:
Use-KubectlContext
(ukc
) - Switches to a context, likekubectl config use-context foobar
Use-KubectlNamespace
(ukn
) - Changes the namespace in the current context, likekubectl config set-context <current> --namespace=foobar
Get-KubectlConfig
- Likekubectl config view
, but in the form of aPSCustomObject
PSKubeCtx will automatically add the current Kubernetes context/namespace to your PowerShell prompt if the PowerLine module is available. The formatting and coloring can be customized using the Set-PSKubeCtxPromptSetting
cmdlet (or disabled entirely).
Install-Module PSKubeCtx
- Tab-completion of context names