k8s

package
v0.1.23 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const IperfServerCtlPort = 22865

IperfServerCtlPort control port for the service

View Source
const IperfServerDataPort = 43433

IperfServerDataPort data port for the service

View Source
const NetperfServerCtlPort = 12865

NetperfServerCtlPort control port for the service

View Source
const NetperfServerDataPort = 42424

NetperfServerDataPort data port for the service

View Source
const UperfServerCtlPort = 30000

UperferverCtlPort control port for the service

View Source
const UperfServerDataPort = 30001

UperfServerDataPort data port for the service

Variables

This section is empty.

Functions

func BuildInfra added in v0.1.21

func BuildInfra(client *kubernetes.Clientset) error

func BuildSUT

func BuildSUT(client *kubernetes.Clientset, s *config.PerfScenarios) error

BuildSUT Build the k8s env to run network performance tests

func CreateDeployment

func CreateDeployment(dp DeploymentParams, client *kubernetes.Clientset) (*appsv1.Deployment, error)

CreateDeployment will create the different deployments we need to do network performance tests

func CreateService

func CreateService(sp ServiceParams, client *kubernetes.Clientset) (*corev1.Service, error)

CreateService will build a k8s service

func DestroyDeployment

func DestroyDeployment(client *kubernetes.Clientset, dp appsv1.Deployment) error

DestroyDeployment cleans up a specific deployment from a namespace

func DestroyNamespace added in v0.1.21

func DestroyNamespace(client *kubernetes.Clientset) error

DestroyNamespace cleans up the namespace k8s-netperf created

func DestroyService

func DestroyService(client *kubernetes.Clientset, serv corev1.Service) error

DestroyService cleans up a specific service from a namespace

func GetDeployments

func GetDeployments(client *kubernetes.Clientset, namespace string) (*appsv1.DeploymentList, error)

GetDeployments retrieve all deployments for a given namespace, in this case for netperf

func GetNodeLabels added in v0.1.9

func GetNodeLabels(c *kubernetes.Clientset, node string) (map[string]string, error)

GetNodeLabels Return Labels for a specific node

func GetPodNodeInfo

func GetPodNodeInfo(c *kubernetes.Clientset, dp DeploymentParams) (metrics.NodeInfo, error)

GetPodNodeInfo collects the node information for a specific pod

func GetPods

GetPods searches for a specific set of pods from DeploymentParms It returns a PodList if the deployment is found. NOTE : Since we can update the replicas to be > 1, is why I return a PodList.

func GetServices

func GetServices(client *kubernetes.Clientset, namespace string) (*corev1.ServiceList, error)

GetServices retrieve all services for a given namespoace, in this case for netperf

func GetZone

func GetZone(c *kubernetes.Clientset) (string, map[string]int, error)

GetZone will determine if we have a multiAZ/Zone cloud. returns string of the zone, int of the node count in that zone, error if encountered a problem.

func WaitForReady

func WaitForReady(c *kubernetes.Clientset, dp DeploymentParams) (bool, error)

WaitForReady accepts the client and deployment params to determine which pods to watch. It will return a bool based on if the pods ever become ready before we move on.

Types

type DeploymentParams

type DeploymentParams struct {
	HostNetwork     bool
	Name            string
	Namespace       string
	Replicas        int32
	Image           string
	Labels          map[string]string
	Commands        [][]string
	PodAffinity     corev1.PodAffinity
	PodAntiAffinity corev1.PodAntiAffinity
	NodeAffinity    corev1.NodeAffinity
	Port            int
}

DeploymentParams describes the deployment Server pod can run multiple containers, each command in Commands will represent a container command

type ServiceParams

type ServiceParams struct {
	Name      string
	Namespace string
	Labels    map[string]string
	CtlPort   int32
	DataPorts []int32
}

ServiceParams describes the service specific details

Jump to

Keyboard shortcuts

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