diff --git a/doc/ext/kubernetes/.zerotierCliSettings b/doc/ext/kubernetes/.zerotierCliSettings new file mode 100644 index 000000000..abe4cf6c4 --- /dev/null +++ b/doc/ext/kubernetes/.zerotierCliSettings @@ -0,0 +1,18 @@ +{ + "configVersion": 1, + "defaultCentral": "@my.zerotier.com", + "defaultController": "@my.zerotier.com", + "defaultOne": "@local", + "things": { + "local": { + "auth": "XXXXXXXXXXXXXXXXXXXXXXXX", + "type": "one", + "url": "http://127.0.0.1:9993/" + }, + "my.zerotier.com": { + "auth": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "type": "central", + "url": "https://my.zerotier.com/" + }, + } +} \ No newline at end of file diff --git a/doc/ext/kubernetes/Dockerfile b/doc/ext/kubernetes/Dockerfile new file mode 100644 index 000000000..030fac61e --- /dev/null +++ b/doc/ext/kubernetes/Dockerfile @@ -0,0 +1,8 @@ +FROM node:4.4 +EXPOSE 8080 +COPY server.js . +COPY zerotier . +COPY zerotier-cli . +COPY entrypoint.sh . +COPY .zerotierCliSettings ?> +CMD node server.js \ No newline at end of file diff --git a/doc/ext/kubernetes/entrypoint.sh b/doc/ext/kubernetes/entrypoint.sh new file mode 100644 index 000000000..0d26bd8f3 --- /dev/null +++ b/doc/ext/kubernetes/entrypoint.sh @@ -0,0 +1,3 @@ +./zerotier +zerotier-cli join $(NWID).conf +zerotier-cli net-auth $(NWID) $(DEVID) \ No newline at end of file diff --git a/doc/ext/kubernetes/server.js b/doc/ext/kubernetes/server.js new file mode 100644 index 000000000..a4b08bb8a --- /dev/null +++ b/doc/ext/kubernetes/server.js @@ -0,0 +1,8 @@ +var http = require('http'); +var handleRequest = function(request, response) { + console.log('Received request for URL: ' + request.url); + response.writeHead(200); + response.end('Hello World!'); +}; +var www = http.createServer(handleRequest); +www.listen(8080); diff --git a/doc/ext/ztkube.md b/doc/ext/kubernetes/ztkube.md similarity index 90% rename from doc/ext/ztkube.md rename to doc/ext/kubernetes/ztkube.md index be176a334..2f70cbad6 100644 --- a/doc/ext/ztkube.md +++ b/doc/ext/kubernetes/ztkube.md @@ -1,7 +1,7 @@ Kubernetes + ZeroTier ==== -A self-authorizing Kubernetes deployment on a ZeroTier private network. +A self-authorizing Kubernetes cluster deployment over a private ZeroTier network. This is a quick tutorial for setting up a Kubernetes deployment which can self-authorize each new replica onto your private ZeroTier network with no additional configuration needed when you scale. The Kubernetes-specific instructions and content is based on the [hellonode](http://kubernetes.io/docs/hellonode/) tutorial. All of the files discussed below can be found [here](); @@ -107,4 +107,4 @@ zerotier-cli net-auth $(NWID) $(DEVID) ## Verify -Now, after a minute or so you can use `zerotier-cli net-members ` to show all of your VM instances on your ZeroTier deployment network. If you haven't [configured your local CLI](), you can simply log into [my.zerotier.com](https://my.zerotier.com), go to *Networks -> nwid*. +Now, after a minute or so you can use `zerotier-cli net-members ` to show all of your VM instances on your ZeroTier deployment network. If you haven't [configured your local CLI](https://github.com/zerotier/ZeroTierOne/tree/dev/cli), you can simply log into [my.zerotier.com](https://my.zerotier.com), go to *Networks -> nwid* to check that your VMs are indeed members of your private network.