k8s

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployment

type Deployment struct {
	// RemoteClient - ssh client to connect through
	RemoteClient *remote.Client

	// ConfigFile - path to yaml config file for k8s
	ConfigFile string

	// SecretFile - path to yaml driver secret for k8s
	SecretFile string

	// WaitTimeout - consider waiting commands to fail after this timeout exceeded
	WaitTimeout time.Duration

	// WaitInterval - wait interval between checking pods status
	WaitInterval time.Duration
	// contains filtered or unexported fields
}

Deployment - k8s deployment

func NewDeployment

func NewDeployment(args DeploymentArgs) (*Deployment, error)

NewDeployment - create new k8s deployment

func (*Deployment) Apply

func (d *Deployment) Apply(pods []string) error

Apply - run 'kubectl apply' for current deployment pods - wait for pods to be running, nil to skip this step

func (*Deployment) CleanUp

func (d *Deployment) CleanUp()

CleanUp - silently delete k8s deployment and tmp folder

func (*Deployment) CreateSecret

func (d *Deployment) CreateSecret() error

CreateSecret - run 'kubectl create secret' for current deployment

func (*Deployment) Delete

func (d *Deployment) Delete(pods []string) error

Delete - run 'kubectl delete' for current deployment pods - wait for pods to be shutted down, nil to skip this step

func (*Deployment) DeleteSecret

func (d *Deployment) DeleteSecret() error

DeleteSecret - run 'kubectl delete secret' for current deployment

func (*Deployment) WaitForPods

func (d *Deployment) WaitForPods(pods []string, mode WaitForPodsMode) (string, error)

WaitForPods - wait for pods to be presented

type DeploymentArgs

type DeploymentArgs struct {
	RemoteClient *remote.Client
	ConfigFile   string
	SecretFile   string
	SecretName   string
	Log          *logrus.Entry
}

DeploymentArgs - arguments for deployment

type WaitForPodsMode

type WaitForPodsMode int64

WaitForPodsMode - mode for WaitForPods() function (wait all pods or when none is presented)

const (
	// WaitForPodsModeAllToMatch - all pods should be presented
	WaitForPodsModeAllToMatch WaitForPodsMode = iota

	// WaitForPodsModeNoneToMatch - none of pods should be presented
	WaitForPodsModeNoneToMatch WaitForPodsMode = iota
)

func (WaitForPodsMode) String

func (mode WaitForPodsMode) String() string

Jump to

Keyboard shortcuts

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