README
¶
kubeconfig-picker
Pick out a subset of Kube config contexts
Build and Install
go install
Usage
Run
kubeconfig-picker
Import
import (
"fmt"
konfig "github.com/fenrirunbound/kubeconfig-picker/konfig"
)
func main() {
k, _ := konfig.NewKonfigFromFile("/home/me/.kube/config")
availableContexts := k.ListContexts()
// A list of contexts contained in the kube config
fmt.Printf("%v\n", availableContexts)
config, _ := k.SelectContextsAsYaml([]string{"context1", "anotherContext"})
// A kube config with only "context1" and "anotherContext" derived from the main config
fmt.Printf("%v\n", string(config))
}
Documentation
¶
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.