network-policy

by joaquinito2051

Helm chartv1.0.3App v1

A Helm chart for Kubernetes that manages Network policies

About this chart

🌐📝 Network Policy

Network policy chart for creating rules on Network traffic in a Namespace. This chart's defaults contains an example for multitenant ingress for a namespace by denying all traffic, then allowing specific pod to pod communication and ingress traffic in from the OpenShift routers' namespace. An example policy is also included to allow prometheus scrape metrics from the project.

Installing the chart

To install the chart:

$ helm template my-policy -f network-policy/values.yaml network-policy | oc apply -n my-project -f-

The above command creates objects with default configuration.

To run the chart and remove some of the configuration, for example the multitenant_policies:

$  helm template my-policy -f network-policy/values.yaml network-policy --set multitenant_policies= | oc apply -n my-project -f-

Configuration

The following table lists the configurable parameters of the Network Policy chart and their default values.

ParameterDescriptionDefault
enabledToggle to enable or disable this charttrue
multitenant_policiesAn array of standard rules to isolate a namespace traffic from other pod commssee values file.
policiesRules for allowing or disallowing pod comms in an NSsee values file
policies.namename for the network policyeg my-cool-rule
policies.specSpec for the network rules - to match OpenShift network plicy rules see here for deetssee values file...

Deploy network-policy with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has network-policy 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 chartnetwork-policy is pinned at v1.0.3 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