testutils

package
v1.11.0-cni-plu...-7acfd45 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0, Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildKubeconfig

func BuildKubeconfig(apiserverIP string) string

func ExpectHostendpoint

func ExpectHostendpoint(c client.Interface, hepName string, expectedLabels map[string]string, expectedIPs, expectedProfiles []string) error

func ExpectHostendpointDeleted

func ExpectHostendpointDeleted(c client.Interface, name string) error

func ExpectNodeLabels

func ExpectNodeLabels(c client.Interface, labels map[string]string, node string) error

func GetBackendClient

func GetBackendClient(etcdIP string) api.Client

func GetCalicoClient

func GetCalicoClient(dsType apiconfig.DatastoreType, etcdIP, kcfg string) client.Interface

func GetK8sClient

func GetK8sClient(kubeconfig string) (*kubernetes.Clientset, error)

GetK8sClient gets a kubernetes client.

func RunEtcd

func RunEtcd() *containers.Container

func RunFlannelMigrationController

func RunFlannelMigrationController(kconfigfile string, nodeName, subnetEnv string, waitBeforeStart, waitBeforeExit int) *containers.Container

Run Flannel migration controller on a node.

func RunK8sApiserver

func RunK8sApiserver(etcdIp string) *containers.Container

func RunK8sControllerManager

func RunK8sControllerManager(apiserverIp string) *containers.Container

func RunKubeControllerWithEnv

func RunKubeControllerWithEnv(datastoreType apiconfig.DatastoreType, etcdIP, kconfigfile string, env map[string]string) *containers.Container

func RunNodeController

func RunNodeController(datastoreType apiconfig.DatastoreType, etcdIP, kconfigfile string, autoHepEnabled bool) *containers.Container

func RunPolicyController

func RunPolicyController(datastoreType apiconfig.DatastoreType, etcdIP, kconfigfile, ctrls string) *containers.Container

func Start

func Start(c *containers.Container)

func Stop

func Stop(c *containers.Container)

func UpdateCalicoNode

func UpdateCalicoNode(c client.Interface, name string, update func(n *v3.Node)) error

UpdateCalicoNode updates a Calico node resource, handling retries if there are update conflicts.

func UpdateK8sNode

func UpdateK8sNode(c *kubernetes.Clientset, name string, update func(n *v1.Node)) error

UpdateK8sNode updates a Kubernetes node resource, handling retries if there are update conflicts.

Types

type FlannelCluster

type FlannelCluster struct {
	Nodes        map[string]*v1.Node
	FlannelNodes map[string]FlannelNode
	Network      string
	// contains filtered or unexported fields
}

func NewFlannelCluster

func NewFlannelCluster(k8sClient *kubernetes.Clientset, network string) *FlannelCluster

func (*FlannelCluster) AddCalicoDaemonset

func (f *FlannelCluster) AddCalicoDaemonset(name string)

func (*FlannelCluster) AddCanalDaemonset

func (f *FlannelCluster) AddCanalDaemonset(name string)

func (*FlannelCluster) AddDefaultCalicoConfigMap

func (f *FlannelCluster) AddDefaultCalicoConfigMap()

func (*FlannelCluster) AddFlannelDaemonset

func (f *FlannelCluster) AddFlannelDaemonset(name string)

func (*FlannelCluster) AddFlannelNode

func (f *FlannelCluster) AddFlannelNode(nodeName, podCidr, backend, mac, ip string, labels map[string]string, isMaster bool) *v1.Node

func (*FlannelCluster) Reset

func (f *FlannelCluster) Reset()

type FlannelNode

type FlannelNode struct {
	PodCidr  string
	BackEnd  string
	VtepMac  string
	PublicIP string
}

Jump to

Keyboard shortcuts

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