networkpolicy

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaselinePolicyNames = []string{
	baselinePolicyDenyAllIngress,
	baselinePolicyEgressIsolation,
}

BaselinePolicyNames lists the well-known names of baseline NetworkPolicies so callers can delete them when the feature is disabled.

Functions

func MakeBaselinePolicies

func MakeBaselinePolicies(params BaselinePolicyParams) []map[string]any

MakeBaselinePolicies returns two NetworkPolicy resources as map[string]any: 1. A deny-all ingress policy 2. An egress isolation policy that blocks cross-CP-namespace and cross-environment traffic

func MakeComponentPolicies

func MakeComponentPolicies(params ComponentPolicyParams) []map[string]any

MakeComponentPolicies returns NetworkPolicies for a component based on its declared endpoints. Currently generates an ingress policy; egress policies may be added in the future. Returns nil if no endpoints are defined.

Types

type BaselinePolicyParams

type BaselinePolicyParams struct {
	Namespace   string // data plane namespace name
	CPNamespace string // control plane namespace name
	Environment string // environment name (e.g., "development")
}

BaselinePolicyParams holds parameters for generating baseline (Layer 1) NetworkPolicies.

type ComponentPolicyParams

type ComponentPolicyParams struct {
	Namespace     string                                         // data plane namespace name
	CPNamespace   string                                         // control plane namespace name
	Environment   string                                         // environment name (e.g., "development")
	ComponentName string                                         // for naming the policy
	PodSelectors  map[string]string                              // platform pod selectors
	Endpoints     map[string]openchoreov1alpha1.WorkloadEndpoint // from workload spec
}

ComponentPolicyParams holds parameters for generating per-component (Layer 2) ingress NetworkPolicies.

Jump to

Keyboard shortcuts

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