kubernetes

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SingleReplica      = 1
	LabelKubeName      = "app.kubernetes.io/name"
	LabelKubeInstance  = "app.kubernetes.io/instance"
	LabelKubeVersion   = "app.kubernetes.io/version"
	LabelKubeManagedBy = "app.kubernetes.io/managed-by"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentCreateOpts

type DeploymentCreateOpts struct {
	Namespace             string
	Spec                  *appsv1.Deployment
	OnStatusEventCallback func(event string)
}

type DeploymentDetails added in v0.8.0

type DeploymentDetails struct {
	Info        *DeploymentInfo
	Created     time.Time
	Annotations map[string]string
}

type DeploymentInfo

type DeploymentInfo struct {
	Namespace string
	Name      string
	Healthy   bool
	PodInfo   *PodInfo
}

type KubeClient

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

func NewInClusterKubeClient

func NewInClusterKubeClient() (*KubeClient, error)

func NewKubeClient added in v0.8.0

func NewKubeClient(inCluster bool, configPath string) (*KubeClient, error)

func NewOutOfClusterKubeClient

func NewOutOfClusterKubeClient(configPath string) (*KubeClient, error)

func (*KubeClient) AppApi added in v0.8.0

func (client *KubeClient) AppApi() app.AppsV1Interface

func (*KubeClient) Close

func (client *KubeClient) Close() error

func (*KubeClient) CoreApi added in v0.8.0

func (client *KubeClient) CoreApi() core.CoreV1Interface

func (*KubeClient) DeploymentCreate

func (client *KubeClient) DeploymentCreate(opts *DeploymentCreateOpts) error

func (*KubeClient) DeploymentDelete

func (client *KubeClient) DeploymentDelete(namespace string, name string) error

func (*KubeClient) DeploymentDescribe added in v0.8.0

func (client *KubeClient) DeploymentDescribe(namespace string, name string) (*DeploymentDetails, error)

func (*KubeClient) DeploymentList

func (client *KubeClient) DeploymentList(namespace string, namePrefix string, labelSelector string) ([]DeploymentInfo, error)

func (*KubeClient) NamespaceApply

func (client *KubeClient) NamespaceApply(name string) error

func (*KubeClient) NamespaceDelete

func (client *KubeClient) NamespaceDelete(name string) error

func (*KubeClient) PodDescribe added in v0.8.0

func (client *KubeClient) PodDescribe(deployment *appsv1.Deployment) (*PodInfo, error)

func (*KubeClient) PodExec

func (client *KubeClient) PodExec(opts *PodExecOpts) error

func (*KubeClient) PodPortForward

func (client *KubeClient) PodPortForward(opts *PodPortForwardOpts) error

func (*KubeClient) RestApi added in v0.8.0

func (client *KubeClient) RestApi() *rest.Config

func (*KubeClient) ServiceCreate

func (client *KubeClient) ServiceCreate(namespace string, spec *corev1.Service) error

func (*KubeClient) ServiceDelete

func (client *KubeClient) ServiceDelete(namespace string, name string) error

func (*KubeClient) ServiceDescribe added in v0.8.0

func (client *KubeClient) ServiceDescribe(namespace string, name string) (*ServiceInfo, error)

type KubeResource

type KubeResource struct {
	Memory string
	Cpu    string
}

type PodExecOpts

type PodExecOpts struct {
	Namespace      string
	PodName        string
	PodId          string
	Shell          string
	InStream       io.ReadCloser
	OutStream      io.Writer
	ErrStream      io.Writer
	IsTty          bool
	OnExecCallback func()
}

type PodInfo

type PodInfo struct {
	Namespace     string
	PodName       string
	ContainerName string
	Env           map[string]string
}

type PodPortForwardOpts

type PodPortForwardOpts struct {
	Namespace             string
	PodId                 string
	Ports                 []string // format "LOCAL:REMOTE"
	IsWait                bool
	OnTunnelStartCallback func()
	OnTunnelErrorCallback func(error)
}

type ServiceInfo added in v0.8.0

type ServiceInfo struct {
	Namespace string
	Name      string
	Ports     []ServicePort
}

type ServicePort added in v0.8.0

type ServicePort struct {
	Name string
	Port string
}

Jump to

Keyboard shortcuts

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