Created
October 2, 2023 07:05
-
-
Save ikurni/7cdbc4ccc25032e6115aa9c4851a3074 to your computer and use it in GitHub Desktop.
Change Active Openshift Master Node IP Address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It's not recommended to change the active running OCP Master nodes IP Properties unless it's really required to be done. | |
# To do that, please follow below guide : | |
# 1. Update the DNS server to use new IP for the target master nodes | |
# 2. Change the node IP Address from "nmcli" or "nmtui", and reboot the server | |
# 3. Post reboot, the existing will act normally, but somehow, etcd is not in healthy state. Re-add the etcd member will solve | |
# 4. Check which etcd pods is CLBO | |
oc project openshift-etcd | |
oc get pods -l k8s-app=etcd | |
# 5. Remote shell to running etcd pods to remove unhealthy member | |
oc rsh <name of the etcd-pods> | |
sh-4.4# etcdctl member list -w table | |
sh-4.4# etcdctl member remove <name of the etcd member> | |
sh-4.4# exit | |
# 6. Patch the etcd/cluster object to modify config overrides | |
oc patch etcd/cluster --type=merge -p '{"spec": {"unsupportedConfigOverrides": {"useUnsupportedUnsafeNonHANonProductionUnstableEtcd": true}}}' | |
# 7. Delete existing etcd secrets for that specific pods | |
oc get secret | grep -i <name of the etcd-pods> | |
oc delete secret <output of above commands 3x > | |
# 8. Double check the secret list, make sure it has been recreated | |
oc get secret | grep -i <name of the etcd-pods> | |
# 9. Wait for a while, and the new etcd member will join again | |
oc rsh <name of the etcd-pods> | |
sh-4.4# etcdctl member list -w table | |
sh-4.4# exit | |
# 10. Patch back the etcd/cluster object to original state | |
oc patch etcd/cluster --type=merge -p '{"spec": {"unsupportedConfigOverrides": null }}' | |
# Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment