Documentation ¶
Overview ¶
Package policy implements Kubernetes Network policies [1] for Contiv/VPP.
A detailed description of the plugin can be found in the developer's guide for policies [2].
[1]: https://kubernetes.io/docs/concepts/services-networking/network-policies/ [2]: docs/dev-guide/POLICIES.md (from the repo's top directory)
Index ¶
- type Deps
- type Option
- type Plugin
- func (p *Plugin) Close() error
- func (p *Plugin) HandlesEvent(event controller.Event) bool
- func (p *Plugin) Init() error
- func (p *Plugin) Resync(event controller.Event, kubeStateData controller.KubeStateData, ...) error
- func (p *Plugin) Revert(event controller.Event) error
- func (p *Plugin) Update(event controller.Event, txn controller.UpdateOperations) (changeDescription string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct { infra.PluginDeps ContivConf contivconf.API IPAM ipam.API IPNet ipnet.API /* for GetIfName() */ PodManager podmanager.API }
Deps defines dependencies of policy plugin.
type Option ¶
type Option func(*Plugin)
Option is a function that acts on a Plugin to inject Dependencies or configuration
type Plugin ¶
type Plugin struct { Deps // contains filtered or unexported fields }
Plugin watches configuration of K8s resources (as reflected by KSR into ETCD) for changes in policies, pods and namespaces and applies rules into extendable set of network stacks.
func (*Plugin) HandlesEvent ¶
func (p *Plugin) HandlesEvent(event controller.Event) bool
HandlesEvent selects DBResync and KubeStateChange for specific resources to handle.
func (*Plugin) Init ¶
Init initializes policy layers and caches and starts watching ETCD for K8s configuration.
func (*Plugin) Resync ¶
func (p *Plugin) Resync(event controller.Event, kubeStateData controller.KubeStateData, resyncCount int, txn controller.ResyncOperations) error
Resync is called by Controller to handle event that requires full re-synchronization. For startup resync, resyncCount is 1. Higher counter values identify run-time resync.
func (*Plugin) Revert ¶
func (p *Plugin) Revert(event controller.Event) error
Revert does nothing here - plugin handles only BestEffort events.
func (*Plugin) Update ¶
func (p *Plugin) Update(event controller.Event, txn controller.UpdateOperations) (changeDescription string, err error)
Update is called for KubeStateChange.