Created
November 6, 2019 15:04
-
-
Save mtjakobczyk/e054310624f70bbb0281b42fd252afaa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| for NODE_NAME in `kubectl get nodes | grep "Ready" | awk '{print $1}'`; do | |
| PODS_CIDR=`kubectl get nodes -o jsonpath="{.items[?(@.metadata.name==\"$NODE_NAME\")].spec.podCIDR}"` | |
| NODE_IP=`kubectl get nodes -o jsonpath="{.items[?(@.metadata.name==\"$NODE_NAME\")].status.addresses[?(@.type==\"InternalIP\")].address}"` | |
| echo "## $NODE_NAME ($NODE_IP) => Pods CIDR [$PODS_CIDR]" | |
| echo "sudo route add -net $PODS_CIDR gw $NODE_IP" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment