Simple “Hello, World” on EdgeNet
In this tutorial, we’re going to show you how to deploy a minimal experiment across EdgeNet and use it. This is a lighter version of the standard “Hello, World”, tutorial; it’s designed so that all you need to do is download a YAML file, then upload it to the Kubernetes dashboard on the headnode.
Though this is simpler than the original Hello, World tutorial, it is also ephemeral: we’re providing the server to catch the Hellos, and this won’t always be up.
What You Will Do
You will deploy a standard image to EdgeNet nodes around the world, which will execute a simple shell command to curl a webserver with your name (which you’ll pick) and the hostname. You can then view your successful Hellos at the server or on a mapping page we’ve prepared.
Technologies You Will Use
The technology that you will use is:
- Kubernetes, to deploy the containers to the EdgeNet nodes
- EdgeNet (see Using EdgeNet), making a note of your namespace
Get the File to Deploy the Slice
You have two choices: get a blank file and edit it yourself, or find a customized file in your browser.
- To get the blank file, get helloWorld.yaml.
You will need to change
in the last line to a nickname for yourself; please pick a good one.
- To get the file filled out with your nickname, fill out the form here and copy it from your browser.
Deploy a Service on EdgeNet
Click the Create Button in the top right. You should see this screen:
You can then “Create from Text Input” or “Create from File”. For either, use the file you downloaded, which will look like this:
apiVersion: extensions/v1beta1 kind: DaemonSet metadata: name: hello-world-new spec: template: metadata: labels: app: hello-world-new spec: hostNetwork: true containers: - name: hello-world-new image: tutum/curl command: ["/bin/sh"] args: ["-c", "while true; do curl http://princeton.edge-net.io:5000/hello/$(hostname)/<nickname>; sleep 7200; done"]
<nickname> is the name you chose/edited into the file.
hostNetwork:true tells Kubernetes to expose the ports from
the Pod. A
DaemonSet places a Pod on every node in EdgeNet. The name of your application is
it will use the Docker image
tutum/curl (an Ubuntu OS with
curl installed). It will then execute the command
/bin/sh -c "while true; do curl http://princeton.edge-net.io:5000/hello/$(hostname)/<nickname>; sleep 72000; done";
in other words, send a Hello to the server, sleep for a couple of hours, then send another (we assume you’ll take down the slice after a single Hello from each node).
Check out your Hellos
Suggested Future Reading
Here are some starting points for you to further explore the technologies used in this tutorial, and related technologies: