Skip to content

mhausenblas/kubecuddler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubecuddler

Go Report Card godoc

A simple Go package wrapping kubectl invocations. It only depends on the stdlib and overall has a minimal footprint.

First, make sure you've got the package installed, for example, in a global scope:

$ go get -u github.com/mhausenblas/kubecuddler

A minimal usage example would look like the following:

package main

import (
	"fmt"

	"github.com/mhausenblas/kubecuddler"
)

func main() {
	res, _ := kubecuddler.Kubectl(true, true, "", "get", "po,svc")
	fmt.Println(res)
}

This produces an output like so:

screen shot of successful execution

Another example, this time with a failing command, looks like this:

package main

import (
	"fmt"

	"github.com/mhausenblas/kubecuddler"
)

func main() {
	res, _ := kubecuddler.Kubectl(true, true, "", "get", "depl")
	fmt.Println(res)
}

The above produces an output akin to:

screen shot of failed execution

About

A simple Go package wrapping kubectl invocations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages