Appearance
Network Policies
Firewalls in Kubernetes Service environments are managed through Network Policies in the Portal.
There are 2 different types of rules; Drop or Accept rules. On any given environment only one type of rule is supported, depending on whether it was created with or without environment isolation (see Create Environment).
⚠️ Important
If the environment was created without environment isolation (default allow), only the external firewall and IP based rules are supported.
Overview
The Kubernetes Service Network Policies are implemented in an internal and an external Firewall. Depending on the use-case and the specific requirements, different types of policies can be created. 
Create new Network Policy
Navigate to the Kubernetes Service deployments and select the corresponding instance. Select the tab Network Policies to list all existing policies.

Click Add Policy to create a new Network Policy.
IP Based Network Policy
IP Based rules are only effective on north-south traffic, meaning for traffic entering or exiting a Kubernetes Cluster. It requires the specification of the traffic direction (ingress for incoming or egress for outgoing traffic). Both Source and Destination have to be specified as IP ranges in CIDR notation (e.g. 192.168.0.0/24).

Input parameters
| Field | Description |
|---|---|
| Name | Name of the network policy |
| Description | Description of the network policy (optional) |
| Policy Type | IP Based |
| Direction | Direction of the traffic (Ingress or Egress) |
| Action (static) | Action of the Network Policy (Allow or Drop). Derived from Environment Isolation mode. |
| Source | Source IP range in CIDR notation (e.g. 192.168.0.0/24) |
| Destination | Destination IP range in CIDR notation (e.g. 192.168.0.0/24) |
| Ports | Destination Port |
Example
Use-case: SSH Traffic incoming to K8s Worker Nodes from a Jumphost

Label Based Network Policy
Label-Based (ingress) policies control traffic from any source towards a Kubernetes Cluster within the environment. The source has to be defined by an IP range (in CIDR notation). The cluster is defined by the unique ID. Label-Based (egress) policies control traffic from a Kubernetes Cluster within the environment to any destination. The destination has to be defined by an IP range (in CIDR notation). The cluster is defined by the unique ID.

Input parameters
| Field | Description |
|---|---|
| Name | Name of the network policy |
| Description | Description of the network policy (optional) |
| Policy Type | Label Based |
| Cluster ID | Unique ID of the cluster (the Cluster ID can be retrieved from the url, for details check the Support section) |
| Source or Destination | IP range in CIDR notation (e.g. 192.168.0.0/24) |
| Ports | see Protocols and Ports |
Example
Use-case: Traffic outgoing from a K8s Cluster to an external database.

Supported Protocols and Ports
The Kubernetes Service Network Policies support multiple ports and protocols: TCP and UDP. Each entry has to contain the Protocol and the Port. If the optional End Port field is provided, the entire range of ports will be considered (all ports between Port and End Port).

