- op: add
path: /spec/clusterNetwork/-
value: (1)
cidr: fd01::/48
hostPrefix: 64
- op: add
path: /spec/serviceNetwork/-
value: fd02::/112 (2)
As a cluster administrator, you can convert your IPv4 single-stack cluster to a dual-network cluster network that supports IPv4 and IPv6 address families. After converting to dual-stack, all newly created pods are dual-stack enabled.
|
As a cluster administrator, you can convert your single-stack cluster network to a dual-stack cluster network.
After converting to dual-stack networking only newly created pods are assigned IPv6 addresses. Any pods created before the conversion must be recreated to receive an IPv6 address. |
You installed the OpenShift CLI (oc
).
You are logged in to the cluster with a user with cluster-admin
privileges.
Your cluster uses the OVN-Kubernetes network plugin.
The cluster nodes have IPv6 addresses.
You have configured an IPv6-enabled router based on your infrastructure.
To specify IPv6 address blocks for the cluster and service networks, create a file containing the following YAML:
- op: add
path: /spec/clusterNetwork/-
value: (1)
cidr: fd01::/48
hostPrefix: 64
- op: add
path: /spec/serviceNetwork/-
value: fd02::/112 (2)
1 | Specify an object with the cidr and hostPrefix parameters. The host prefix must be 64 or greater. The IPv6 Classless Inter-Domain Routing (CIDR) prefix must be large enough to accommodate the specified host prefix. |
2 | Specify 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. |
To patch the cluster network configuration, enter the following command:
$ oc patch network.config.openshift.io cluster \
--type='json' --patch-file <file>.yaml
where:
file
Specifies the name of the file you created in the previous step.
network.config.openshift.io/cluster patched
Complete the following step to verify that the cluster network recognizes the IPv6 address blocks that you specified in the previous procedure.
Display the network configuration:
$ oc describe network
Status:
Cluster Network:
Cidr: 10.128.0.0/14
Host Prefix: 23
Cidr: fd01::/48
Host Prefix: 64
Cluster Network MTU: 1400
Network Type: OVNKubernetes
Service Network:
172.30.0.0/16
fd02::/112
As a cluster administrator, you can convert your dual-stack cluster network to a single-stack cluster network.
If you originally converted your IPv4 single-stack cluster network to a dual-stack cluster, you can convert only back to the IPv4 single-stack cluster and not an IPv6 single-stack cluster network. The same restriction applies for converting back to an IPv6 single-stack cluster network. |
You installed the OpenShift CLI (oc
).
You are logged in to the cluster with a user with cluster-admin
privileges.
Your cluster uses the OVN-Kubernetes network plugin.
The cluster nodes have IPv6 addresses.
You have enabled dual-stack networking.
Edit the networks.config.openshift.io
custom resource (CR) by running the following command:
$ oc edit networks.config.openshift.io
Remove the IPv4 or IPv6 configuration that you added to the cidr
and the hostPrefix
parameters from completing the "Converting to a dual-stack cluster network " procedure steps.