admin-networkpolicies

by tjungbauer

Helm chartv1.0.11Apache-2.0Verified publisher

Configure AdminNetworkPolicy and BaselineNetworkPolicy resources for a cluster.

About this chart

admin-networkpolicies

Description

Configure AdminNetworkPolicy and BaselineNetworkPolicy resources for a cluster.

This Helm Chart configured AdminNetworkPolicy and BaselineAdminNetworkPolicy objects. See examples in the values.yaml file and at https://blog.stderr.at/openshift/2024/11/introducting-adminnetworkpolicies/ for detail information.

Dependencies

This chart has the following dependencies:

RepositoryNameVersion
https://charts.stderr.at/tpl~1.0.31

Maintainers

NameEmailUrl
tjungbauer[email protected]https://blog.stderr.at/

Sources

Source:

Source code: https://github.com/tjungbauer/helm-charts/tree/main/charts/admin-networkpolicies

Values

Generic - ANP

KeyTypeDefaultDescription
anplist''AdminNetworkPolicy
anp[0]objectN/AName of the AdminNetworkPolicy. Only Applicable for ANP.
anp[0].enabledboolfalseEnable this ANP or not. You must explicitly set this to "true"
anp[0].priorityint50Priority is a value from 0 to 1000 (0-99 according to OpenShift documentation). Policies with lower priority values have higher precedence, and are checked before policies with higher priority values. Any ANP should have a unique priority
anp[0].syncwaveint10Syncwave for Argo CD

Egress Rules

KeyTypeDefaultDescription
anp[0].egresslist[]Egress is the list of Egress rules to be applied to the selected pods. A maximum of 100 rules can be defined per ANP. The priority of the rules will be determined by the order the rule is written. Therefore, the first rule will have the highest precedence.
anp[0].egress[0]objectN/AName of the egress rule
anp[0].egress[0].enabledboolfalseEnable of disable this specific rule
anp[0].egress[0].peerslistN/APeers is a list of matching rules. This can be: - namespaces: Select namespaces using labels or names - pods: Select pods using labels for pods and namespaces - nodes: Select Nodes using match expressions - networks: Select IP addresses using CIDR notation - domainNames: Select domains using DNS notation See values.yaml for exmples
anp[0].egress[0].portslistN/APorts is a list of matching rules. This can be: portNumber: Select a specific port number portName: Select a specific port name
banp[0].egresslist[]Egress is the list of Egress rules to be applied to the selected pods. Therefore, the first rule will have the highest precedence.

Ingress Rules

KeyTypeDefaultDescription
anp[0].egress[0].actionstringDenyAction for this rule, can be Allow, Pass or Deny for ANPs. For BANP only Allow and Deny are possible.
anp[0].ingresslist[]Ingress is the list of Ingress rules to be applied to the selected pods. A maximum of 100 rules can be defined per ANP. The priority of the rules will be determined by the order the rule is written. Therefore, the first rule will have the highest precedence.
anp[0].ingress[0]objectN/AName of the ingress rule
anp[0].ingress[0].actionstringDenyAction for this rule, can be Allow, Pass or Deny for ANPs. For BANP only Allow and Deny are possible.
anp[0].ingress[0].enabledboolfalseEnable of disable this specific rule
anp[0].ingress[0].peerslistN/APeers is a list of matching rules. This can be: - namespaces: Select namespaces using labels or names - pods: Select pods using labels for pods and namespaces - nodes: Select Nodes using match expressions - networks: Select IP addresses using CIDR notation - domainNames: Select domains using DNS notation See values.yaml for exmples
anp[0].ingress[2].portslistN/APorts is a list of matching rules. This can be: portNumber: Select a specific port number portName: Select a specific port name If a port range shall be defined, use portStart and portEnd portStart: start port portEnd: End port
banp[0].ingresslist[]Ingress is the list of Ingress rules to be applied to the selected pods. Therefore, the first rule will have the highest precedence.

Subject

KeyTypeDefaultDescription
anp[0].subjectobjectN/ASubject defines the pods to which this Policy applies. Note that host-networked pods are not included in subject selection. Can be namespaces or pods that are selected. If subject is empty (subject: {}, then ALL namespaces, including OpenShift namespaces are selected. Use this with caution. NOTE: Below is a full example used for documentation only. Choose which subject works best for you.
anp[0].subject.matchNamespaces.matchLabelsobjectN/ASelect Namespaces using matchLabels. The labels must exist on the Namespace
banp[0].subjectobjectN/ASubject defines the pods to which this Policy applies. Note that host-networked pods are not included in subject selection. Can be namespaces or pods that are selected. If subject is empty (subject: {}, then ALL namespaces, including OpenShift namespaces are selected. Use this with caution. NOTE: Below is a full example used for documentation only. Choose which subject works best for you.
banp[0].subject.matchNamespacesobjectN/AmatchNamespaces is used to select pods via namespace selectors.
banp[0].subject.matchNamespaces.matchLabelsobjectN/ASelect Namespaces using matchLabels. The labels must exist on the Namespace

Generic - BANP

KeyTypeDefaultDescription
banplist''BaselineAdminNetworkPolicy NOTE: BANP cannot set an object name
banp[0]objectfalseEnable this ANP or not. You must explicitly set this to "true"
banp[0].syncwaveint10Syncwave for Argo CD

Installing the Chart

To install the chart with the release name my-release:

helm install my-release tjungbauer/<chart-name>>

The command deploys the chart on the Kubernetes cluster in the default configuration.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.


Autogenerated from chart metadata using helm-docs v1.14.2

Deploy admin-networkpolicies with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has admin-networkpolicies on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartadmin-networkpolicies is pinned at v1.0.11 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply