kubernetes

package
v20.10.25+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KubernetesEndpoint is the kubernetes endpoint name in a stored context
	KubernetesEndpoint = "kubernetes"
)

Variables

This section is empty.

Functions

func ConfigFromContext

func ConfigFromContext(name string, s store.Reader) (clientcmd.ClientConfig, error)

ConfigFromContext resolves a kubernetes client config for the specified context. If kubeconfigOverride is specified, use this config file instead of the context defaults.ConfigFromContext if command.ContextDockerHost is specified as the context name, fallsback to the default user's kubeconfig file

Types

type Endpoint

type Endpoint struct {
	EndpointMeta
	TLSData *context.TLSData
}

Endpoint is a typed wrapper around a context-store generic endpoint describing a Kubernetes endpoint, with TLS data

func FromKubeConfig

func FromKubeConfig(kubeconfig, kubeContext, namespaceOverride string) (Endpoint, error)

FromKubeConfig creates a Kubernetes endpoint from a Kubeconfig file

func (*Endpoint) KubernetesConfig

func (c *Endpoint) KubernetesConfig() clientcmd.ClientConfig

KubernetesConfig creates the kubernetes client config from the endpoint

type EndpointMeta

type EndpointMeta struct {
	context.EndpointMetaBase
	DefaultNamespace string                           `json:",omitempty"`
	AuthProvider     *clientcmdapi.AuthProviderConfig `json:",omitempty"`
	Exec             *clientcmdapi.ExecConfig         `json:",omitempty"`
	UsernamePassword *UsernamePassword                `json:"usernamePassword,omitempty"`
}

EndpointMeta is a typed wrapper around a context-store generic endpoint describing a Kubernetes endpoint, without TLS data

func EndpointFromContext

func EndpointFromContext(metadata store.Metadata) *EndpointMeta

EndpointFromContext extracts kubernetes endpoint info from current context

func (*EndpointMeta) ResolveDefault

func (c *EndpointMeta) ResolveDefault(stackOrchestrator command.Orchestrator) (interface{}, *store.EndpointTLSData, error)

ResolveDefault returns endpoint metadata for the default Kubernetes endpoint, which is derived from the env-based kubeconfig.

func (*EndpointMeta) WithTLSData

func (c *EndpointMeta) WithTLSData(s store.Reader, contextName string) (Endpoint, error)

WithTLSData loads TLS materials for the endpoint

type UsernamePassword

type UsernamePassword struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

UsernamePassword contains username/password auth info

Jump to

Keyboard shortcuts

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