From 3c1220be832a8caf24b957b4910034a4b8f1b848 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Mon, 13 Jan 2020 17:43:24 -0600 Subject: [PATCH] Replace 1.1 with 127.1 This avoids pinging an external machine --- slides/k8s/kubectlrun.md | 44 +++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/slides/k8s/kubectlrun.md b/slides/k8s/kubectlrun.md index 9b7ae2ec..d16e9b5e 100644 --- a/slides/k8s/kubectlrun.md +++ b/slides/k8s/kubectlrun.md @@ -20,10 +20,9 @@ .exercise[ -- Let's ping `1.1.1.1`, Cloudflare's - [public DNS resolver](https://blog.cloudflare.com/announcing-1111/): +- Let's ping the address of `localhost`, the loopback interface: ```bash - kubectl run pingpong --image alpine ping 1.1.1.1 + kubectl run pingpong --image alpine ping 127.0.0.1 ``` @@ -367,12 +366,12 @@ Let's leave `kubectl logs` running while we keep exploring. ## Various ways of creating resources -- `kubectl run` +- `kubectl run` - easy way to get started - versatile -- `kubectl create ` +- `kubectl create ` - explicit, but lacks some features - can't create a CronJob before Kubernetes 1.14 @@ -516,15 +515,36 @@ class: extra-details --- -## Aren't we flooding 1.1.1.1? +class: extra-details -- If you're wondering this, good question! +## Party tricks involving IP addresses -- Don't worry, though: +- It is possible to specify an IP address with less than 4 bytes - *APNIC's research group held the IP addresses 1.1.1.1 and 1.0.0.1. While the addresses were valid, so many people had entered them into various random systems that they were continuously overwhelmed by a flood of garbage traffic. APNIC wanted to study this garbage traffic but any time they'd tried to announce the IPs, the flood would overwhelm any conventional network.* + (example: `127.1`) - (Source: https://blog.cloudflare.com/announcing-1111/) +- Zeroes are then inserted in the middle -- It's very unlikely that our concerted pings manage to produce - even a modest blip at Cloudflare's NOC! +- As a result, `127.1` expands to `127.0.0.1` + +- So we can `ping 127.1` to ping `localhost`! + +(See [this blog post](https://ma.ttias.be/theres-more-than-one-way-to-write-an-ip-address/ +) for more details.) + +--- + +class: extra-details + +## More party tricks with IP addresses + +- We can also ping `1.1` + +- `1.1` will expand to `1.0.0.1` + +- This is one of the addresses of Cloudflare's + [public DNS resolver](https://blog.cloudflare.com/announcing-1111/) + +- This is a quick way to check connectivity + + (if we can reach 1.1, we probably have internet access)