mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 04:53:44 +02:00
kubernetes tutorial update
This commit is contained in:
parent
ba78676ace
commit
1833c61556
1 changed files with 16 additions and 16 deletions
|
@ -9,9 +9,9 @@ This is a quick tutorial for setting up a Kubernetes deployment which can self-a
|
||||||
|
|
||||||
## Preliminary tasks
|
## Preliminary tasks
|
||||||
|
|
||||||
**Step 1: Go to [my.zerotier.com](https://my.zerotier.com) and generate an API key. This key will be used by ZeroTier to automatically authorize new instances of your VMs to join your deployment network during replication.**a
|
**Step 1: Go to [my.zerotier.com](https://my.zerotier.com) and generate an API key. This key will be used by ZeroTier to automatically authorize new instances of your VMs to join your deployment network during replication.**
|
||||||
|
|
||||||
**Step 2: Create a new `private` network. Take note of the network ID: `nwid`**
|
**Step 2: Create a new `private` network. Take note of the network ID, henceforth: `nwid`**
|
||||||
|
|
||||||
**Step 3: Follow the instructions from the [hellonode](ttp://kubernetes.io/docs/hellonode/) tutorial and set up your development system (install Google Cloud SDK).**
|
**Step 3: Follow the instructions from the [hellonode](ttp://kubernetes.io/docs/hellonode/) tutorial and set up your development system (install Google Cloud SDK).**
|
||||||
|
|
||||||
|
@ -24,17 +24,8 @@ This is a quick tutorial for setting up a Kubernetes deployment which can self-a
|
||||||
- `mkdir ztkube`
|
- `mkdir ztkube`
|
||||||
|
|
||||||
Add the following files to the `ztkube` directory. These files will be compiled into the Docker image.
|
Add the following files to the `ztkube` directory. These files will be compiled into the Docker image.
|
||||||
|
|
||||||
|
- Create an empty `<nwid>.conf` file to specify the private deployment network you created in *Step 2*:
|
||||||
Create an empty file to specify the private deployment network you created in *Step 2*:
|
|
||||||
- `<nwid>.conf`
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
./zerotier
|
|
||||||
zerotier-cli join $(NWID).conf
|
|
||||||
zerotier-cli net-auth $(NWID) $(DEVID)
|
|
||||||
```
|
|
||||||
|
|
||||||
- The CLI tool config file `.zerotierCliSettings` should contain your API keys to authorize new devices on your network. In this example the default controller is hosted by us at [my.zerotier.com](https://my.zerotier.com). Alternatively, you can host your own network controller but you'll need to modify the CLI config file accordingly.
|
- The CLI tool config file `.zerotierCliSettings` should contain your API keys to authorize new devices on your network. In this example the default controller is hosted by us at [my.zerotier.com](https://my.zerotier.com). Alternatively, you can host your own network controller but you'll need to modify the CLI config file accordingly.
|
||||||
|
|
||||||
|
@ -73,7 +64,13 @@ COPY .zerotierCliSettings <settings path>?>
|
||||||
CMD node server.js
|
CMD node server.js
|
||||||
```
|
```
|
||||||
|
|
||||||
- The `entrypoint.sh` script will start the ZeroTier service in the VM, attempt to join your deployment network and automatically authorize the new VM if your network is set to private.
|
- The `entrypoint.sh` script will start the ZeroTier service in the VM, attempt to join your deployment network and automatically authorize the new VM if your network is set to private:
|
||||||
|
|
||||||
|
```
|
||||||
|
./zerotier
|
||||||
|
zerotier-cli join $(NWID).conf
|
||||||
|
zerotier-cli net-auth $(NWID) $(DEVID)
|
||||||
|
```
|
||||||
|
|
||||||
**Step 5: Lastly, build the image:**
|
**Step 5: Lastly, build the image:**
|
||||||
|
|
||||||
|
@ -81,11 +78,12 @@ CMD node server.js
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
**Step 6: Push the docker image to your *Container Registry**
|
**Step 6: Push the docker image to your *Container Registry***
|
||||||
|
|
||||||
`gcloud docker push gcr.io/$PROJECT_ID/hello-node:v1`
|
`gcloud docker push gcr.io/$PROJECT_ID/hello-node:v1`
|
||||||
|
|
||||||
|
|
||||||
|
## Deploy!
|
||||||
|
|
||||||
**Step 7: Create Kubernetes Cluster**
|
**Step 7: Create Kubernetes Cluster**
|
||||||
|
|
||||||
|
@ -107,4 +105,6 @@ CMD node server.js
|
||||||
|
|
||||||
`kubectl scale deployment hello-node --replicas=4`
|
`kubectl scale deployment hello-node --replicas=4`
|
||||||
|
|
||||||
Now, after a minute or so you can use `zerotier-cli net-members <nwid>` 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>*.
|
## Verify
|
||||||
|
|
||||||
|
Now, after a minute or so you can use `zerotier-cli net-members <nwid>` 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*.
|
||||||
|
|
Loading…
Add table
Reference in a new issue