Documentation ¶
Index ¶
- Constants
- func ConfigFromContext(name string, s store.Reader) (clientcmd.ClientConfig, error)
- func ConfigFromEndpoint(endpointName string, s store.Reader) (clientcmd.ClientConfig, error)
- func NewKubernetesConfig(configPath string) clientcmd.ClientConfig
- type Endpoint
- type EndpointMeta
- type UsernamePassword
Constants ¶
const (
// KubernetesEndpoint is the kubernetes endpoint name in a stored context
KubernetesEndpoint = "kubernetes"
)
Variables ¶
This section is empty.
Functions ¶
func ConfigFromContext ¶
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
func ConfigFromEndpoint ¶ added in v0.10.0
ConfigFromEndpoint loads kubernetes config from endpoint
func NewKubernetesConfig ¶
func NewKubernetesConfig(configPath string) clientcmd.ClientConfig
NewKubernetesConfig resolves the path to the desired Kubernetes configuration file based on the KUBECONFIG environment variable and command line flags.
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 ¶
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"` ProxyURL string `json:",omitempty"` AuthProvider *clientcmdapi.AuthProviderConfig `json:",omitempty"` Exec *clientcmdapi.ExecConfig `json:",omitempty"` UsernamePassword *UsernamePassword `json:"usernamePassword,omitempty"` Token string `json:"token,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() (interface{}, *store.EndpointTLSData, error)
ResolveDefault returns endpoint metadata for the default Kubernetes endpoint, which is derived from the env-based kubeconfig.
func (*EndpointMeta) WithTLSData ¶
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