admin-networkpolicies
by tjungbauer
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:
| Repository | Name | Version |
|---|---|---|
| https://charts.stderr.at/ | tpl | ~1.0.31 |
Maintainers
| Name | Url | |
|---|---|---|
| tjungbauer | [email protected] | https://blog.stderr.at/ |
Sources
Source:
- https://github.com/tjungbauer/helm-charts
- https://charts.stderr.at/
- https://github.com/tjungbauer/openshift-clusterconfig-gitops
- https://blog.stderr.at/openshift/2024/11/introducting-adminnetworkpolicies/
Source code: https://github.com/tjungbauer/helm-charts/tree/main/charts/admin-networkpolicies
Values
Generic - ANP
| Key | Type | Default | Description |
|---|---|---|---|
| anp | list | '' | AdminNetworkPolicy |
| anp[0] | object | N/A | Name of the AdminNetworkPolicy. Only Applicable for ANP. |
| anp[0].enabled | bool | false | Enable this ANP or not. You must explicitly set this to "true" |
| anp[0].priority | int | 50 | Priority 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].syncwave | int | 10 | Syncwave for Argo CD |
Egress Rules
| Key | Type | Default | Description |
|---|---|---|---|
| anp[0].egress | list | [] | 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] | object | N/A | Name of the egress rule |
| anp[0].egress[0].enabled | bool | false | Enable of disable this specific rule |
| anp[0].egress[0].peers | list | N/A | Peers 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].ports | list | N/A | Ports is a list of matching rules. This can be: portNumber: Select a specific port number portName: Select a specific port name |
| banp[0].egress | list | [] | 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
| Key | Type | Default | Description |
|---|---|---|---|
| anp[0].egress[0].action | string | Deny | Action for this rule, can be Allow, Pass or Deny for ANPs. For BANP only Allow and Deny are possible. |
| anp[0].ingress | list | [] | 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] | object | N/A | Name of the ingress rule |
| anp[0].ingress[0].action | string | Deny | Action for this rule, can be Allow, Pass or Deny for ANPs. For BANP only Allow and Deny are possible. |
| anp[0].ingress[0].enabled | bool | false | Enable of disable this specific rule |
| anp[0].ingress[0].peers | list | N/A | Peers 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].ports | list | N/A | Ports 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].ingress | list | [] | Ingress is the list of Ingress rules to be applied to the selected pods. Therefore, the first rule will have the highest precedence. |
Subject
| Key | Type | Default | Description |
|---|---|---|---|
| anp[0].subject | object | N/A | Subject 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.matchLabels | object | N/A | Select Namespaces using matchLabels. The labels must exist on the Namespace |
| banp[0].subject | object | N/A | Subject 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.matchNamespaces | object | N/A | matchNamespaces is used to select pods via namespace selectors. |
| banp[0].subject.matchNamespaces.matchLabels | object | N/A | Select Namespaces using matchLabels. The labels must exist on the Namespace |
Generic - BANP
| Key | Type | Default | Description |
|---|---|---|---|
| banp | list | '' | BaselineAdminNetworkPolicy NOTE: BANP cannot set an object name |
| banp[0] | object | false | Enable this ANP or not. You must explicitly set this to "true" |
| banp[0].syncwave | int | 10 | Syncwave 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartadmin-networkpolicies is pinned at v1.0.11 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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