controller

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FirewallController

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

FirewallController watches for changes of the k8s entities services and networkpolicies and constructs nftable rules for them.

func NewFirewallController

func NewFirewallController(client k8s.Interface, logger *zap.SugaredLogger) *FirewallController

NewFirewallController creates a new FirewallController

func (*FirewallController) FetchAndAssemble

func (f *FirewallController) FetchAndAssemble() (*FirewallRules, error)

FetchAndAssemble fetches resources from k8s and assembles firewall rules for them

type FirewallResources

type FirewallResources struct {
	NetworkPolicyList *networkingv1.NetworkPolicyList
	ServiceList       *corev1.ServiceList
}

FirewallResources holds the k8s entities that serve as input for the generation of firewall rules.

type FirewallRules

type FirewallRules struct {
	IngressRules []string
	EgressRules  []string
}

FirewallRules hold the nftable rules that are generated from k8s entities.

func (*FirewallRules) HasChanged

func (r *FirewallRules) HasChanged(oldRules *FirewallRules) bool

HasChanged checks whether new firewall rules have changed in comparison to the last run

func (*FirewallRules) Render

func (r *FirewallRules) Render() (string, error)

Render renders the firewall rules to a string

Jump to

Keyboard shortcuts

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