proxy

package
v0.0.0-...-8023bdc Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TableNAT = "nat"

	ChainPrerouting   = "PREROUTING"
	ChainSKPrerouting = "STACKUBE-PREROUTING"
)
View Source
const (
	Destination = "-d "
	Source      = "-s "
	DPort       = "--dport "
	Protocol    = "-p "
	Jump        = "-j "
	ToDest      = "--to-destination "
)

Variables

This section is empty.

Functions

func NewIptables

func NewIptables(exec utilexec.Interface) iptablesInterface

Types

type FakeIPTables

type FakeIPTables struct {
	sync.Mutex

	NSLines map[string][]byte
	// contains filtered or unexported fields
}

FakeIPTables have noop implementation of fake iptables function.

func NewFake

func NewFake() *FakeIPTables

NewFake return new FakeIPTables.

func (*FakeIPTables) GetRules

func (f *FakeIPTables) GetRules(chainName, namespace string) (rules []Rule)

GetRules returns a list of rules for the given chain. The chain name must match exactly. The matching is pretty dumb, don't rely on it for anything but testing.

type Iptables

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

type Proxier

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

Proxier is an iptables based proxy for connections between a localhost:port and services that provide the actual backends in each network.

func NewProxier

func NewProxier(kubeConfig, openstackConfig string) (*Proxier, error)

NewProxier creates a new Proxier.

func (*Proxier) RegisterInformers

func (p *Proxier) RegisterInformers()

RegisterInformers registers informers which informer on namespaces,services and endpoints change.

func (*Proxier) StartEndpointInformer

func (p *Proxier) StartEndpointInformer(stopCh <-chan struct{}) error

StartEndpointInformer starts endpoint informer.

func (*Proxier) StartInformerFactory

func (p *Proxier) StartInformerFactory(stopCh <-chan struct{}) error

StartInformerFactory starts informer factory.

func (*Proxier) StartNamespaceInformer

func (p *Proxier) StartNamespaceInformer(stopCh <-chan struct{}) error

StartNamespaceInformer starts namespace informer.

func (*Proxier) StartServiceInformer

func (p *Proxier) StartServiceInformer(stopCh <-chan struct{}) error

StartServiceInformer starts service informer.

func (*Proxier) SyncLoop

func (p *Proxier) SyncLoop() error

SyncLoop runs periodic work. This is expected to run as a goroutine or as the main loop of the app. It does not return.

type Rule

type Rule map[string]string

Rule represents chain's rule.

Jump to

Keyboard shortcuts

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