examples: Remove torus example cluster

This commit is contained in:
Dalton Hubble
2017-02-13 16:33:40 -08:00
parent cfdec8cea0
commit 189f790a7e
10 changed files with 0 additions and 270 deletions

View File

@@ -50,7 +50,6 @@ The [examples](https://github.com/coreos/matchbox/tree/master/examples) network
* Multi-node [self-hosted](bootkube.md) Kubernetes cluster
* [Upgrading](bootkube-upgrades.md) self-hosted Kubernetes clusters
* Multi-node etcd2 or etcd3 cluster
* Multi-node [Torus](torus.md) distributed storage cluster
* Network boot or Install to Disk
* Multi-stage CoreOS installs
* [GRUB Netboot](grub.md) CoreOS

View File

@@ -1,117 +0,0 @@
# Torus Storage
The Torus example provisions a 3 node CoreOS cluster, with `etcd3` and Torus, to demonstrate a stand-alone storage cluster. Each of the 3 nodes runs a Torus instance which makes 1GiB of space available (configured per node by "torus_storage_size" in machine group metadata).
## Requirements
Ensure that you've gone through the [matchbox with rkt](getting-started-rkt.md) guide and understand the basics. In particular, you should be able to:
* Use rkt or Docker to start `matchbox`
* Create a network boot environment with `coreos/dnsmasq`
* Create the example libvirt client VMs
* `/etc/hosts` entries for `node[1-3].example.com` (or pass custom names to `k8s-certgen`)
* Install the Torus [binaries](https://github.com/coreos/torus/releases)
## Examples
The [examples](../examples) statically assign IP addresses to libvirt client VMs created by `scripts/libvirt`. The examples can be used for physical machines if you update the MAC addresses. See [network setup](network-setup.md) and [deployment](deployment.md).
* [torus](../examples/groups/torus) - iPXE boot a Torus cluster
## Assets
Download the CoreOS image assets referenced in the target [profile](../examples/profiles).
./scripts/get-coreos stable 1235.9.0 ./examples/assets
## Containers
Use rkt or docker to start `matchbox` and mount `torus` example. Create a network boot environment and power-on your machines. Revisit [matchbox with rkt](getting-started-rkt.md) or [matchbox with Docker](getting-started-docker.md) for help.
Client machines should network boot and provision themselves.
## Verify
Install the Torus [binaries](https://github.com/coreos/torus/releases) on your laptop. Torus uses etcd3 for coordination and metadata storage, so any etcd node in the cluster can be queried with `torusctl`.
./torusctl --etcd node1.example.com:2379 list-peers
Run `list-peers` to report the status of data nodes in the Torus cluster.
```
+--------------------------------+--------------------------------------+---------+------+--------+---------------+--------------+
| ADDRESS | UUID | SIZE | USED | MEMBER | UPDATED | REB/REP DATA |
+--------------------------------+--------------------------------------+---------+------+--------+---------------+--------------+
| http://node1.example.com:40000 | 67145622-52cb-11e6-a886-525400a19cae | 1.0 GiB | 0 B | OK | 2 seconds ago | 0 B/sec |
| http://node2.example.com:40000 | 6978182a-52cb-11e6-b41d-525400b22f86 | 1.0 GiB | 0 B | OK | 3 seconds ago | 0 B/sec |
| http://node3.example.com:40000 | 6e0e4d7d-52cb-11e6-af25-525400c36177 | 1.0 GiB | 0 B | OK | now | 0 B/sec |
+--------------------------------+--------------------------------------+---------+------+--------+---------------+--------------+
```
Torus has already initialized its metadata within etcd3 to format the cluster and added all peers to the pool. Each node provides 1 GiB of storage and has `MEMBER` status `OK`.
### Volume Creation
Create a new replicated, virtual block device or `volume` on Torus.
./torusctl --etcd=node1.example.com:2379 block create hello 500MiB
List the current volumes,
./torusctl --etcd=node1.example.com:2379 volume list
and verify that `hello` was created.
```
+-------------+---------+
| VOLUME NAME | SIZE |
+-------------+---------+
| hello | 500 MiB |
+-------------+---------+
```
### Filesystems and Mounting
Let's attach the Torus volume, create a filesystem, and add some files. Add the `nbd` kernel module.
sudo modprobe nbd
sudo ./torusblk --etcd=node1.example.com:2379 nbd hello
In a new shell, create a new filesystem on the volume and mount it on your system.
sudo mkfs.ext4 /dev/nbd0
sudo mkdir -p /mnt/hello
sudo mount /dev/nbd0 -o discard,noatime /mnt/hello
Check that the mounted filesystem is present.
$ mount | grep nbd
/dev/nbd0 on /mnt/hello type ext4 (rw,noatime,seclabel,discard,data=ordered)
### Simulate Failure
By default, Torus uses a replication factor of 2. You may write some data and poweroff one of the three nodes if you wish.
sudo sh -c "echo 'hello world' > /mnt/hello/world"
sudo virsh destroy node3 # actually equivalent to poweroff
Check the Torus data nodes.
$ ./torusctl --etcd node1.example.com:2379 list-peers
```
+--------------------------+--------------------------------------+---------+--------+--------+---------------+--------------+
| ADDRESS | UUID | SIZE | USED | MEMBER | UPDATED | REB/REP DATA |
+--------------------------+--------------------------------------+---------+--------+--------+---------------+--------------+
| http://node1.example.com:40000 | 016fad6a-2e23-11e6-8ced-525400a19cae | 1.0 GiB | 22 MiB | OK | 3 seconds ago | 0 B/sec |
| http://node2.example.com:40000 | 0c67d31c-2e23-11e6-91f5-525400b22f86 | 1.0 GiB | 22 MiB | OK | 3 seconds ago | 0 B/sec |
| | 0408cbba-2e23-11e6-9871-525400c36177 | ??? | ??? | DOWN | Missing | |
+--------------------------+--------------------------------------+---------+--------+--------+---------------+--------------+
Balanced: true Usage: 2.15%
```
## Going Further
See the [Torus](https://github.com/coreos/torus) project to learn more about Torus and contribute.

View File

@@ -40,7 +40,6 @@ The [examples](examples) network boot and provision CoreOS clusters. Network boo
* Multi-node [self-hosted](Documentation/bootkube.md) Kubernetes cluster
* [Upgrading](Documentation/bootkube-upgrades.md) self-hosted Kubernetes clusters
* Multi-node etcd2 or etcd3 cluster
* Multi-node [Torus](Documentation/torus.md) distributed storage cluster
* Network boot and/or install to disk (multi-stage installs)
### Enterprise

View File

@@ -18,7 +18,6 @@ These examples network boot and provision machines into CoreOS clusters using `m
| rktnetes-install | Kubernetes cluster with rkt container runtime, installed to disk (experimental) | stable/1235.9.0 | Disk | [tutorial](../Documentation/rktnetes.md) |
| bootkube | iPXE boot a self-hosted Kubernetes cluster (with bootkube) | stable/1235.9.0 | Disk | [tutorial](../Documentation/bootkube.md) |
| bootkube-install | Install a self-hosted Kubernetes cluster (with bootkube) | stable/1235.9.0 | Disk | [tutorial](../Documentation/bootkube.md) |
| torus | Torus distributed storage | stable/1235.9.0 | Disk | [tutorial](../Documentation/torus.md) |
## Tutorials
@@ -30,7 +29,6 @@ Get started running `matchbox` on your Linux machine to network boot and provisi
* [Kubernetes (static manifests)](../Documentation/kubernetes.md)
* [Kubernetes (rktnetes)](../Documentation/rktnetes.md)
* [Kubernetes (self-hosted)](../Documentation/bootkube.md)
* [Torus Storage](../Documentation/torus.md)
* [Lab Examples](https://github.com/dghubble/metal)
## Autologin

View File

@@ -1,15 +0,0 @@
{
"id": "node1",
"name": "Torus Node 1",
"profile": "torus",
"selector": {
"mac": "52:54:00:a1:9c:ae"
},
"metadata": {
"domain_name": "node1.example.com",
"etcd_initial_cluster": "node1=http://node1.example.com:2380,node2=http://node2.example.com:2380,node3=http://node3.example.com:2380",
"etcd_name": "node1",
"pxe": "true",
"torus_storage_size": "1GiB"
}
}

View File

@@ -1,15 +0,0 @@
{
"id": "node2",
"name": "Torus Node 2",
"profile": "torus",
"selector": {
"mac": "52:54:00:b2:2f:86"
},
"metadata": {
"domain_name": "node2.example.com",
"etcd_initial_cluster": "node1=http://node1.example.com:2380,node2=http://node2.example.com:2380,node3=http://node3.example.com:2380",
"etcd_name": "node2",
"pxe": "true",
"torus_storage_size": "1GiB"
}
}

View File

@@ -1,15 +0,0 @@
{
"id": "node3",
"name": "Torus Node 3",
"profile": "torus",
"selector": {
"mac": "52:54:00:c3:61:77"
},
"metadata": {
"domain_name": "node3.example.com",
"etcd_initial_cluster": "node1=http://node1.example.com:2380,node2=http://node2.example.com:2380,node3=http://node3.example.com:2380",
"etcd_name": "node3",
"pxe": "true",
"torus_storage_size": "1GiB"
}
}

View File

@@ -1,86 +0,0 @@
---
systemd:
units:
- name: etcd3.service
enable: true
contents: |
[Unit]
Description=etcd3
Conflicts=etcd2.service
[Service]
Type=notify
Environment="RKT_OPTS=--volume=resolv,kind=host,source=/etc/resolv.conf --mount volume=resolv,target=/etc/resolv.conf"
ExecStartPre=/usr/bin/mkdir -p /var/lib/etcd3
ExecStartPre=/usr/bin/rkt trust --prefix "coreos.com/etcd" --skip-fingerprint-review
ExecStart=/usr/bin/rkt run \
--net=host \
--volume data-dir,kind=host,source=/var/lib/etcd3 \
--mount volume=data-dir,target=/var/lib/etcd3 \
$RKT_OPTS \
coreos.com/etcd:v3.0.6 -- \
-name={{.etcd_name}} \
-advertise-client-urls=http://{{.domain_name}}:2379 \
-initial-advertise-peer-urls=http://{{.domain_name}}:2380 \
-listen-client-urls=http://0.0.0.0:2379 \
-listen-peer-urls=http://0.0.0.0:2380 \
-initial-cluster={{.etcd_initial_cluster}} \
-data-dir=/var/lib/etcd3
Restart=always
RestartSec=10
LimitNOFILE=40000
TimeoutStartSec=0
[Install]
WantedBy=multi-user.target
- name: torus.service
enable: true
contents: |
[Unit]
Description=CoreOS Torus
Requires=etcd3.service
After=etcd3.service
Requires=docker.service
After=docker.service
[Service]
ExecStartPre=/usr/bin/mkdir -p /srv/torus
ExecStart=/usr/bin/docker run \
--net=host \
-v /srv/torus:/data \
-e STORAGE_SIZE={{.torus_storage_size}} \
-e LISTEN_HOST={{.domain_name}} \
-e ETCD_HOST=127.0.0.1 \
-e ETCD_PORT=2379 \
-e AUTO_JOIN=1 \
-e DEBUG_INIT=1 \
quay.io/coreos/torus:v0.1.1
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
storage:
{{ if index . "pxe" }}
disks:
- device: /dev/sda
wipe_table: true
partitions:
- label: ROOT
filesystems:
- name: root
mount:
device: "/dev/sda1"
format: "ext4"
create:
force: true
options:
- "-LROOT"
{{end}}
{{ if index . "ssh_authorized_keys" }}
passwd:
users:
- name: core
ssh_authorized_keys:
{{ range $element := .ssh_authorized_keys }}
- {{$element}}
{{end}}
{{end}}

View File

@@ -1,17 +0,0 @@
{
"id": "torus",
"name": "torus",
"boot": {
"kernel": "/assets/coreos/1235.9.0/coreos_production_pxe.vmlinuz",
"initrd": ["/assets/coreos/1235.9.0/coreos_production_pxe_image.cpio.gz"],
"args": [
"root=/dev/sda1",
"coreos.config.url=http://matchbox.foo:8080/ignition?uuid=${uuid}&mac=${mac:hexhyp}",
"coreos.first_boot=yes",
"console=tty0",
"console=ttyS0",
"coreos.autologin"
]
},
"ignition_id": "torus.yaml"
}

View File

@@ -35,4 +35,3 @@ pages:
- rktnetes (static): 'rktnetes.md'
- Self-hosted Kubernetes: 'bootkube.md'
- Upgrading Kubernetes: 'bootkube-upgrades.md'
- Torus: 'torus.md'