Skip to content

Commit e59c983

Browse files
committed
OCPBUGS-36255: Documented the failover VIP allowed_address_pairs
1 parent 3183f7f commit e59c983

File tree

2 files changed

+58
-32
lines changed

2 files changed

+58
-32
lines changed

modules/migration-migrating-on-prem-to-cloud.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ $ oc config view
4242

4343
. Establish a tunnel by entering the following command on the command system:
4444
+
45-
[source,terminal,sub="+quotes"]
45+
[source,terminal,subs="+quotes"]
4646
----
4747
$ crane tunnel-api [--namespace <namespace>] \
4848
--destination-context <destination-cluster> \

modules/nw-ipfailover-configuration.adoc

Lines changed: 57 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,31 @@
66
[id="nw-ipfailover-configuration_{context}"]
77
= Configuring IP failover in your cluster
88

9-
As a cluster administrator, you can configure IP failover on an entire cluster, or on a subset of nodes, as defined by the label selector. You can also configure multiple IP failover deployment configurations in your cluster, where each one is independent of the others.
9+
As a cluster administrator, you can configure IP failover on an entire cluster, or on a subset of nodes, as defined by the label selector. You can also configure multiple IP failover deployments in your cluster, where each one is independent of the others.
1010

11-
The IP failover deployment configuration ensures that a failover pod runs on each of the nodes matching the constraints or the label used.
11+
The IP failover deployment ensures that a failover pod runs on each of the nodes matching the constraints or the label used.
1212

1313
This pod runs Keepalived, which can monitor an endpoint and use Virtual Router Redundancy Protocol (VRRP) to fail over the virtual IP (VIP) from one node to another if the first node cannot reach the service or endpoint.
1414

1515
For production use, set a `selector` that selects at least two nodes, and set `replicas` equal to the number of selected nodes.
1616

1717
.Prerequisites
1818

19-
* You are logged in to the cluster with a user with `cluster-admin` privileges.
19+
* You are logged in to the cluster as a user with `cluster-admin` privileges.
2020
* You created a pull secret.
21+
* {rh-openstack-first} only:
22+
** You installed an link:https://docs.openstack.org/python-openstackclient/latest/[{rh-openstack} client ({op-system} documentation)] on the target environment.
23+
** You also downloaded the link:https://docs.openstack.org/zh_CN/user-guide/common/cli-set-environment-variables-using-openstack-rc.html[{rh-openstack} `openrc.sh` rc file ({op-system} documentation)].
2124
2225
.Procedure
2326

24-
//. Create an {product-title} pull secret
25-
//+
2627
. Create an IP failover service account:
2728
+
2829
[source,terminal]
2930
----
3031
$ oc create sa ipfailover
3132
----
32-
+
33+
3334
. Update security context constraints (SCC) for `hostNetwork`:
3435
+
3536
[source,terminal]
@@ -41,8 +42,57 @@ $ oc adm policy add-scc-to-user privileged -z ipfailover
4142
----
4243
$ oc adm policy add-scc-to-user hostnetwork -z ipfailover
4344
----
45+
46+
. {rh-openstack-first} only: Complete the following steps to make a failover VIP address reachable on {rh-openstack} ports.
47+
+
48+
.. Use the {rh-openstack} CLI to show the default {rh-openstack} API and VIP addresses in the `allowed_address_pairs` parameter of your {rh-openstack} cluster:
49+
+
50+
[source,terminal]
51+
----
52+
$ openstack port show <cluster_name> -c allowed_address_pairs
53+
----
54+
+
55+
.Output example
56+
[source,terminal,subs="+attributes"]
57+
----
58+
*Field* *Value*
59+
allowed_address_pairs ip_address='192.168.0.5', mac_address='fa:16:3e:31:f9:cb'
60+
ip_address='192.168.0.7', mac_address='fa:16:3e:31:f9:cb'
61+
----
62+
+
63+
.. Set a different VIP address for the IP failover deployment and make the address reachable on {rh-openstack} ports by entering the following command in the {rh-openstack} CLI. Do not set any default {rh-openstack} API and VIP addresses as the failover VIP address for the IP failover deployment.
64+
+
65+
.Example of adding the `1.1.1.1` failover IP address as an allowed address on {rh-openstack} ports.
66+
[source,terminal,subs="+attributes"]
67+
----
68+
$ openstack port set <cluster_name> --allowed-address ip-address=1.1.1.1,mac-address=fa:fa:16:3e:31:f9:cb
69+
----
70+
+
71+
.. Create a deployment YAML file to configure IP failover for your deployment. See "Example deployment YAML for IP failover configuration" in a later step.
72+
+
73+
.. Specify the following specification in the IP failover deployment so that you pass the failover VIP address to the `OPENSHIFT_HA_VIRTUAL_IPS` environment variable:
74+
+
75+
.Example of adding the `1.1.1.1` VIP address to `OPENSHIFT_HA_VIRTUAL_IPS`
76+
[source,yaml,subs="attributes,quotes"]
77+
----
78+
apiVersion: apps/v1
79+
kind: Deployment
80+
metadata:
81+
name: ipfailover-keepalived
82+
# ...
83+
spec:
84+
env:
85+
- name: OPENSHIFT_HA_VIRTUAL_IPS
86+
value: "1.1.1.1"
87+
# ...
88+
----
89+
90+
. Create a deployment YAML file to configure IP failover.
4491
+
45-
. Create a deployment YAML file to configure IP failover:
92+
[NOTE]
93+
====
94+
For {rh-openstack-first}, you do not need to re-create the deployment YAML file. You already created this file as part of the earlier instructions.
95+
====
4696
+
4797
.Example deployment YAML for IP failover configuration
4898
[source,yaml]
@@ -159,27 +209,3 @@ spec:
159209
<11> The strategy for handling a new higher priority host. The default value is `preempt_delay 300`, which causes a Keepalived instance to take over a VIP after 5 minutes if a lower-priority master is holding the VIP.
160210
<12> The period, in seconds, that the check script is run. The default value is `2`.
161211
<13> Create the pull secret before creating the deployment, otherwise you will get an error when creating the deployment.
162-
////
163-
+
164-
.Example service YAML for IP failover configuration
165-
[source,yaml]
166-
----
167-
apiVersion: v1
168-
kind: Service
169-
metadata:
170-
name: ipfailover-keepalived-service
171-
spec:
172-
ports:
173-
- port: 1985
174-
targetPort: 1985
175-
name: todo
176-
- port: 112
177-
targetPort: 112
178-
name: vrrp
179-
selector:
180-
ipfailover: hello-openshift
181-
externalIPs:
182-
- 1.1.1.1
183-
- 1.1.1.2
184-
----
185-
////

0 commit comments

Comments
 (0)