|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * networking/configuring-ipfailover.adoc |
| 4 | + |
| 5 | +[id="nw-ipfailover-remove_{context}"] |
| 6 | += Removing IP failover |
| 7 | + |
| 8 | +When IP failover is initially configured, the worker nodes in the cluster are modified with an `iptables` rule that explicitly allows multicast packets on `224.0.0.18` for Keepalived. Because of the change to the nodes, removing IP failover requires running a job to remove the `iptables` rule and removing the virtual IP addresses used by Keepalived. |
| 9 | + |
| 10 | +.Procedure |
| 11 | + |
| 12 | +. Optional: Identify and delete any check and notify scripts that are stored as config maps: |
| 13 | + |
| 14 | +.. Identify whether any pods for IP failover use a config map as a volume: |
| 15 | ++ |
| 16 | +[source,terminal] |
| 17 | +---- |
| 18 | +$ oc get pod -l ipfailover \ |
| 19 | + -o jsonpath="\ |
| 20 | +{range .items[?(@.spec.volumes[*].configMap)]} |
| 21 | +{'Namespace: '}{.metadata.namespace} |
| 22 | +{'Pod: '}{.metadata.name} |
| 23 | +{'Volumes that use config maps:'} |
| 24 | +{range .spec.volumes[?(@.configMap)]} {'volume: '}{.name} |
| 25 | + {'configMap: '}{.configMap.name}{'\n'}{end} |
| 26 | +{end}" |
| 27 | +---- |
| 28 | ++ |
| 29 | +.Example output |
| 30 | +---- |
| 31 | +Namespace: default |
| 32 | +Pod: keepalived-worker-59df45db9c-2x9mn |
| 33 | +Volumes that use config maps: |
| 34 | + volume: config-volume |
| 35 | + configMap: mycustomcheck |
| 36 | +---- |
| 37 | + |
| 38 | +.. If the preceding step provided the names of config maps that are used as volumes, delete the config maps: |
| 39 | ++ |
| 40 | +[source,terminal] |
| 41 | +---- |
| 42 | +$ oc delete configmap <configmap_name> |
| 43 | +---- |
| 44 | + |
| 45 | +. Identify an existing deployment for IP failover: |
| 46 | ++ |
| 47 | +[source,terminal] |
| 48 | +---- |
| 49 | +$ oc get deployment -l ipfailover |
| 50 | +---- |
| 51 | ++ |
| 52 | +.Example output |
| 53 | +[source,terminal] |
| 54 | +---- |
| 55 | +NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE |
| 56 | +default ipfailover 2/2 2 2 105d |
| 57 | +---- |
| 58 | + |
| 59 | +. Delete the deployment: |
| 60 | ++ |
| 61 | +[source,terminal] |
| 62 | +---- |
| 63 | +$ oc delete deployment <ipfailover_deployment_name> |
| 64 | +---- |
| 65 | + |
| 66 | +. Remove the `ipfailover` service account: |
| 67 | ++ |
| 68 | +[source,terminal] |
| 69 | +---- |
| 70 | +$ oc delete sa ipfailover |
| 71 | +---- |
| 72 | + |
| 73 | +. Run a job that removes the IP tables rule that was added when IP failover was initially configured: |
| 74 | + |
| 75 | +.. Create a file such as `remove-ipfailover-job.yaml` with contents that are similar to the following example: |
| 76 | ++ |
| 77 | +[source,yaml,subs="attributes+"] |
| 78 | +---- |
| 79 | +apiVersion: batch/v1 |
| 80 | +kind: Job |
| 81 | +metadata: |
| 82 | + generateName: remove-ipfailover- |
| 83 | + labels: |
| 84 | + app: remove-ipfailover |
| 85 | +spec: |
| 86 | + template: |
| 87 | + metadata: |
| 88 | + name: remove-ipfailover |
| 89 | + spec: |
| 90 | + containers: |
| 91 | + - name: remove-ipfailover |
| 92 | + image: quay.io/openshift/origin-keepalived-ipfailover:{product-version} |
| 93 | + command: ["/var/lib/ipfailover/keepalived/remove-failover.sh"] |
| 94 | + nodeSelector: |
| 95 | + kubernetes.io/hostname: <host_name> <.> |
| 96 | + restartPolicy: Never |
| 97 | +---- |
| 98 | +<.> Run the job for each node in your cluster that was configured for IP failover and replace the host name each time. |
| 99 | + |
| 100 | +.. Run the job: |
| 101 | ++ |
| 102 | +[source,terminal] |
| 103 | +---- |
| 104 | +$ oc create -f remove-ipfailover-job.yaml |
| 105 | +---- |
| 106 | ++ |
| 107 | +.Example output |
| 108 | +---- |
| 109 | +job.batch/remove-ipfailover-2h8dm created |
| 110 | +---- |
| 111 | + |
| 112 | +.Verification |
| 113 | + |
| 114 | +* Confirm that the job removed the initial configuration for IP failover. |
| 115 | ++ |
| 116 | +[source,terminal] |
| 117 | +---- |
| 118 | +$ oc logs job/remove-ipfailover-2h8dm |
| 119 | +---- |
| 120 | ++ |
| 121 | +.Example output |
| 122 | +[source,terminal] |
| 123 | +---- |
| 124 | +remove-failover.sh: OpenShift IP Failover service terminating. |
| 125 | + - Removing ip_vs module ... |
| 126 | + - Cleaning up ... |
| 127 | + - Releasing VIPs (interface eth0) ... |
| 128 | +---- |
0 commit comments