kubernetes

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceTokenFile     = "/var/run/secrets/kubernetes.io/serviceaccount/token"
	ServiceRootCAFile    = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
	ServiceNamespaceFile = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"

	KubeconfigInCluster   = "incluster"
	EnvVarKubeconfig      = "KUBE_CONFIG"
	EnvVarKubeconfigFiles = "KUBECONFIG"
)

Variables

View Source
var (
	ErrPodNotFound      = fmt.Errorf("pod not found")
	ErrEndpointNotFound = fmt.Errorf("endpoint not found")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	RestConfig() *rest.Config
	ClientSet() (kubernetes.Interface, error)
	DialPod(ctx context.Context, namespace, name, port string) (gonet.Conn, error)

	ContextName() string
	Namespace() string
}

type Kubeconfig

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

func MustNewKubeconfig

func MustNewKubeconfig(plain string) Kubeconfig

func NewKubeconfig

func NewKubeconfig(plain string) (Kubeconfig, error)

func (*Kubeconfig) GetClient

func (this *Kubeconfig) GetClient(contextName string) (Client, error)

func (Kubeconfig) IsEqualTo

func (this Kubeconfig) IsEqualTo(other any) bool

func (Kubeconfig) IsZero

func (this Kubeconfig) IsZero() bool

func (Kubeconfig) MarshalText

func (this Kubeconfig) MarshalText() ([]byte, error)

func (*Kubeconfig) Set

func (this *Kubeconfig) Set(plain string) error

func (Kubeconfig) String

func (this Kubeconfig) String() string

func (*Kubeconfig) UnmarshalText

func (this *Kubeconfig) UnmarshalText(text []byte) error

func (Kubeconfig) Validate

func (this Kubeconfig) Validate() error

Jump to

Keyboard shortcuts

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