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.
|
|
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 |
-
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.
-
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 assignmentsapiServer: # ... 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
clusterNetworkwith a CIDR value that is less than64. network.serviceNetwork-
Specifies an IPv6 CIDR with a prefix of
112. Kubernetes uses only the lowest 16 bits. For a prefix of112, IP addresses are assigned from112to128bits. node.nodeIP-
Specifies an IPv4 address family.
node.nodeIPv6-
Specifies 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.
-
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"}]
-