Skip to content

Instantly share code, notes, and snippets.

View mtjakobczyk's full-sized avatar

Michal Jakobczyk mtjakobczyk

  • Switzerland
View GitHub Profile
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
@mtjakobczyk
mtjakobczyk / michalsvm.cloud-config
Last active October 23, 2018 17:58
Cloud-config for a nginx with sample custom page
#cloud-config
write_files:
- content: |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Nginx HTTP Server on Oracle Cloud Infrastructure</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>