k8s

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NPLAnnotationKey          = "nodeportlocal.antrea.io"
	NPLEnabledAnnotationKey   = "nodeportlocal.antrea.io/enabled"
	NPLEnabledAnnotationIndex = "nplEnabledAnnotation"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NPLAnnotation

type NPLAnnotation struct {
	PodPort  int    `json:"podPort"`
	NodeIP   string `json:"nodeIP"`
	NodePort int    `json:"nodePort"`
}

NPLAnnotation is the structure used for setting NodePortLocal annotation on the Pods.

type NPLController

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

func NewNPLController

func NewNPLController(kubeClient clientset.Interface,
	podInformer cache.SharedIndexInformer,
	svcInformer cache.SharedIndexInformer,
	resyncPeriod time.Duration,
	pt *portcache.PortTable,
	nodeName string) *NPLController

func (*NPLController) GetPodsAndGenRules

func (c *NPLController) GetPodsAndGenRules() error

GetPodsAndGenRules fetches all the Pods on this Node and looks for valid NodePortLocal annotations. If they exist, with a valid Node port, it adds the Node port to the port table and rules. If the NodePortLocal annotation is invalid (cannot be unmarshalled), the annotation is cleared. If the Node port is invalid (maybe the port range was changed and the Agent was restarted), the annotation is ignored and will be removed by the Pod event handlers. The Pod event handlers will also take care of allocating a new Node port if required.

func (*NPLController) Run

func (c *NPLController) Run(stopCh <-chan struct{})

Run starts to watch and process Pod updates for the Node where Antrea Agent is running. It starts a queue and a fixed number of workers to process the objects from the queue.

func (*NPLController) Worker

func (c *NPLController) Worker()

Jump to

Keyboard shortcuts

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