Skip to content

Instantly share code, notes, and snippets.

@therevoman
Last active August 6, 2021 06:18
Show Gist options
  • Save therevoman/06fe687a3a5b393065437297528b9ee5 to your computer and use it in GitHub Desktop.
Save therevoman/06fe687a3a5b393065437297528b9ee5 to your computer and use it in GitHub Desktop.

Cleaning up is hard to do.

This is borrowed from submariner uninstall

My bash loop for cleaning up iptables entries

for i in `oc get nodes -o name`; do echo $i; oc debug $i -- chroot /host sh -c 'sudo iptables --flush SUBMARINER-INPUT; sudo iptables -D INPUT $(iptables -L INPUT --line-numbers | grep SUBMARINER-INPUT | awk '\''{print $1}'\''); sudo iptables --delete-chain SUBMARINER-INPUT; sudo iptables -t nat --flush SUBMARINER-POSTROUTING; sudo iptables -t nat -D POSTROUTING $(iptables -t nat -L POSTROUTING --line-numbers | grep SUBMARINER-POSTROUTING | awk '\''{print $1}'\''); sudo iptables -t nat --delete-chain SUBMARINER-POSTROUTING'; done

My bash loop for removing the submariner vx interface

for i in `oc get nodes -o name`; do echo $i; oc debug compute$i -- chroot /host sudo ip link delete vx-submariner; done

Also, how I installed between AWS and lab bare metal clusters

in AWS context subctl cloud prepare aws --infra-id $infra_id --region $region --natt-port 4501 --gateway-instance m5a.large --oc p-metadata ocp/metadata.json subctl deploy-broker --kubeconfig ocp/auth/kubeconfig subctl join broker-info.subm --ikeport 501 --nattport 4501 --clusterid cg --operator-debug --pod-debug --preferred-server

in lab context cp ../../aws/aws-ipi-rhpds/broker-info.subm . subctl join broker-info.subm --ikeport 501 --nattport 4501 --operator-debug --pod-debug --clusterid ocs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment