Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #26 from venkat-443/registry_setup_update
Browse files Browse the repository at this point in the history
Merge registry-bootstrap-ds.yaml and registry-ds.yaml
  • Loading branch information
Meatz authored Mar 29, 2018
2 parents c7d187b + 186d52e commit 5a3fb2b
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 124 deletions.
1 change: 1 addition & 0 deletions deploy/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: quobyte-config
namespace: quobyte
data:
registry.bootstrap_node: "qb1"
registry.min_mem: 64m
registry.max_mem: 512m
metadata.min_mem: 256m
Expand Down
115 changes: 0 additions & 115 deletions deploy/registry-bootstrap-ds.yaml

This file was deleted.

46 changes: 46 additions & 0 deletions deploy/registry-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,52 @@ spec:
configMapKeyRef:
name: quobyte-config
key: registry.min_mem
- name: CURRENT_NODE
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: QUOBYTE_BOOTSTRAP_NODE
valueFrom:
configMapKeyRef:
name: quobyte-config
key: registry.bootstrap_node
command:
- /bin/bash
- -xec
- |
if [ "${QUOBYTE_BOOTSTRAP_NODE}" = "${CURRENT_NODE}" ]; then
sed "s/.*MIN_MEM_REGISTRY=.*/MIN_MEM_REGISTRY=${MIN_MEM}/" -i /etc/default/quobyte
sed "s/.*MAX_MEM_REGISTRY=.*/MAX_MEM_REGISTRY=${MAX_MEM}/" -i /etc/default/quobyte
mkdir -p /var/lib/quobyte/devices/registry-bootstrap
if [ ! -f /var/lib/quobyte/devices/registry-bootstrap/QUOBYTE_DEV_SETUP ]; then
mkdir -p /devices/dev1
cat > /var/lib/quobyte/devices/registry-bootstrap/QUOBYTE_DEV_SETUP <<EOF
device.serial=$(uuidgen)
device.model=Kubernetes-hostDir
device.type=DIR_DEVICE
EOF
if [ $(nslookup ${QUOBYTE_REGISTRY} | grep -A10 -m1 -e 'Name:' | wc -l) == 0 ]; then
echo "device.bootstrap=true" >> /var/lib/quobyte/devices/registry-bootstrap/QUOBYTE_DEV_SETUP
fi
fi
if [ ! -f /var/lib/quobyte/devices/registry-bootstrap/UUID ]; then
echo uuid=$(uuidgen) >> /var/lib/quobyte/devices/registry-bootstrap/UUID
fi
cat /var/lib/quobyte/devices/registry-bootstrap/UUID >> /etc/quobyte/$QUOBYTE_SERVICE.cfg
fi
exec /bin/bash -x /opt/main.sh
lifecycle:
preStop:
exec:
command:
- /bin/bash
- -xe
- |
if [ "${QUOBYTE_BOOTSTRAP_NODE}" = "${CURRENT_NODE}" ]; then
qmgmt -u api registry remove $(grep device.id= /var/lib/quobyte/devices/registry-bootstrap/QUOBYTE_DEV_ID | cut -d= -f2)
rm -rf /var/lib/quobyte/devices/registry-bootstrap/
fi
ports:
- name: rpc-tcp
containerPort: 7861
Expand Down
19 changes: 10 additions & 9 deletions server_quick_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,25 @@ first, start registries, data, and metadata services on the target pods
and let the device inspector create the devices.
Afterwards, it is safe to delete the bootstrap registry again.

First, create the quobyte namespace, and set up a config and services.
Quobyte setup requires bootstrap node. Update `registry.bootstrap_node` in `deploy/config.yaml` with bootstrap node.

Label your bootstrap node as registry.
```bash
kubectl label node <bootstrap-node> quobyte_registry="true"
```

Create the quobyte namespace, set up config and services.

```bash
kubectl create -f quobyte-ns.yaml
kubectl -n quobyte create -f config.yaml
kubectl -n quobyte create -f quobyte-services.yaml

kubectl -n quobyte create -f registry-bootstrap-ds.yaml
kubectl -n quobyte create -f registry-ds.yaml
kubectl -n quobyte create -f data-ds.yaml
kubectl -n quobyte create -f metadata-ds.yaml
```

Choose any node to be the initial bootstrap registry.

```bash
kubectl label nodes qb1 quobyte_bootstrap="true"
```
As soon as the registry is up, start the webconsole, api, and qmgmt pods:

```bash
Expand All @@ -53,10 +54,10 @@ The services will show up in the webconsole and the Device Inspector will help
to set up the devices.

```bash
kubectl label nodes <node> quobyte_metadata="true"
kubectl label nodes <node> quobyte_data="true"
kubectl label nodes <node> quobyte_registry="true"
kubectl label nodes <node> quobyte_metadata="true"
```

Once you have three other registries set up on physical devices, it's safe
to remove the `quobyte_bootstrap` label and delete the registry pod.
to remove the `quobyte_registry` label, delete the registry pod on the bootstrap node and update `registry.bootstrap_node` in `deploy/config.yaml` with empty string`""`.

0 comments on commit 5a3fb2b

Please sign in to comment.