networkpolicy

package
v1.17.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"network-policy-validator",
	"Validates CNPs and CCNPs and reports their validity status",

	cell.Config(defaultConfig),
	cell.Invoke(registerPolicyValidator),
)
View Source
var SecretSyncCell = cell.Module(
	"netpol-secretsync-watcher",
	"Watches network policy updates for TLS secrets to sync",

	cell.Config(networkPolicyConfig{
		EnablePolicySecretsSync: false,
		PolicySecretsNamespace:  "cilium-secrets",
	}),
	cell.Provide(registerCNPSecretSync),
	cell.Provide(registerCCNPSecretSync),
)

SecretSyncCell manages the Network Policy related controllers.

Functions

func EnqueueTLSSecrets

func EnqueueTLSSecrets(c client.Client, logger *slog.Logger) handler.EventHandler

EnqueueTLSSecrets returns a map function that, given a CiliumNetworkPolicy or CilumClusterwideNetworkPolicy, will return a slice of requests for any Secrets referenced in that CiliumNetworkPolicy.

This includes both TLS secrets (Origination or Termination), plus Secrets used for storing header values.

func IsReferencedByCiliumClusterwideNetworkPolicy

func IsReferencedByCiliumClusterwideNetworkPolicy(ctx context.Context, c client.Client, logger *slog.Logger, obj *corev1.Secret) bool

func IsReferencedByCiliumNetworkPolicy

func IsReferencedByCiliumNetworkPolicy(ctx context.Context, c client.Client, logger *slog.Logger, obj *corev1.Secret) bool

Types

type Config

type Config struct {
	ValidateNetworkPolicy bool `mapstructure:"validate-network-policy"`
}

func (Config) Flags

func (def Config) Flags(flags *pflag.FlagSet)

type PolicyParams

type PolicyParams struct {
	cell.In

	Logger       *slog.Logger
	JobGroup     job.Group
	Clientset    k8s_client.Clientset
	DaemonConfig *option.DaemonConfig

	Cfg Config

	CNPResource  resource.Resource[*cilium_api_v2.CiliumNetworkPolicy]
	CCNPResource resource.Resource[*cilium_api_v2.CiliumClusterwideNetworkPolicy]
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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