pods

package
v0.0.0-...-9c5689a Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndStart

func CreateAndStart(pod *corev1.Pod) (*corev1.Pod, error)

func CreateDPDKWorkload

func CreateDPDKWorkload(nodeSelector map[string]string, command string, image string, additionalCapabilities []corev1.Capability, mac string) (*corev1.Pod, error)

func DefineDPDKWorkload

func DefineDPDKWorkload(nodeSelector map[string]string, command string, image string, additionalCapabilities []corev1.Capability) *corev1.Pod

func DefinePod

func DefinePod(namespace string) *corev1.Pod

DefinePod creates a pod definition

func DefinePodOnHostNetwork

func DefinePodOnHostNetwork(namespace string, nodeName string) *corev1.Pod

DefinePodOnHostNetwork updates the pod defintion with a host network flag

func DefinePodOnNode

func DefinePodOnNode(namespace string, nodeName string) *corev1.Pod

DefinePodOnNode creates the pod defintion with a node selector

func DefineWithHugePages

func DefineWithHugePages(namespace, nodeName string) *corev1.Pod

DefineWithHugePages creates a pod with a 4Gi of hugepages and run command to write data to that memory

func DefineWithNetworks

func DefineWithNetworks(namespace string, networks []string) *corev1.Pod

DefineWithNetworks defines a pod with the given secondary networks.

func DetectDefaultRouteInterface

func DetectDefaultRouteInterface(cs *testclient.ClientSet, pod corev1.Pod) (string, error)

DetectDefaultRouteInterface returns pod's interface bounded to the default route which contains Destination=00000000 and Metric=00000000 Typical route table look like present below: Iface Destination(1) Gateway Flags RefCnt Use Metric Mask(7) MTU Window IRTT enp2s0 00000000 016FA8C0 0003 0 0 101 00000000 0 0 0 < This is default route tun0 0000800A 00000000 0001 0 0 0 0000FCFF 0 0 0 enp2s0 006FA8C0 00000000 0001 0 0 101 00FFFFFF 0 0 0 enp6s0 00C7A8C0 00000000 0001 0 0 102 00FFFFFF 0 0 0

func ExecCommand

func ExecCommand(cs *testclient.ClientSet, pod corev1.Pod, command []string) (bytes.Buffer, error)

ExecCommand runs command in the pod's firts container and returns buffer output

func ExecCommandInContainer

func ExecCommandInContainer(cs *testclient.ClientSet, pod corev1.Pod, containerName string, command []string) (bytes.Buffer, error)

ExecCommand runs command in the specified container and returns buffer output

func GetLog

func GetLog(p *corev1.Pod) (string, error)

GetLog connects to a pod and fetches log

func GetLogForContainer

func GetLogForContainer(p *corev1.Pod, containerName string) (string, error)

GetLog connects to a pod and fetches log from a specific container

func GetStringEventsForPodFn

func GetStringEventsForPodFn(cs *testclient.ClientSet, pod *corev1.Pod) func() string

func RedefineAsPrivileged

func RedefineAsPrivileged(pod *corev1.Pod, containerName string) (*corev1.Pod, error)

RedefineAsPrivileged updates the pod definition to be privileged

func RedefinePodWithNetwork

func RedefinePodWithNetwork(pod *corev1.Pod, networksSpec string) *corev1.Pod

RedefinePodWithNetwork updates the pod defintion with a network annotation

func RedefineWithCommand

func RedefineWithCommand(pod *corev1.Pod, command []string, args []string) *corev1.Pod

RedefineWithCommand updates the pod defintion with a different command

func RedefineWithGuaranteedQoS

func RedefineWithGuaranteedQoS(pod *corev1.Pod, cpu, memory string) *corev1.Pod

RedefineWithGuaranteedQoS updates the pod definition by adding resource limits and request to the specified values. As requests and limits are equal, the pod will work with a Guarantted quality of service (QoS). Resource specification are added to the first container

func RedefineWithLabel

func RedefineWithLabel(pod *corev1.Pod, key, value string) *corev1.Pod

RedefineWithLabel add a label to the ObjectMeta.Labels field of the pod, instantiating the map if necessary. Override the previous label it is already present.

func RedefineWithPodAffinityOnLabel

func RedefineWithPodAffinityOnLabel(pod *corev1.Pod, key, value string) *corev1.Pod

RedefineWithPodAfinityOnLabel sets the spec.podAffinity field using the given label key and value. It can be use to ensure a pod is scheduled on the same node as another, selecting the reference pod by a label.

func RedefineWithRestartPolicy

func RedefineWithRestartPolicy(pod *corev1.Pod, restartPolicy corev1.RestartPolicy) *corev1.Pod

RedefineWithRestartPolicy updates the pod defintion with a restart policy

func RedefineWithRestrictedPrivileges

func RedefineWithRestrictedPrivileges(pod *corev1.Pod) *corev1.Pod

RedefineWithRestrictedPrivileges enforces restricted privileges on the pod.

func WaitForCondition

func WaitForCondition(cs *testclient.ClientSet, pod *corev1.Pod, conditionType corev1.PodConditionType, conditionStatus corev1.ConditionStatus, timeout time.Duration) error

WaitForCondition waits until the pod will have specified condition type with the expected status

func WaitForDeletion

func WaitForDeletion(cs *testclient.ClientSet, pod *corev1.Pod, timeout time.Duration) error

WaitForDeletion waits until the pod will be removed from the cluster

func WaitForPhase

func WaitForPhase(cs *testclient.ClientSet, pod *corev1.Pod, phaseType corev1.PodPhase, timeout time.Duration) error

WaitForPhase waits until the pod will be in specified phase

Types

This section is empty.

Jump to

Keyboard shortcuts

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