kubernetes

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config effectivly represents a kubeconfig file configuration allowing for creating or modifying the values in that file

func NewConfig added in v0.1.3

func NewConfig() *Config

NewConfig creates a new config object using the environment defaults

func NewConfigFromPath added in v0.1.3

func NewConfigFromPath(kubeConfigFilePath string) *Config

NewConfigFromPath creates a new config object using the specified kubeconfig path

func (*Config) GetRestClientConfig added in v0.1.3

func (c *Config) GetRestClientConfig() (*rest.Config, error)

GetRestClientConfig returns a rest.Config to be used in a Kubernetes client

func (*Config) Modify added in v0.1.3

func (c *Config) Modify(options *ConfigOptions) error

Modify updates the kubeconfig with the given options

type ConfigOptions added in v0.1.3

type ConfigOptions struct {

	// ClusterName is the name of the cluster as it appears in the kubeconfig
	ClusterName string

	// ClusterServer is the hostname of the cluster
	ClusterServer string

	// ClusterCA is the Certificate Authority contents
	ClusterCA string

	// AuthName is the name of the authentication entry as it appears in the kubeconfig
	AuthName string

	// AuthToken is the authentication token
	AuthToken string

	// ContextName is the name of the context
	ContextName string

	// ContextDefaultNamespace is the context's default namespace
	ContextDefaultNamespace string

	// ContextSetCurrent is a flag to set this context as the "current-context" in the kubeconfig
	ContextSetCurrent bool
}

ConfigOptions defines options for configuring the kubeconfig

type Kubernetes

type Kubernetes struct {
	// contains filtered or unexported fields
}

Kubernetes represents a interface with a Kubernetes cluster

func New

func New(config *Config) (*Kubernetes, error)

New returns a new Kubernetes object with the given config

func (*Kubernetes) DiscoveryClient added in v0.1.3

func (k *Kubernetes) DiscoveryClient() (*discovery.DiscoveryClient, error)

DiscoveryClient returns the Kubernetes discovery client The discovery client implements the functions that discover server-supported API groups, versions and resources.

func (*Kubernetes) GetClientset added in v0.1.3

func (k *Kubernetes) GetClientset() (*kubernetes.Clientset, error)

GetClientset returns the Kubernetes clientset, which can be acted on directly to perform API calls

func (*Kubernetes) GetConfig added in v0.1.3

func (k *Kubernetes) GetConfig() *Config

GetConfig returns the config object assicated with this instance

func (*Kubernetes) Version added in v0.1.3

func (k *Kubernetes) Version() (string, error)

Version returns the version of the Kubernetes cluster

Jump to

Keyboard shortcuts

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