kubeconfig

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteContext added in v1.4.0

func DeleteContext(machineName string, configPath ...string) error

DeleteContext deletes the specified machine's kubeconfig context

func Endpoint added in v1.9.1

func Endpoint(contextName string, configPath string) (string, int, error)

Endpoint returns the IP:port address stored for minikube in the kubeconfig specified.

func GetCurrentContext added in v1.33.0

func GetCurrentContext(configPath ...string) (string, error)

GetCurrentContext gets the kubectl's current-context

func PathFromEnv added in v1.4.0

func PathFromEnv() string

PathFromEnv gets the path to the first kubeconfig

func PopulateFromSettings added in v1.4.0

func PopulateFromSettings(cfg *Settings, apiCfg *api.Config) error

PopulateFromSettings populates an api.Config object with values from *Settings

func SetCurrentContext added in v1.4.0

func SetCurrentContext(name string, configPath ...string) error

SetCurrentContext sets the kubectl's current-context

func UnsetCurrentContext added in v1.4.0

func UnsetCurrentContext(machineName string, configPath ...string) error

UnsetCurrentContext unsets the current-context from minikube to "" on minikube stop

func Update added in v1.4.0

func Update(kcs *Settings) error

Update reads config from disk, adds the minikube settings, and writes it back. activeContext is true when minikube is the CurrentContext If no CurrentContext is set, the given name will be used.

func UpdateEndpoint added in v1.9.1

func UpdateEndpoint(contextName string, host string, port int, configPath string, ext *Extension) (bool, error)

UpdateEndpoint overwrites the IP stored in kubeconfig with the provided IP. It will also fix missing cluster or context in kubeconfig, if needed. Returns if the change was made and any error occurred.

func VerifyEndpoint added in v1.9.1

func VerifyEndpoint(contextName string, host string, port int, configPath string) error

VerifyEndpoint verifies the host:port stored in kubeconfig.

Types

type Extension added in v1.17.0

type Extension struct {
	runtime.TypeMeta `json:",inline"`
	Version          string `json:"version"`
	Provider         string `json:"provider"`
	LastUpdate       string `json:"last-update"`
}

Extension represents information to identify clusters and contexts

func NewExtension added in v1.17.0

func NewExtension() *Extension

NewExtension returns a minikube formatted kubeconfig's extension block to idenity clusters and contexts

func (*Extension) DeepCopy added in v1.17.0

func (in *Extension) DeepCopy() *Extension

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Extension.

func (*Extension) DeepCopyInto added in v1.17.0

func (in *Extension) DeepCopyInto(out *Extension)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Extension) DeepCopyObject added in v1.17.0

func (in *Extension) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type Settings added in v1.4.0

type Settings struct {
	// The name of the cluster for this context
	ClusterName string

	// The name of the namespace for this context
	Namespace string

	// ClusterServerAddress is the address of the Kubernetes cluster
	ClusterServerAddress string

	// ClientCertificate is the path to a client cert file for TLS.
	ClientCertificate string

	// CertificateAuthority is the path to a cert file for the certificate authority.
	CertificateAuthority string

	// ClientKey is the path to a client key file for TLS.
	ClientKey string

	// Should the current context be kept when setting up this one
	KeepContext bool

	// Should the certificate files be embedded instead of referenced by path
	EmbedCerts bool

	// Extension meta data for the cluster
	ExtensionCluster *Extension

	// Extension meta data for the cluster
	ExtensionContext *Extension
	// contains filtered or unexported fields
}

Settings is the minikubes settings for kubeconfig

func (*Settings) SetPath added in v1.4.0

func (k *Settings) SetPath(kubeConfigFile string)

SetPath sets the setting for kubeconfig filepath

Jump to

Keyboard shortcuts

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