kubeconfig

package
v4.3.9-dev.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package kubeconfig manages teleport entries in a local kubeconfig file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string) (*clientcmdapi.Config, error)

Load tries to read a kubeconfig file and if it can't, returns an error. One exception, missing files result in empty configs, not an error.

func Remove

func Remove(path, name string) error

Remove removes Teleport configuration from kubeconfig.

If `path` is empty, Remove will try to guess it based on the environment or known defaults.

func Update

func Update(path string, v Values) error

Update adds Teleport configuration to kubeconfig.

If `path` is empty, Update will try to guess it based on the environment or known defaults.

func UpdateWithClient

func UpdateWithClient(path string, tc *client.TeleportClient) error

UpdateWithClient adds Teleport configuration to kubeconfig based on the configured TeleportClient.

If `path` is empty, UpdateWithClient will try to guess it based on the environment or known defaults.

Types

type Values

type Values struct {
	// Name is used to name kubeconfig sections ("context", "cluster" and
	// "user"). Should match Teleport cluster name.
	Name string
	// ClusterAddr is the public address the Kubernetes client will talk to,
	// usually a proxy.
	ClusterAddr string
	// Credentials are user credentials to use for authentication the
	// ClusterAddr. Only TLS fields (key/cert/CA) from Credentials are used.
	Credentials *client.Key
}

Values are Teleport user data needed to generate kubeconfig entries.

Jump to

Keyboard shortcuts

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