Configure IPv6 dual-stack networking before MicroShift starts

To run your MicroShift node with IPv4 and IPv6 dual-stack networking, you can configure the network section in the configuration file before starting the service.

  • The first IP family in the configuration is the primary IP stack in the node.

  • After the node is running with dual-stack networking, enable application pods and add-on services for dual-stack by restarting them.

Important

The OVN-Kubernetes network plugin requires that both IPv4 and IPv6 default routes be on the same network device. IPv4 and IPv6 default routes on separate network devices is not supported.

Important

When using dual-stack networking where IPv6 is required, you cannot use IPv4-mapped IPv6 addresses, such as ::FFFF:198.51.100.1.

Prerequisites
  • You installed the OpenShift CLI (oc).

  • You have root access to the node.

  • Your node uses the OVN-Kubernetes network plugin.

  • The host has both IPv4 and IPv6 addresses and routes, including a default for each.

  • The host has at least two L3 networks, IPv4 and IPv6.

Procedure
  1. If you have not done so, make a copy of the provided config.yaml.default file in the /etc/microshift/ directory, renaming it config.yaml.

  2. Keep the new MicroShift config.yaml in the /etc/microshift/ directory. Your config.yaml file is read every time the MicroShift service starts.

    Note

    After you create it, the config.yaml file takes precedence over built-in settings.

  3. If you have not started MicroShift, replace the default values in the network section of the MicroShift YAML with your valid values.

    Example dual-stack IPv6 networking configuration with network assignments
    apiServer:
    # ...
    apiServer:
      subjectAltNames:
      - 192.168.113.117
      - 2001:db9:ca7:ff::1db8
    network:
      clusterNetwork:
      - 10.42.0.0/16
      - fd01::/48
      serviceNetwork:
      - 10.43.0.0/16
      - fd02::/112
    node:
      nodeIP: 192.168.113.117
      nodeIPv6: 2001:db9:ca7:ff::1db8
    # ...

    where:

    network.clusterNetwork

    Specifies an IPv6 clusterNetwork with a CIDR value that is less than 64.

    network.serviceNetwork

    Specifies an IPv6 CIDR with a prefix of 112. Kubernetes uses only the lowest 16 bits. For a prefix of 112, IP addresses are assigned from 112 to 128 bits.

    node.nodeIP

    Specifies an IPv4 address family.

    node.nodeIPv6

    Specifies an IPv6 address family. Configurable only with dual-stack networking.

  4. Complete any other MicroShift configurations you require, then start MicroShift by running the following command:

    $ sudo systemctl start microshift
  5. Reset the IP family policy for application pods and services as needed, then restart those application pods and services to enable dual-stack networking. See "Resetting the IP family policy for application pods and services" for a simple example.

Verification
  1. You can verify that all of the system services and pods to have two IP addresses, one for each family, by using the following steps:

    1. Retrieve the networks defined in the node resource by running the following command:

      $ oc get pod -n openshift-ingress router-default-5b75594b4-w7w6s -o jsonpath='{.status.podIPs}'
      Example output
      [{"ip":"10.42.0.4"},{"ip":"fd01:0:0:1::4"}]
    2. Retrieve the networks defined by the host network pods by running the following command:

      $ oc get pod -n openshift-ovn-kubernetes ovnkube-master-2fm2k -o jsonpath='{.status.podIPs}'
      Example output
      [{"ip":"192.168.113.117"},{"ip":"2001:db9:ca7:ff::1db8"}]