Skip to content

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. KS NetworkPoliciesOverview

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.

KS NetworkPolicies

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).

KS NetworkPoliciesIpBased

Input parameters ​

FieldDescription
NameName of the network policy
DescriptionDescription of the network policy (optional)
Policy TypeIP Based
DirectionDirection of the traffic (Ingress or Egress)
Action (static)Action of the Network Policy (Allow or Drop). Derived from Environment Isolation mode.
SourceSource IP range in CIDR notation (e.g. 192.168.0.0/24)
DestinationDestination IP range in CIDR notation (e.g. 192.168.0.0/24)
PortsDestination Port

Example ​

Use-case: SSH Traffic incoming to K8s Worker Nodes from a Jumphost

KS NetworkPoliciesIpBasedExample

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.

KS NetworkPoliciesLabelBased

Input parameters ​

FieldDescription
NameName of the network policy
DescriptionDescription of the network policy (optional)
Policy TypeLabel Based
Cluster IDUnique ID of the cluster (the Cluster ID can be retrieved from the url, for details check the Support section)
Source or DestinationIP range in CIDR notation (e.g. 192.168.0.0/24)
Portssee Protocols and Ports

Example ​

Use-case: Traffic outgoing from a K8s Cluster to an external database.

KS NetworkPoliciesLabelBasedExample

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).

KS NetworkPoliciesLabelBased