Skip to main content
Version: latest

Configure networkd to Prepare Host for Overlay Network

Kubernetes clusters expect stable IP addresses that are not always possible in Edge network environments. Palette Edge allows you to enable an overlay network to ensure the cluster has stable IP addresses even if the underlying physical IPs change.

However, overlay networks on Palette clusters rely on systemd-networkd and systemd-resolved to function. Since clusters deployed in agent mode have independent Operating System (OS) configurations that are not managed by the Palette agent, you must configure your host OS properly to meet the prerequisites before creating your cluster.

This guide walks you through configuring your host to use systemd-networkd for interface management and systemd-resolved for DNS resolution. If your host already uses these services, you can skip this guide entirely. You can use the Validate steps to verify if your host already uses systemd-networkd and systemd-resolved.

Prerequisites

  • This guide assumes your host uses Ubuntu as its OS. If you use a different OS distribution, you may need to find the equivalent commands that can accomplish the same goals in your OS.

  • A Linux host that meets the minimum requirements for agent mode deployments.

Configure networkd

You can configure your host to make it overlay-ready either by issuing commands in the terminal to install the prerequisite packages and configuring them, or by using a declarative block in the installer configuration user data to run those commands automatically during agent installation.

  1. Issue the following commands to enable and restart systemd-resolved, and create a symlink between /run/systemd/resolve/resolv.conf and /etc/resolv.conf. This ensures that systemd-resolved starts managing DNS resolution for your host immediately.

    sudo systemctl enable systemd-resolved
    sudo systemctl restart systemd-resolved
    sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
  2. Create a backup of your current network configurations and remove them. The following commands are an example of how to create a backup if you are using netplan.

    sudo mkdir -p /etc/netplan/backup
    sudo mv /etc/netplan/*.yaml /etc/netplan/backup/
  3. Issue the following command to mask the service systemd-networkd-wait-online.service. This prevents the system from waiting for the network to come online at boot.

    sudo systemctl mask systemd-networkd-wait-online.service
  4. Issue the following commands to create a configuration file for systemd-networkd. This configuration tells systemd-networkd to manage all interfaces with names starting with en. If your network interfaces have different naming schemes, change this pattern so that the configuration matches.

    cat > /etc/systemd/network/20-dhcp.network << EOF
    [Match]
    Name=en*
    [Network]
    DHCP=yes
    [DHCP]
    ClientIdentifier=mac
    EOF
  5. Issue the following commands to enable and restart systemd-networkd. If you are connected to your host with an SSH connection, this may terminate the session because your host IP may change.

    sudo systemctl enable systemd-networkd
    sudo systemctl restart systemd-networkd
  6. You have now configured your host to use systemd-networkd for DNS resolution and interface management. This host now meets the network prerequisites for enabling network overlay.

Validate

Use the following steps to ensure that your interfaces are now managed by systemd-networkd.

  1. Issue the following command to retrieve the list of your network interfaces.

    networkctl

    networkctl is installed as part of the systemd package. If networkctl is not installed, then it is unlikely that your network is being managed by systemd-networkd.

    Look for entries similar to the following showing names and types of your interfaces.

    IDX LINK   TYPE     OPERATIONAL SETUP
    1 lo loopback carrier unmanaged
    2 enp0s3 ether routable configured
  2. Issue the following command for interfaces whose TYPE is not loopback.

    networkctl status enp0s3

    Look for the following to confirm that your expected interfaces are managed by systemd-networkd.

    Managed by: systemd-networkd

    This confirms that your host is using systemd-networkd for interface management.

  3. Issue the following command to confirm the systemd-resolved service is active.

    systemctl is-active systemd-resolved
  4. Issue the following command to check if /etc/resolv.conf is symlinked to /run/systemd/resolve/resolv.conf.

    readlink -f /etc/resolv.conf

    The expected output should be the following. This output, together with the service itself being active, confirms that your host uses systemd-resolved for DNS management.

    /run/systemd/resolve/resolv.conf

Next Steps

The overlay network can only be enabled during cluster creation. Once a cluster is already created, you cannot enable the overlay network without first tearing down the cluster. Refer to Enable Overlay Network - Centrally Managed Cluster to learn more about whether or not you should enable network overlay.

Refer to Create Local Cluster to learn how to create a local cluster and choose whether to enable the overlay network.