4.3. Configuring IPv6 dual-stack networking before MicroShift starts
You can configure your MicroShift node to run on dual-stack networking that supports IPv4 and IPv6 address families by using 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.
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.
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
-
If you have not done so, make a copy of the provided
config.yaml.defaultfile in the/etc/microshift/directory, renaming itconfig.yaml. Keep the new MicroShift
config.yamlin the/etc/microshift/directory. Yourconfig.yamlfile is read every time the MicroShift service starts.注記After you create it, the
config.yamlfile takes precedence over built-in settings.If you have not started MicroShift, replace the default values in the
networksection 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::/481 serviceNetwork: - 10.43.0.0/16 - fd02::/1122 node: nodeIP: 192.168.113.1173 nodeIPv6: 2001:db9:ca7:ff::1db84 # ...- 1
- Specify an IPv6
clusterNetworkwith a CIDR value that is less than64. - 2
- Specify an IPv6 CIDR with a prefix of
112. Kubernetes uses only the lowest 16 bits. For a prefix of112, IP addresses are assigned from112to128bits. - 3
- Example node IP address. Must be an IPv4 address family.
- 4
- Example node IP address for dual-stack configuration. Must be an IPv6 address family. Configurable only with dual-stack networking.
Complete any other MicroShift configurations you require, then start MicroShift by running the following command:
$ sudo systemctl start microshift- 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
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:
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"}]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"}]