...

Package network

import "k8s.io/kubernetes/test/e2e/network"
Overview
Index
Subdirectories

Overview ▾

Package network are the end-to-end tests for Kubernetes networking.

Index ▾

Constants
func CheckSCTPModuleLoadedOnNodes(ctx context.Context, f *framework.Framework, nodes *v1.NodeList) bool
func DescribeSvc(ns string)
func GetHTTPContent(host string, port int, timeout time.Duration, url string) (string, error)
func GetHTTPContentFromTestContainer(ctx context.Context, config *e2enetwork.NetworkingTestConfig, host string, port int, timeout time.Duration, dialCmd string) (string, error)
func StartServeHostnameService(ctx context.Context, c clientset.Interface, svc *v1.Service, ns string, replicas int) ([]string, string, error)
func StopServeHostnameService(ctx context.Context, clientset clientset.Interface, ns, name string) error
func TestHTTPHealthCheckNodePort(host string, port int, request string, timeout time.Duration, expectSucceed bool, threshold int) error
type IPerf2EnhancedCSVResults
    func ParseIPerf2EnhancedResultsFromCSV(output string) (*IPerf2EnhancedCSVResults, error)
type IPerf2NodeToNodeCSVResults
type IPerfCSVResult
    func NewIPerf(csvLine string) (*IPerfCSVResult, error)
type IPerfResults
    func (i *IPerfResults) Add(ipr *IPerfCSVResult)
    func (i *IPerfResults) ToTSV() string
type StrSlice
type TestFixture
    func NewServerTest(client clientset.Interface, namespace string, serviceName string) *TestFixture
    func (t *TestFixture) BuildServiceSpec() *v1.Service
    func (t *TestFixture) Cleanup() []error
    func (t *TestFixture) CreateRC(rc *v1.ReplicationController) (*v1.ReplicationController, error)
    func (t *TestFixture) CreateService(service *v1.Service) (*v1.Service, error)
    func (t *TestFixture) DeleteService(serviceName string) error
type UDPPokeParams
type UDPPokeResult
type UDPPokeStatus

Package files

conntrack.go dns.go dns_common.go dns_configmap.go dns_scale_records.go doc.go dual_stack.go endpointslice.go endpointslicemirroring.go example_cluster_dns.go firewall.go fixture.go funny_ips.go hostport.go ingress.go ingress_gce.go ingress_scale.go ingressclass.go kube_proxy.go loadbalancer.go network_policy.go network_tiers.go networking.go networking_perf.go no_snat.go pod_lifecycle.go proxy.go service.go service_cidrs.go service_latency.go topology_hints.go traffic_distribution.go util.go util_iperf.go

Constants

const (

    // AffinityTimeout is the maximum time that CheckAffinity is allowed to take; this
    // needs to be more than long enough for AffinityConfirmCount HTTP requests to
    // complete in a busy CI cluster, but shouldn't be too long since we will end up
    // waiting the entire time in the tests where affinity is not expected.
    AffinityTimeout = 2 * time.Minute

    // AffinityConfirmCount is the number of needed continuous requests to confirm that
    // affinity is enabled.
    AffinityConfirmCount = 15

    // SessionAffinityTimeout is the number of seconds to wait between requests for
    // session affinity to timeout before trying a load-balancer request again
    SessionAffinityTimeout = 125
)
const (

    // RespondingTimeout is how long to wait for a service to be responding.
    RespondingTimeout = 2 * time.Minute
)

func CheckSCTPModuleLoadedOnNodes

func CheckSCTPModuleLoadedOnNodes(ctx context.Context, f *framework.Framework, nodes *v1.NodeList) bool

CheckSCTPModuleLoadedOnNodes checks whether any node on the list has the sctp.ko module loaded For security reasons, and also to allow clusters to use userspace SCTP implementations, we require that just creating an SCTP Pod/Service/NetworkPolicy must not do anything that would cause the sctp kernel module to be loaded.

func DescribeSvc

func DescribeSvc(ns string)

DescribeSvc logs the output of kubectl describe svc for the given namespace

func GetHTTPContent

func GetHTTPContent(host string, port int, timeout time.Duration, url string) (string, error)

GetHTTPContent returns the content of the given url by HTTP.

func GetHTTPContentFromTestContainer

func GetHTTPContentFromTestContainer(ctx context.Context, config *e2enetwork.NetworkingTestConfig, host string, port int, timeout time.Duration, dialCmd string) (string, error)

GetHTTPContentFromTestContainer returns the content of the given url by HTTP via a test container.

func StartServeHostnameService

func StartServeHostnameService(ctx context.Context, c clientset.Interface, svc *v1.Service, ns string, replicas int) ([]string, string, error)

StartServeHostnameService creates a replication controller that serves its hostname and a service on top of it.

func StopServeHostnameService

func StopServeHostnameService(ctx context.Context, clientset clientset.Interface, ns, name string) error

StopServeHostnameService stops the given service.

func TestHTTPHealthCheckNodePort

func TestHTTPHealthCheckNodePort(host string, port int, request string, timeout time.Duration, expectSucceed bool, threshold int) error

TestHTTPHealthCheckNodePort tests a HTTP connection by the given request to the given host and port.

type IPerf2EnhancedCSVResults

IPerf2EnhancedCSVResults models the results produced by iperf2 when run with the -e (--enhancedreports) flag.

type IPerf2EnhancedCSVResults struct {
    Intervals []*IPerfCSVResult
    Total     *IPerfCSVResult
}

