service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNodePort

func GetNodePort(svc *v1.Service, dport uint16, protocol model.Protocol) uint16

func GetTargetPort

func GetTargetPort(svc *v1.Service, dport uint16, protocol model.Protocol) uint16

Types

type Backend

type Backend struct {
	IP         string
	Port       uint16
	Masquerade bool
}

type KubeProxyServiceProcessor

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

func NewKubeProxyServiceProcessor

func NewKubeProxyServiceProcessor(ctx *ctx.Context) *KubeProxyServiceProcessor

func (*KubeProxyServiceProcessor) Process

func (k *KubeProxyServiceProcessor) Process(packet model.Packet, svc *v1.Service, node *v1.Node) []Backend

func (*KubeProxyServiceProcessor) Validate

func (k *KubeProxyServiceProcessor) Validate(packet model.Packet, backends []Backend, netns netstack.NetNS) error

type Processor

type Processor interface {
	//验证backends是否符合预期
	Validate(packet model.Packet, backends []Backend, netns netstack.NetNS) error

	//根据packet和svc,返回正确的backends
	Process(packet model.Packet, svc *v1.Service, node *v1.Node) []Backend
}

Jump to

Keyboard shortcuts

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