Skip to content

Egress SNAT ​

By defining SNAT rules, you can make use of Source Network Address Translation for the northbound network traffic (that is traffic exiting the KS Environment), for any machine deployment nodes belonging to clusters in a project.

To make use of this feature, you must:

  • create a Rule
  • add a label with the key esc.kubernetes.service/egress-nat-key to the relevant Machine Deployments

Rules belong to projects. Create a project if you haven't already. Every rule will be charged based on its specific pricing tier per hour.

⚠️ Important

Once the rule is created and the machine deployment has the label set (see below), all traffic from all nodes of the given machine deployment will be NATed! This includes fetching container images from your registry. Make sure to have all necessary connectivity ordered and allowed for the selected network ranges!

⚠️ Important

The total length of (tenant name + tufin zone + label value) cannot be bigger than 39 characters.

Create rule ​

To create a rule:

  1. Navigate to the desired KS Environment and project within the ESC Management Portal.
  2. Click on the "Kubernetes Egress Nat Rules" tab in the navigation menu.
  3. An overview of existing rules will be displayed.
  4. To create a new rule, click the "Add Kubernetes Egress Nat Rule" button located in the top right corner of the page.
  5. Fill in the details in the form:
    • Name: a descriptive name for the rule.
    • Description: brief summary of the rule's purpose.
    • Technical Contact Email: contact email for technical lead or support
    • Label Value: Kubernetes label value to select the machine deployment nodes by (eg: backend-api). This lable value is unique per project and cannot be modified afterwards. See the next section on how to label the machine deployment nodes.
    • Networks:
      • Click Add Network and fill in the details in the form:
        • Location: choose the location where the machine deployment nodes are running
        • Aggregate: choose service network
        • Network Range: choose network range - these will be the source IPs
        • Click Save
      • Repeat the process for all desired locations.
    • Tufin Zone: choose zone if one is available
  6. Click "Submit" to create the new rule
  7. Once the rule has been created, SNAT will be enabled for matching machine deployment nodes.

💡 Note

The "Label Value" property cannot be modified after creation.

💡 Note

The Network Ranges (source IPs) must be unique within the KS Environment.

Update rule ​

To update a rule:

  1. Navigate to the desired KS Environment and project.
  2. Click on the "Kubernetes Egress Nat Rules" tab in the navigation menu.
  3. An overview of existing rules will be displayed.
  4. To update a rule, click on it
  5. Fill in the details in the form:
    • Name: a descriptive name for the rule.
    • Description: brief summary of the rule's purpose.
    • Networks: add and delete new items as desired
  6. Click "Submit" to update the rule
  7. Once the rule has been updated, SNAT will be updated for the matching machine deployment nodes.

Delete rule ​

  1. Navigate to the desired KS Environment and project.
  2. Click on the "Kubernetes Egress Nat Rules" tab in the navigation menu.
  3. An overview of existing rules will be displayed.
  4. Click on the rule that should be deleted.
  5. On the right-hand side, click "Delete Instance".
  6. Type DELETE to confirm, then click "Yes, Delete".
  7. Once the rule has been deleted, SNAT will be disabled for the matching machine deployment nodes.

Add label to new machine deployment ​

⚠️ Important

Make sure to define the label in the "Machine Deployment Labels" section at the bottom of the "Add Machine Deployment" page. Do not add the label to the "Node Labels", this will not work!

  1. Use the KKP Dashboard and navigate to the desired project and cluster.
  2. Click the "Add Machine Deployment" button to add a new machine deployment
  3. In the "Machine Deployment Labels" section add a new label
    • Key: use the value esc.kubernetes.service/egress-nat-key
    • Value: use the same value as when defining the egress SNAT rule, in the Label Value field (eg: backend-api)
  4. Finalize the creation of the machine deployment
  5. Once the new machine deployment nodes have been created, SNAT will be enabled as defined by the rules.

Update label on existing machine deployment ​

⚠️ Important

Make sure to define the label in the "Machine Deployment Labels" section at the bottom of the "Edit Machine Deployment" page. Do not add the label to the "Node Labels", this will not work!

  1. Use the KKP Dashboard and navigate to the desired project and cluster.
  2. Click the update icon for an existing machine deployment
  3. In the "Machine Deployment Labels" section add a new label
    • Key: use the value esc.kubernetes.service/egress-nat-key
    • Value: use the same value used when defining the egress SNAT rule, in the Label Value field (eg: backend-api)
  4. Finalize the update of the machine deployment
  5. Once the new machine deployment nodes have been created, SNAT will be enabled as defined by the rules.

Remove label on existing machine deployment ​

Follow the update procedure above to remove the label with the key esc.kubernetes.service/egress-nat-key.

The new machine deployment nodes will not make use of SNAT.