kubernetes

package
v0.17.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 43 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath added in v0.8.1

func ConfigPath() string

func IsAlreadyExists added in v0.16.4

func IsAlreadyExists(err error) bool

func IsConflict added in v0.16.4

func IsConflict(err error) bool

func IsNotFound added in v0.16.4

func IsNotFound(err error) bool

Types

type Client

type Client interface {
	kubernetes.Interface
	dynamic.Interface

	GatewayV1() gatewayv1.GatewayV1Interface
	ApiextensionsV1() apiextensionsv1.ApiextensionsV1Interface

	Config() *rest.Config

	Namespace() string
	Credentials() (*Credentials, error)

	Apply(ctx context.Context, namespace string, reader io.Reader) error
	ApplyFile(ctx context.Context, namespace string, path string) error
	ApplyURL(ctx context.Context, namespace string, url string) error

	PodCIDR(ctx context.Context) (string, error)
	ServiceCIDR(ctx context.Context) (string, error)

	ServicePods(ctx context.Context, namespace, name string) ([]corev1.Pod, error)
	ServicePod(ctx context.Context, namespace, name string) (*corev1.Pod, error)
	ServiceAddress(ctx context.Context, namespace, name string) (string, error)
	ServicePortForward(ctx context.Context, namespace, name, address string, ports map[int]int, readyChan chan struct{}) error

	PodExec(ctx context.Context, namespace, name, container string, command []string, tty bool, stdin io.Reader, stdout, stderr io.Writer) error
	PodAttach(ctx context.Context, namespace, name, container string, tty bool, stdin io.Reader, stdout, stderr io.Writer) error
	PodLogs(ctx context.Context, namespace, name, container string, out io.Writer, follow bool) error
	PodPortForward(ctx context.Context, namespace, name, address string, ports map[int]int, readyChan chan struct{}) error

	WaitForPod(ctx context.Context, namespace, name string) (*corev1.Pod, error)
	WaitForService(ctx context.Context, namespace, name string) (*corev1.Service, error)

	ReadFileInPod(ctx context.Context, namespace, name, container, path string, data io.Writer) error
	CreateFileInPod(ctx context.Context, namespace, name, container, path string, data io.Reader) error
}

func New

func New() (Client, error)

func NewFromBytes added in v0.16.4

func NewFromBytes(kubeconfig []byte) (Client, error)

func NewFromConfig

func NewFromConfig(config *rest.Config, namespace string) (Client, error)

func NewFromFile added in v0.16.4

func NewFromFile(kubeconfig string) (Client, error)

type Credentials added in v0.16.0

type Credentials struct {
	Host string
	Port string

	URL *url.URL

	CAData   []byte
	KeyData  []byte
	CertData []byte

	Token string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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