Documentation ¶
Index ¶
- Constants
- type DataPlane
- func (dp *DataPlane) AddPolicy(policy *policies.NPMNetworkPolicy) error
- func (dp *DataPlane) AddToList(listName *ipsets.IPSetMetadata, setNames []*ipsets.IPSetMetadata) error
- func (dp *DataPlane) AddToSet(setNames []*ipsets.IPSetMetadata, ip, podKey string) error
- func (dp *DataPlane) ApplyDataPlane() error
- func (dp *DataPlane) CreateIPSet(setMetadata *ipsets.IPSetMetadata)
- func (dp *DataPlane) DeleteIPSet(setMetadata *ipsets.IPSetMetadata)
- func (dp *DataPlane) InitializeDataPlane() error
- func (dp *DataPlane) RemoveFromList(listName *ipsets.IPSetMetadata, setNames []*ipsets.IPSetMetadata) error
- func (dp *DataPlane) RemoveFromSet(setNames []*ipsets.IPSetMetadata, ip, podKey string) error
- func (dp *DataPlane) RemovePolicy(policyName string) error
- func (dp *DataPlane) ResetDataPlane() error
- func (dp *DataPlane) ShouldUpdatePod() bool
- func (dp *DataPlane) UpdatePod(pod *UpdateNPMPod) error
- func (dp *DataPlane) UpdatePolicy(policy *policies.NPMNetworkPolicy) error
- type GenericDataplane
- type NPMEndpoint
- type UpdateNPMPod
Constants ¶
const (
// AzureNetworkName is default network Azure CNI creates
AzureNetworkName = "azure"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataPlane ¶
type DataPlane struct {
// contains filtered or unexported fields
}
func (*DataPlane) AddPolicy ¶
func (dp *DataPlane) AddPolicy(policy *policies.NPMNetworkPolicy) error
AddPolicy takes in a translated NPMNetworkPolicy object and applies on dataplane
func (*DataPlane) AddToList ¶ added in v1.4.13
func (dp *DataPlane) AddToList(listName *ipsets.IPSetMetadata, setNames []*ipsets.IPSetMetadata) error
AddToList takes a list name and list of sets which are to be added as members to given list
func (*DataPlane) AddToSet ¶ added in v1.4.13
func (dp *DataPlane) AddToSet(setNames []*ipsets.IPSetMetadata, ip, podKey string) error
AddToSet takes in a list of IPSet names along with IP member and then updates it local cache
func (*DataPlane) ApplyDataPlane ¶
ApplyDataPlane all the IPSet operations just update cache and update a dirty ipset structure, they do not change apply changes into dataplane. This function needs to be called at the end of IPSet operations of a given controller event, it will check for the dirty ipset list and accordingly makes changes in dataplane. This function helps emulate a single call to dataplane instead of multiple ipset operations calls ipset operations calls to dataplane
func (*DataPlane) CreateIPSet ¶ added in v1.4.13
func (dp *DataPlane) CreateIPSet(setMetadata *ipsets.IPSetMetadata)
CreateIPSet takes in a set object and updates local cache with this set
func (*DataPlane) DeleteIPSet ¶
func (dp *DataPlane) DeleteIPSet(setMetadata *ipsets.IPSetMetadata)
DeleteSet checks for members and references of the given "set" type ipset if not used then will delete it from cache
func (*DataPlane) InitializeDataPlane ¶ added in v1.4.13
InitializeDataPlane helps in setting up dataplane for NPM
func (*DataPlane) RemoveFromList ¶
func (dp *DataPlane) RemoveFromList(listName *ipsets.IPSetMetadata, setNames []*ipsets.IPSetMetadata) error
RemoveFromList takes a list name and list of sets which are to be removed as members to given list
func (*DataPlane) RemoveFromSet ¶ added in v1.4.13
func (dp *DataPlane) RemoveFromSet(setNames []*ipsets.IPSetMetadata, ip, podKey string) error
RemoveFromSet takes in list of setnames from which a given IP member should be removed and will update the local cache
func (*DataPlane) RemovePolicy ¶
RemovePolicy takes in network policy name and removes it from dataplane and cache
func (*DataPlane) ResetDataPlane ¶ added in v1.4.13
ResetDataPlane helps in cleaning up dataplane sets and policies programmed by NPM, retunring a clean slate
func (*DataPlane) ShouldUpdatePod ¶ added in v1.4.13
ShouldUpdatePod will let controller know if its needs to aggregate pod data for update pod call.
func (*DataPlane) UpdatePod ¶ added in v1.4.13
func (dp *DataPlane) UpdatePod(pod *UpdateNPMPod) error
UpdatePod is to be called by pod_controller ONLY when a new pod is CREATED.
func (*DataPlane) UpdatePolicy ¶
func (dp *DataPlane) UpdatePolicy(policy *policies.NPMNetworkPolicy) error
UpdatePolicy takes in updated policy object, calculates the delta and applies changes onto dataplane accordingly
type GenericDataplane ¶
type GenericDataplane interface { InitializeDataPlane() error ResetDataPlane() error CreateIPSet(setMetadata *ipsets.IPSetMetadata) DeleteIPSet(setMetadata *ipsets.IPSetMetadata) AddToSet(setNames []*ipsets.IPSetMetadata, ip, podKey string) error RemoveFromSet(setNames []*ipsets.IPSetMetadata, ip, podKey string) error AddToList(listName *ipsets.IPSetMetadata, setNames []*ipsets.IPSetMetadata) error RemoveFromList(listName *ipsets.IPSetMetadata, setNames []*ipsets.IPSetMetadata) error UpdatePod(pod *UpdateNPMPod) error ApplyDataPlane() error AddPolicy(policies *policies.NPMNetworkPolicy) error RemovePolicy(policyName string) error UpdatePolicy(policies *policies.NPMNetworkPolicy) error }
type NPMEndpoint ¶ added in v1.4.13
type UpdateNPMPod ¶ added in v1.4.13
type UpdateNPMPod struct { Name string Namespace string PodIP string NodeName string IPSetsToAdd []string IPSetsToRemove []string }
UpdateNPMPod pod controller will populate and send this datastructure to dataplane to update the dataplane with the latest pod information this helps in calculating if any update needs to have policies applied or removed