pod

package
v1.5.3-rc4 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeletePod

func DeletePod(podName string) error

DeletePod - Delete a pod of given name using kubectl

func GetAllNameByPrefix

func GetAllNameByPrefix(prefix string) ([]string, error)

GetAllNameByPrefix will return the name of all pods that matches a prefix

func GetNameByPrefix

func GetNameByPrefix(prefix string) (string, error)

GetNameByPrefix will return the name of the first pod that matches a prefix

func GetNodeName

func GetNodeName(podName string) (string, error)

GetNodeName will return the name of the node the pod is running on

func RunCommandInPod

func RunCommandInPod(execCmd ...string) (string, error)

RunCommandInPod runs command with kubectl exec in pod

func WaitOnDeletion

func WaitOnDeletion(prefix string) (bool, error)

WaitOnDeletion will block until there is no pod name that starts with the give prefix

Types

type List

type List struct {
	Pods []Pod `json:"items"`
}

List is a container that holds all pods returned from 'kubectl get pods'

func GetAll

func GetAll() (*List, error)

GetAll will return a list of pods on a Kubernetes cluster

type Metadata

type Metadata struct {
	Name string `json:"name"`
}

Metadata holds information about a pod

type Pod

type Pod struct {
	Metadata `json:"metadata"`
	Spec     `json:"spec"`
	Status   `json:"status"`
}

Pod is used to parse data from 'kubectl get pods'

type Spec

type Spec struct {
	NodeName string `json:"nodeName"`
}

Spec holds spec about a pod

type Status

type Status struct {
	Phase string `json:"phase"`
}

Status holds the status about a pod

Jump to

Keyboard shortcuts

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