kubeclient

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 3 Imported by: 0

README

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(inCluster bool, context string) (*kubernetes.Clientset, *rest.Config, error)

func NewClientConfig

func NewClientConfig(inCluster bool, context string) (*rest.Config, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL