Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT - WIP] ANP global policies #297

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Image URL to use all building/pushing image targets
IMAGE ?= amazon/aws-network-policy-agent
IMAGE ?= public.ecr.aws/q1l2n4k8/npa
VERSION ?= $(shell git describe --tags --always --dirty || echo "unknown")
IMAGE_NAME = $(IMAGE)$(IMAGE_ARCH_SUFFIX):$(VERSION)
GOLANG_VERSION ?= $(shell cat .go-version)
Expand Down
12 changes: 12 additions & 0 deletions api/v1alpha1/policyendpoints_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ type Port struct {

// EndpointInfo defines the network endpoint information for the policy ingress/egress
type EndpointInfo struct {
// Action is the action to enforce on an IP/CIDR (Allow, Deny, Pass)
Action string `json:"action"`

// CIDR is the network address(s) of the endpoint
CIDR NetworkAddress `json:"cidr"`

Expand All @@ -72,6 +75,15 @@ type PodEndpoint struct {

// PolicyEndpointSpec defines the desired state of PolicyEndpoint
type PolicyEndpointSpec struct {
// IsGlobal specifies whether the parent policy is an admin policy
IsGlobal bool `json:"isGlobal"`

// Namespaces of the pod selector, will be empty for cluster wide
Namespaces []string `json:"namespaces"`

// Priority of the policy, lower value is higher priority
Priority int `json:"priority"`

// PodSelector is the podSelector from the policy resource
PodSelector *metav1.LabelSelector `json:"podSelector,omitempty"`

Expand Down
Loading
Loading