func ParseIPerf2EnhancedResultsFromCSV

func ParseIPerf2EnhancedResultsFromCSV(output string) (*IPerf2EnhancedCSVResults, error)

ParseIPerf2EnhancedResultsFromCSV parses results from iperf2 when given the -e (--enhancedreports) and `--reportstyle C` options. Example output: 20201210141800.884,10.244.2.24,47880,10.96.114.79,6789,3,0.0-1.0,1677852672,13422821376 20201210141801.881,10.244.2.24,47880,10.96.114.79,6789,3,1.0-2.0,1980760064,15846080512 20201210141802.883,10.244.2.24,47880,10.96.114.79,6789,3,2.0-3.0,1886650368,15093202944 20201210141803.882,10.244.2.24,47880,10.96.114.79,6789,3,3.0-4.0,2035417088,16283336704 20201210141804.879,10.244.2.24,47880,10.96.114.79,6789,3,4.0-5.0,1922957312,15383658496 20201210141805.881,10.244.2.24,47880,10.96.114.79,6789,3,5.0-6.0,2095316992,16762535936 20201210141806.882,10.244.2.24,47880,10.96.114.79,6789,3,6.0-7.0,1741291520,13930332160 20201210141807.879,10.244.2.24,47880,10.96.114.79,6789,3,7.0-8.0,1862926336,14903410688 20201210141808.878,10.244.2.24,47880,10.96.114.79,6789,3,8.0-9.0,1821245440,14569963520 20201210141809.849,10.244.2.24,47880,10.96.114.79,6789,3,0.0-10.0,18752208896,15052492511

type IPerf2NodeToNodeCSVResults

IPerf2NodeToNodeCSVResults models the results of running iperf2 between a daemonset of clients and a single server. The node name of the server is captured, along with a map of client node name to iperf2 results.

type IPerf2NodeToNodeCSVResults struct {
    ServerNode string
    Results    map[string]*IPerf2EnhancedCSVResults
}

type IPerfCSVResult

IPerfCSVResult struct modelling an iperf record.... 20160314154239,172.17.0.3,34152,172.17.0.2,5001,3,0.0-10.0,33843707904,27074774092

type IPerfCSVResult struct {
    // contains filtered or unexported fields
}

func NewIPerf

func NewIPerf(csvLine string) (*IPerfCSVResult, error)

NewIPerf parses an IPerf CSV output line into an IPerfCSVResult.

type IPerfResults

IPerfResults is a struct that stores some IPerfCSVResult

type IPerfResults struct {
    BandwidthMap map[string]int64
}

func (*IPerfResults) Add

func (i *IPerfResults) Add(ipr *IPerfCSVResult)

Add adds a new result to the Results struct.

func (*IPerfResults) ToTSV

func (i *IPerfResults) ToTSV() string

ToTSV exports an easily readable tab delimited format of all IPerfResults.

type StrSlice

StrSlice represents a string slice

type StrSlice []string

type TestFixture

TestFixture is a simple helper class to avoid too much boilerplate in tests

type TestFixture struct {
    ServiceName string
    Namespace   string
    Client      clientset.Interface

    TestID string
    Labels map[string]string

    Name  string
    Image string
    // contains filtered or unexported fields
}

func NewServerTest

func NewServerTest(client clientset.Interface, namespace string, serviceName string) *TestFixture

NewServerTest creates a new TestFixture for the tests.

func (*TestFixture) BuildServiceSpec

func (t *TestFixture) BuildServiceSpec() *v1.Service

BuildServiceSpec builds default config for a service (which can then be changed)

func (*TestFixture) Cleanup

func (t *TestFixture) Cleanup() []error

Cleanup cleans all ReplicationControllers and Services which this object holds.

func (*TestFixture) CreateRC

func (t *TestFixture) CreateRC(rc *v1.ReplicationController) (*v1.ReplicationController, error)

CreateRC creates a replication controller and records it for cleanup.

func (*TestFixture) CreateService

func (t *TestFixture) CreateService(service *v1.Service) (*v1.Service, error)

CreateService creates a service, and record it for cleanup

func (*TestFixture) DeleteService

func (t *TestFixture) DeleteService(serviceName string) error

DeleteService deletes a service, and remove it from the cleanup list

type UDPPokeParams

UDPPokeParams is a struct for UDP poke parameters.

type UDPPokeParams struct {
    Timeout  time.Duration
    Response string
}

type UDPPokeResult

UDPPokeResult is a struct for UDP poke result.

type UDPPokeResult struct {
    Status   UDPPokeStatus
    Error    error  // if there was any error
    Response []byte // if code != 0
}

type UDPPokeStatus

UDPPokeStatus is string for representing UDP poke status.

type UDPPokeStatus string
const (
    // UDPSuccess is UDP poke status which is success.
    UDPSuccess UDPPokeStatus = "Success"
    // UDPError is UDP poke status which is error.
    UDPError UDPPokeStatus = "UnknownError"
    // UDPTimeout is UDP poke status which is timeout.
    UDPTimeout UDPPokeStatus = "TimedOut"
    // UDPRefused is UDP poke status which is connection refused.
    UDPRefused UDPPokeStatus = "ConnectionRefused"
    // UDPBadResponse is UDP poke status which is bad response.
    UDPBadResponse UDPPokeStatus = "BadResponse"
)

Subdirectories

Name Synopsis
..
common
netpol
scale
localrun