|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * microshift_configuring/microshift-using-config-tools.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="microshift-nw-ipv6-dual-stack-migrating-config_{context}"] |
| 7 | += Migrating a {microshift-short} cluster to IPv6 dual-stack networking |
| 8 | + |
| 9 | +You can convert a single-stack cluster to dual-stack cluster networking that supports IPv4 and IPv6 address families by setting two entries in the service and cluster network parameters in the {microshift-short} configuration file. |
| 10 | + |
| 11 | +* The first IP family in the configuration is the primary IP stack in the cluster. |
| 12 | +* {microshift-short} system pods and services are automatically updated upon {microshift-short} restart. |
| 13 | +* After the cluster is migrated to dual-stack networking and has restarted, enable workload pods and services for dual-stack networking by restarting them. |
| 14 | +
|
| 15 | +[IMPORTANT] |
| 16 | +==== |
| 17 | +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. |
| 18 | +==== |
| 19 | + |
| 20 | +[IMPORTANT] |
| 21 | +==== |
| 22 | +When using dual-stack networking where IPv6 is required, you cannot use IPv4-mapped IPv6 addresses, such as `::FFFF:198.51.100.1`. |
| 23 | +==== |
| 24 | + |
| 25 | +.Prerequisites |
| 26 | + |
| 27 | +* You installed the OpenShift CLI (`oc`). |
| 28 | +* You have root access to the cluster. |
| 29 | +* Your cluster uses the OVN-Kubernetes network plugin. |
| 30 | +* The host has both IPv4 and IPv6 addresses and routes, including a default for each. |
| 31 | +* The host has at least two L3 networks, IPv4 and IPv6. |
| 32 | +
|
| 33 | +.Procedure |
| 34 | + |
| 35 | +. 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`. |
| 36 | + |
| 37 | +. Keep the new {microshift-short} `config.yaml` in the `/etc/microshift/` directory. Your `config.yaml` file is read every time the {microshift-short} service starts. |
| 38 | ++ |
| 39 | +[NOTE] |
| 40 | +==== |
| 41 | +After you create it, the `config.yaml` file takes precedence over built-in settings. |
| 42 | +==== |
| 43 | + |
| 44 | +. Add IPv6 configurations to the `network` section of the {microshift-short} YAML with your valid values: |
| 45 | ++ |
| 46 | +[WARNING] |
| 47 | +==== |
| 48 | +You must keep the same first entry across restarts and migrations. This is true for any migration: single-to-dual stack, or dual-to-single stack. A complete wipe of the etcd database is required if a change to the first entry is needed. This might result in application data loss and is not supported. |
| 49 | +==== |
| 50 | ++ |
| 51 | +.. Add an IPv6 configuration for a second network in the `network` section of the {microshift-short} YAML with your valid values. |
| 52 | + |
| 53 | +.. Add network assignments to the `network` section of the {microshift-short} `config.yaml` to enable dual stack with IPv6 as secondary network. |
| 54 | ++ |
| 55 | +.Example dual-stack IPv6 configuration with network assignments |
| 56 | ++ |
| 57 | +[source,terminal] |
| 58 | +---- |
| 59 | +# ... |
| 60 | +apiServer: |
| 61 | + subjectAltNames: |
| 62 | + - 192.168.113.117 |
| 63 | + - 2001:db9:ca7:ff::1db8 <1> |
| 64 | +network: |
| 65 | + clusterNetwork: |
| 66 | + - 10.42.0.0/16 <2> |
| 67 | + - fd01::/48 <3> |
| 68 | + serviceNetwork: |
| 69 | + - 10.43.0.0/16 |
| 70 | + - fd02::/112 <4> |
| 71 | +node: |
| 72 | + nodeIP: 192.168.113.117 <5> |
| 73 | + nodeIPv6: 2001:db9:ca7:ff::1db8 <6> |
| 74 | +# ... |
| 75 | +---- |
| 76 | +<1> The IPv6 node address. |
| 77 | +<2> IPv4 network. Specify a `clusterNetwork` with a CIDR value that is less than `24`. |
| 78 | +<3> IPv6 network. Specify a `clusterNetwork` with a CIDR value that is less than `64`. |
| 79 | +<4> 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. |
| 80 | +<5> Example node IP address. Maintain the previous IPv4 IP address. |
| 81 | +<6> Example node IP address. Must be an IPv6 address family. |
| 82 | + |
| 83 | +. Complete any other configurations you require, then restart {microshift-short} by running the following command: |
| 84 | ++ |
| 85 | +[source,terminal] |
| 86 | +---- |
| 87 | +$ sudo systemctl restart microshift |
| 88 | +---- |
| 89 | + |
| 90 | +. Restart any additional services and installed applications. |
| 91 | + |
| 92 | +.Verification |
| 93 | + |
| 94 | +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: |
| 95 | + |
| 96 | +. Retrieve the status of the pods by running the following command: |
| 97 | ++ |
| 98 | +[source,terminal] |
| 99 | +---- |
| 100 | +$ oc get pod -A -o wide |
| 101 | +---- |
| 102 | ++ |
| 103 | +.Example output |
| 104 | ++ |
| 105 | +[source,text] |
| 106 | +---- |
| 107 | +NAMESPACE NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES |
| 108 | +kube-system csi-snapshot-controller-bb7cb654b-7s5ql 1/1 Running 0 46m 10.42.0.6 microshift-9 <none> <none> |
| 109 | +kube-system csi-snapshot-webhook-95f475949-jrqv8 1/1 Running 0 46m 10.42.0.4 microshift-9 <none> <none> |
| 110 | +openshift-dns dns-default-zxkqn 2/2 Running 0 46m 10.42.0.5 microshift-9 <none> <none> |
| 111 | +openshift-dns node-resolver-r2h5z 1/1 Running 0 46m 192.168.113.117 microshift-9 <none> <none> |
| 112 | +openshift-ingress router-default-5b75594b4-228z7 1/1 Running 0 2m5s 10.42.0.3 microshift-9 <none> <none> |
| 113 | +openshift-ovn-kubernetes ovnkube-master-bltk7 4/4 Running 2 (2m32s ago) 2m36s 192.168.113.117 microshift-9 <none> <none> |
| 114 | +openshift-ovn-kubernetes ovnkube-node-9ghgs 1/1 Running 2 (2m32s ago) 46m 192.168.113.117 microshift-9 <none> <none> |
| 115 | +openshift-service-ca service-ca-5d7bd9db6-qgwgw 1/1 Running 0 46m 10.42.0.7 microshift-9 <none> <none> |
| 116 | +openshift-storage lvms-operator-656cd9b59b-8rpf4 1/1 Running 0 46m 10.42.0.8 microshift-9 <none> <none> |
| 117 | +openshift-storage vg-manager-wqmh4 1/1 Running 2 (2m39s ago) 46m 10.42.0.10 microshift-9 <none> <none> |
| 118 | +---- |
| 119 | + |
| 120 | +. Retrieve the networks defined by the OVN-K network plugin by running the following command: |
| 121 | ++ |
| 122 | +[source,terminal] |
| 123 | +---- |
| 124 | +$ oc get pod -n openshift-ovn-kubernetes ovnkube-master-bltk7 -o jsonpath='{.status.podIPs}' |
| 125 | +---- |
| 126 | ++ |
| 127 | +.Example output |
| 128 | +[source,text] |
| 129 | +---- |
| 130 | +[{"ip":"192.168.113.117"},{"ip":"2001:db9:ca7:ff::1db8"}] |
| 131 | +---- |
| 132 | + |
| 133 | +. Retrieve the networks defined in the node resource by running the following command: |
| 134 | ++ |
| 135 | +[source,terminal] |
| 136 | +---- |
| 137 | +$ oc get pod -n openshift-ingress router-default-5b75594b4-228z7 -o jsonpath='{.status.podIPs}' |
| 138 | +---- |
| 139 | ++ |
| 140 | +.Example output |
| 141 | +[source,text] |
| 142 | +---- |
| 143 | +[{"ip":"10.42.0.3"},{"ip":"fd01:0:0:1::3"}] |
| 144 | +---- |
| 145 | + |
| 146 | +[NOTE] |
| 147 | +==== |
| 148 | +To return to single-stack networking, you can remove the second entry to the networks and return to the single stack that was configured before migrating to dual-stack. |
| 149 | +==== |
0 commit comments