nodeportproxy

package
v2.21.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgnhostImage = "k8s.gcr.io/e2e-test-images/agnhost:2.21"
)

TODO make registries configurable.

Variables

This section is empty.

Functions

func ExtractNodePorts

func ExtractNodePorts(svc *corev1.Service) sets.Int32

ExtractNodePorts returns the set of node ports extracted from the given Service.

func ExtractPorts

func ExtractPorts(svc *corev1.Service) sets.Int32

ExtractPorts returns the set of ports extracted from the given Service.

func FindExposingNodePort

func FindExposingNodePort(svc *corev1.Service, targetPort int32) int32

FindExposingNodePort returns the node port associated to the given target port.

Types

type Deployer

type Deployer struct {
	Log       *zap.SugaredLogger
	Namespace string
	Versions  kubermatic.Versions
	Client    ctrlruntimeclient.Client
	// contains filtered or unexported fields
}

Deployer helps setting up nodeport proxy for testing.

func (*Deployer) CleanUp

func (d *Deployer) CleanUp(ctx context.Context) error

CleanUp deletes the resources.

func (*Deployer) GetLbService

func (d *Deployer) GetLbService(ctx context.Context) *corev1.Service

GetLbService returns the service used to expose the nodeport proxy pods.

func (*Deployer) SetUp

func (d *Deployer) SetUp(ctx context.Context) error

type ServiceJig

type ServiceJig struct {
	Log       *zap.SugaredLogger
	Client    ctrlruntimeclient.Client
	Namespace string

	Services    []*corev1.Service
	ServicePods map[string][]string
}

Based on: https://github.com/mgdevstack/kubernetes/blob/9eced040142454a20255ae323279a38dc6b2bc1a/test/e2e/framework/service/jig.go#L60 ServiceJig is a jig to help service testing.

func (*ServiceJig) CleanUp

func (n *ServiceJig) CleanUp(ctx context.Context) error

CleanUp removes the resources.

func (*ServiceJig) CreateServiceWithPods

func (n *ServiceJig) CreateServiceWithPods(ctx context.Context, svc *corev1.Service, numPods int32, https bool) (*corev1.Service, error)

CreateServiceWithPods deploys a service and the associated pods.

Jump to

Keyboard shortcuts

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