kubeconfig

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFromToken

func CreateFromToken(serverURL, clusterName, userName string, caCert, token []byte) *clientcmdapi.Config

Types

type Kubeconfig

type Kubeconfig struct {
	Config   *clientcmdapi.Config
	UserName string
	// contains filtered or unexported fields
}

func LoadFromFile

func LoadFromFile(filename string) (*Kubeconfig, error)

Create a new Kubeconfig object based on a kubeconfig file.

func NewFromToken

func NewFromToken(userName, clusterName, serverURL, tokenFile, rootCAFile string) (*Kubeconfig, error)

Create a new Kubeconfig object based on a token and CA cert.

func (*Kubeconfig) Refresh

func (kc *Kubeconfig) Refresh() error

Update our kubeconfig in case the token has changed. Note: Kubernetes will probably transition to serviceaccount tokens with limited lifetime. This function can be called periodically to update the config.

func (*Kubeconfig) WriteToFile

func (kc *Kubeconfig) WriteToFile(filename string) error

Save kubeconfig to a file.

Jump to

Keyboard shortcuts

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