k8s

package
v0.0.0-...-73862ec Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package k8s provides kubernetes helper functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDeployment

func ApplyDeployment(path string, mutators ...func(deployment *v1.Deployment)) error

ApplyDeployment is analogy of 'kubeclt apply -f path' but with mutating deployment before apply

func Client

func Client() (*kubernetes.Clientset, error)

Client returns k8s client

func NewNamespace

func NewNamespace() (name string, cleanup func(), err error)

NewNamespace generates new namespace

func Nodes

func Nodes() ([]*corev1.Node, error)

Nodes returns a slice of Nodes where can be deployed deployment

func SetNamespace

func SetNamespace(namespace string) func(*v1.Deployment)

SetNamespace sets namespace for deployment

func SetNode

func SetNode(nodeName string) func(*v1.Deployment)

SetNode sets NodeSelector for the pod based on passed nodeName

func ShowLogs

func ShowLogs(options ...*exechelper.Option)

ShowLogs prints logs into console all containers of pods

func WaitLogsMatch

func WaitLogsMatch(labelSelector, pattern, namespace string, timeout time.Duration) error

WaitLogsMatch waits pattern in logs of deployment. Note: Use this function only for final assertion. Do not use this for wait special state of application. Note: This API should be replaced to using `ping` command.

Types

This section is empty.

Directories

Path Synopsis
Package require provides Kubernetes assertion functions that stop test on failure to fulfill a condition
Package require provides Kubernetes assertion functions that stop test on failure to fulfill a condition

Jump to

Keyboard shortcuts

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