Skip to content

Opinionated Go package to create Kubernetes clients without much boilerplate

License

Notifications You must be signed in to change notification settings

inkel/kubeclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easily create Kubernetes clients in Go

This package provides an easy way to create a Kubernetes client, whether with the default in-cluster configuration or by using ~/.kube/config with the given context.

Usage

package main

import "github.com/inkel/kubeclient"

func main() {
	c, cfg, err := kubeclient.New(false, "my-context")
	if err != nil {
		println(err)
		return
	}

	// Do something with c and cfg
	_ = c
	_ = cfg
}

The first parameter indicates if you want to use the in-cluster configuration or not. The second parameter only works when the first one is false, and allows to indicate which context from ~/.kube/config to use.

License

MIT.

About

Opinionated Go package to create Kubernetes clients without much boilerplate

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages